Skip to content

Commit 4114021

Browse files
feat: add UpsertDatapoints and RemoveDatapoints rpcs to IndexService in aiplatform v1 index_service.proto (#1030)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 469481982 Source-Link: googleapis/googleapis@e4fe55a Source-Link: https://github.com/googleapis/googleapis-gen/commit/1ff3c40d85fe8f13538b0f2264d60f806d744fd2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWZmM2M0MGQ4NWZlOGYxMzUzOGIwZjIyNjRkNjBmODA2ZDc0NGZkMiJ9 feat: add UpsertDatapoints and RemoveDatapoints rpcs to IndexService in aiplatform v1beta1 index_service.proto PiperOrigin-RevId: 469481692 Source-Link: googleapis/googleapis@624cc45 Source-Link: https://github.com/googleapis/googleapis-gen/commit/fd6880812cab6b3434a7e1d339a99907698f9508 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmQ2ODgwODEyY2FiNmIzNDM0YTdlMWQzMzlhOTk5MDc2OThmOTUwOCJ9
1 parent 5adefd4 commit 4114021

File tree

105 files changed

+20296
-588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+20296
-588
lines changed

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/IndexServiceClient.java

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,112 @@ public final UnaryCallable<DeleteIndexRequest, Operation> deleteIndexCallable()
800800
return stub.deleteIndexCallable();
801801
}
802802

803+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
804+
/**
805+
* Add/update Datapoints into an Index.
806+
*
807+
* <p>Sample code:
808+
*
809+
* <pre>{@code
810+
* // This snippet has been automatically generated for illustrative purposes only.
811+
* // It may require modifications to work in your environment.
812+
* try (IndexServiceClient indexServiceClient = IndexServiceClient.create()) {
813+
* UpsertDatapointsRequest request =
814+
* UpsertDatapointsRequest.newBuilder()
815+
* .setIndex(IndexName.of("[PROJECT]", "[LOCATION]", "[INDEX]").toString())
816+
* .addAllDatapoints(new ArrayList<IndexDatapoint>())
817+
* .build();
818+
* UpsertDatapointsResponse response = indexServiceClient.upsertDatapoints(request);
819+
* }
820+
* }</pre>
821+
*
822+
* @param request The request object containing all of the parameters for the API call.
823+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
824+
*/
825+
public final UpsertDatapointsResponse upsertDatapoints(UpsertDatapointsRequest request) {
826+
return upsertDatapointsCallable().call(request);
827+
}
828+
829+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
830+
/**
831+
* Add/update Datapoints into an Index.
832+
*
833+
* <p>Sample code:
834+
*
835+
* <pre>{@code
836+
* // This snippet has been automatically generated for illustrative purposes only.
837+
* // It may require modifications to work in your environment.
838+
* try (IndexServiceClient indexServiceClient = IndexServiceClient.create()) {
839+
* UpsertDatapointsRequest request =
840+
* UpsertDatapointsRequest.newBuilder()
841+
* .setIndex(IndexName.of("[PROJECT]", "[LOCATION]", "[INDEX]").toString())
842+
* .addAllDatapoints(new ArrayList<IndexDatapoint>())
843+
* .build();
844+
* ApiFuture<UpsertDatapointsResponse> future =
845+
* indexServiceClient.upsertDatapointsCallable().futureCall(request);
846+
* // Do something.
847+
* UpsertDatapointsResponse response = future.get();
848+
* }
849+
* }</pre>
850+
*/
851+
public final UnaryCallable<UpsertDatapointsRequest, UpsertDatapointsResponse>
852+
upsertDatapointsCallable() {
853+
return stub.upsertDatapointsCallable();
854+
}
855+
856+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
857+
/**
858+
* Remove Datapoints from an Index.
859+
*
860+
* <p>Sample code:
861+
*
862+
* <pre>{@code
863+
* // This snippet has been automatically generated for illustrative purposes only.
864+
* // It may require modifications to work in your environment.
865+
* try (IndexServiceClient indexServiceClient = IndexServiceClient.create()) {
866+
* RemoveDatapointsRequest request =
867+
* RemoveDatapointsRequest.newBuilder()
868+
* .setIndex(IndexName.of("[PROJECT]", "[LOCATION]", "[INDEX]").toString())
869+
* .addAllDatapointIds(new ArrayList<String>())
870+
* .build();
871+
* RemoveDatapointsResponse response = indexServiceClient.removeDatapoints(request);
872+
* }
873+
* }</pre>
874+
*
875+
* @param request The request object containing all of the parameters for the API call.
876+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
877+
*/
878+
public final RemoveDatapointsResponse removeDatapoints(RemoveDatapointsRequest request) {
879+
return removeDatapointsCallable().call(request);
880+
}
881+
882+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
883+
/**
884+
* Remove Datapoints from an Index.
885+
*
886+
* <p>Sample code:
887+
*
888+
* <pre>{@code
889+
* // This snippet has been automatically generated for illustrative purposes only.
890+
* // It may require modifications to work in your environment.
891+
* try (IndexServiceClient indexServiceClient = IndexServiceClient.create()) {
892+
* RemoveDatapointsRequest request =
893+
* RemoveDatapointsRequest.newBuilder()
894+
* .setIndex(IndexName.of("[PROJECT]", "[LOCATION]", "[INDEX]").toString())
895+
* .addAllDatapointIds(new ArrayList<String>())
896+
* .build();
897+
* ApiFuture<RemoveDatapointsResponse> future =
898+
* indexServiceClient.removeDatapointsCallable().futureCall(request);
899+
* // Do something.
900+
* RemoveDatapointsResponse response = future.get();
901+
* }
902+
* }</pre>
903+
*/
904+
public final UnaryCallable<RemoveDatapointsRequest, RemoveDatapointsResponse>
905+
removeDatapointsCallable() {
906+
return stub.removeDatapointsCallable();
907+
}
908+
803909
// AUTO-GENERATED DOCUMENTATION AND METHOD.
804910
/**
805911
* Lists information about the supported locations for this service.

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/IndexServiceSettings.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,18 @@ public UnaryCallSettings<DeleteIndexRequest, Operation> deleteIndexSettings() {
127127
return ((IndexServiceStubSettings) getStubSettings()).deleteIndexOperationSettings();
128128
}
129129

130+
/** Returns the object with the settings used for calls to upsertDatapoints. */
131+
public UnaryCallSettings<UpsertDatapointsRequest, UpsertDatapointsResponse>
132+
upsertDatapointsSettings() {
133+
return ((IndexServiceStubSettings) getStubSettings()).upsertDatapointsSettings();
134+
}
135+
136+
/** Returns the object with the settings used for calls to removeDatapoints. */
137+
public UnaryCallSettings<RemoveDatapointsRequest, RemoveDatapointsResponse>
138+
removeDatapointsSettings() {
139+
return ((IndexServiceStubSettings) getStubSettings()).removeDatapointsSettings();
140+
}
141+
130142
/** Returns the object with the settings used for calls to listLocations. */
131143
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
132144
listLocationsSettings() {
@@ -296,6 +308,18 @@ public UnaryCallSettings.Builder<DeleteIndexRequest, Operation> deleteIndexSetti
296308
return getStubSettingsBuilder().deleteIndexOperationSettings();
297309
}
298310

311+
/** Returns the builder for the settings used for calls to upsertDatapoints. */
312+
public UnaryCallSettings.Builder<UpsertDatapointsRequest, UpsertDatapointsResponse>
313+
upsertDatapointsSettings() {
314+
return getStubSettingsBuilder().upsertDatapointsSettings();
315+
}
316+
317+
/** Returns the builder for the settings used for calls to removeDatapoints. */
318+
public UnaryCallSettings.Builder<RemoveDatapointsRequest, RemoveDatapointsResponse>
319+
removeDatapointsSettings() {
320+
return getStubSettingsBuilder().removeDatapointsSettings();
321+
}
322+
299323
/** Returns the builder for the settings used for calls to listLocations. */
300324
public PagedCallSettings.Builder<
301325
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/ModelServiceClient.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,9 +1151,9 @@ public final UnaryCallable<DeleteModelVersionRequest, Operation> deleteModelVers
11511151
* explicitly included.
11521152
* <p>Example: `projects/{project}/locations/{location}/models/{model}{@literal @}1234`
11531153
* @param versionAliases Required. The set of version aliases to merge. The alias should be at
1154-
* most 128 characters, and match `[a-z][a-z0-9-]{0,126}[a-z-0-9]`. Add the `-` prefix to an
1155-
* alias means removing that alias from the version. `-` is NOT counted in the 128 characters.
1156-
* Example: `-golden` means removing the `golden` alias from the version.
1154+
* most 128 characters, and match `[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]`. Add the `-` prefix to
1155+
* an alias means removing that alias from the version. `-` is NOT counted in the 128
1156+
* characters. Example: `-golden` means removing the `golden` alias from the version.
11571157
* <p>There is NO ordering in aliases, which means 1) The aliases returned from GetModel API
11581158
* might not have the exactly same order from this MergeVersionAliases API. 2) Adding and
11591159
* deleting the same alias in the request is not recommended, and the 2 operations will be
@@ -1189,9 +1189,9 @@ public final Model mergeVersionAliases(ModelName name, List<String> versionAlias
11891189
* explicitly included.
11901190
* <p>Example: `projects/{project}/locations/{location}/models/{model}{@literal @}1234`
11911191
* @param versionAliases Required. The set of version aliases to merge. The alias should be at
1192-
* most 128 characters, and match `[a-z][a-z0-9-]{0,126}[a-z-0-9]`. Add the `-` prefix to an
1193-
* alias means removing that alias from the version. `-` is NOT counted in the 128 characters.
1194-
* Example: `-golden` means removing the `golden` alias from the version.
1192+
* most 128 characters, and match `[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]`. Add the `-` prefix to
1193+
* an alias means removing that alias from the version. `-` is NOT counted in the 128
1194+
* characters. Example: `-golden` means removing the `golden` alias from the version.
11951195
* <p>There is NO ordering in aliases, which means 1) The aliases returned from GetModel API
11961196
* might not have the exactly same order from this MergeVersionAliases API. 2) Adding and
11971197
* deleting the same alias in the request is not recommended, and the 2 operations will be

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/gapic_metadata.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@
295295
"ListLocations": {
296296
"methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
297297
},
298+
"RemoveDatapoints": {
299+
"methods": ["removeDatapoints", "removeDatapointsCallable"]
300+
},
298301
"SetIamPolicy": {
299302
"methods": ["setIamPolicy", "setIamPolicyCallable"]
300303
},
@@ -303,6 +306,9 @@
303306
},
304307
"UpdateIndex": {
305308
"methods": ["updateIndexAsync", "updateIndexAsync", "updateIndexOperationCallable", "updateIndexCallable"]
309+
},
310+
"UpsertDatapoints": {
311+
"methods": ["upsertDatapoints", "upsertDatapointsCallable"]
306312
}
307313
}
308314
}

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcIndexServiceStub.java

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@
3434
import com.google.cloud.aiplatform.v1.Index;
3535
import com.google.cloud.aiplatform.v1.ListIndexesRequest;
3636
import com.google.cloud.aiplatform.v1.ListIndexesResponse;
37+
import com.google.cloud.aiplatform.v1.RemoveDatapointsRequest;
38+
import com.google.cloud.aiplatform.v1.RemoveDatapointsResponse;
3739
import com.google.cloud.aiplatform.v1.UpdateIndexOperationMetadata;
3840
import com.google.cloud.aiplatform.v1.UpdateIndexRequest;
41+
import com.google.cloud.aiplatform.v1.UpsertDatapointsRequest;
42+
import com.google.cloud.aiplatform.v1.UpsertDatapointsResponse;
3943
import com.google.cloud.location.GetLocationRequest;
4044
import com.google.cloud.location.ListLocationsRequest;
4145
import com.google.cloud.location.ListLocationsResponse;
@@ -105,6 +109,28 @@ public class GrpcIndexServiceStub extends IndexServiceStub {
105109
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
106110
.build();
107111

112+
private static final MethodDescriptor<UpsertDatapointsRequest, UpsertDatapointsResponse>
113+
upsertDatapointsMethodDescriptor =
114+
MethodDescriptor.<UpsertDatapointsRequest, UpsertDatapointsResponse>newBuilder()
115+
.setType(MethodDescriptor.MethodType.UNARY)
116+
.setFullMethodName("google.cloud.aiplatform.v1.IndexService/UpsertDatapoints")
117+
.setRequestMarshaller(
118+
ProtoUtils.marshaller(UpsertDatapointsRequest.getDefaultInstance()))
119+
.setResponseMarshaller(
120+
ProtoUtils.marshaller(UpsertDatapointsResponse.getDefaultInstance()))
121+
.build();
122+
123+
private static final MethodDescriptor<RemoveDatapointsRequest, RemoveDatapointsResponse>
124+
removeDatapointsMethodDescriptor =
125+
MethodDescriptor.<RemoveDatapointsRequest, RemoveDatapointsResponse>newBuilder()
126+
.setType(MethodDescriptor.MethodType.UNARY)
127+
.setFullMethodName("google.cloud.aiplatform.v1.IndexService/RemoveDatapoints")
128+
.setRequestMarshaller(
129+
ProtoUtils.marshaller(RemoveDatapointsRequest.getDefaultInstance()))
130+
.setResponseMarshaller(
131+
ProtoUtils.marshaller(RemoveDatapointsResponse.getDefaultInstance()))
132+
.build();
133+
108134
private static final MethodDescriptor<ListLocationsRequest, ListLocationsResponse>
109135
listLocationsMethodDescriptor =
110136
MethodDescriptor.<ListLocationsRequest, ListLocationsResponse>newBuilder()
@@ -164,6 +190,10 @@ public class GrpcIndexServiceStub extends IndexServiceStub {
164190
private final UnaryCallable<DeleteIndexRequest, Operation> deleteIndexCallable;
165191
private final OperationCallable<DeleteIndexRequest, Empty, DeleteOperationMetadata>
166192
deleteIndexOperationCallable;
193+
private final UnaryCallable<UpsertDatapointsRequest, UpsertDatapointsResponse>
194+
upsertDatapointsCallable;
195+
private final UnaryCallable<RemoveDatapointsRequest, RemoveDatapointsResponse>
196+
removeDatapointsCallable;
167197
private final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable;
168198
private final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
169199
listLocationsPagedCallable;
@@ -265,6 +295,28 @@ protected GrpcIndexServiceStub(
265295
return params.build();
266296
})
267297
.build();
298+
GrpcCallSettings<UpsertDatapointsRequest, UpsertDatapointsResponse>
299+
upsertDatapointsTransportSettings =
300+
GrpcCallSettings.<UpsertDatapointsRequest, UpsertDatapointsResponse>newBuilder()
301+
.setMethodDescriptor(upsertDatapointsMethodDescriptor)
302+
.setParamsExtractor(
303+
request -> {
304+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
305+
params.put("index", String.valueOf(request.getIndex()));
306+
return params.build();
307+
})
308+
.build();
309+
GrpcCallSettings<RemoveDatapointsRequest, RemoveDatapointsResponse>
310+
removeDatapointsTransportSettings =
311+
GrpcCallSettings.<RemoveDatapointsRequest, RemoveDatapointsResponse>newBuilder()
312+
.setMethodDescriptor(removeDatapointsMethodDescriptor)
313+
.setParamsExtractor(
314+
request -> {
315+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
316+
params.put("index", String.valueOf(request.getIndex()));
317+
return params.build();
318+
})
319+
.build();
268320
GrpcCallSettings<ListLocationsRequest, ListLocationsResponse> listLocationsTransportSettings =
269321
GrpcCallSettings.<ListLocationsRequest, ListLocationsResponse>newBuilder()
270322
.setMethodDescriptor(listLocationsMethodDescriptor)
@@ -353,6 +405,12 @@ protected GrpcIndexServiceStub(
353405
settings.deleteIndexOperationSettings(),
354406
clientContext,
355407
operationsStub);
408+
this.upsertDatapointsCallable =
409+
callableFactory.createUnaryCallable(
410+
upsertDatapointsTransportSettings, settings.upsertDatapointsSettings(), clientContext);
411+
this.removeDatapointsCallable =
412+
callableFactory.createUnaryCallable(
413+
removeDatapointsTransportSettings, settings.removeDatapointsSettings(), clientContext);
356414
this.listLocationsCallable =
357415
callableFactory.createUnaryCallable(
358416
listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
@@ -430,6 +488,18 @@ public UnaryCallable<DeleteIndexRequest, Operation> deleteIndexCallable() {
430488
return deleteIndexOperationCallable;
431489
}
432490

491+
@Override
492+
public UnaryCallable<UpsertDatapointsRequest, UpsertDatapointsResponse>
493+
upsertDatapointsCallable() {
494+
return upsertDatapointsCallable;
495+
}
496+
497+
@Override
498+
public UnaryCallable<RemoveDatapointsRequest, RemoveDatapointsResponse>
499+
removeDatapointsCallable() {
500+
return removeDatapointsCallable;
501+
}
502+
433503
@Override
434504
public UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
435505
return listLocationsCallable;

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/IndexServiceStub.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@
3030
import com.google.cloud.aiplatform.v1.Index;
3131
import com.google.cloud.aiplatform.v1.ListIndexesRequest;
3232
import com.google.cloud.aiplatform.v1.ListIndexesResponse;
33+
import com.google.cloud.aiplatform.v1.RemoveDatapointsRequest;
34+
import com.google.cloud.aiplatform.v1.RemoveDatapointsResponse;
3335
import com.google.cloud.aiplatform.v1.UpdateIndexOperationMetadata;
3436
import com.google.cloud.aiplatform.v1.UpdateIndexRequest;
37+
import com.google.cloud.aiplatform.v1.UpsertDatapointsRequest;
38+
import com.google.cloud.aiplatform.v1.UpsertDatapointsResponse;
3539
import com.google.cloud.location.GetLocationRequest;
3640
import com.google.cloud.location.ListLocationsRequest;
3741
import com.google.cloud.location.ListLocationsResponse;
@@ -98,6 +102,16 @@ public UnaryCallable<DeleteIndexRequest, Operation> deleteIndexCallable() {
98102
throw new UnsupportedOperationException("Not implemented: deleteIndexCallable()");
99103
}
100104

105+
public UnaryCallable<UpsertDatapointsRequest, UpsertDatapointsResponse>
106+
upsertDatapointsCallable() {
107+
throw new UnsupportedOperationException("Not implemented: upsertDatapointsCallable()");
108+
}
109+
110+
public UnaryCallable<RemoveDatapointsRequest, RemoveDatapointsResponse>
111+
removeDatapointsCallable() {
112+
throw new UnsupportedOperationException("Not implemented: removeDatapointsCallable()");
113+
}
114+
101115
public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
102116
listLocationsPagedCallable() {
103117
throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy