|
34 | 34 | import com.google.cloud.aiplatform.v1.Index;
|
35 | 35 | import com.google.cloud.aiplatform.v1.ListIndexesRequest;
|
36 | 36 | import com.google.cloud.aiplatform.v1.ListIndexesResponse;
|
| 37 | +import com.google.cloud.aiplatform.v1.RemoveDatapointsRequest; |
| 38 | +import com.google.cloud.aiplatform.v1.RemoveDatapointsResponse; |
37 | 39 | import com.google.cloud.aiplatform.v1.UpdateIndexOperationMetadata;
|
38 | 40 | import com.google.cloud.aiplatform.v1.UpdateIndexRequest;
|
| 41 | +import com.google.cloud.aiplatform.v1.UpsertDatapointsRequest; |
| 42 | +import com.google.cloud.aiplatform.v1.UpsertDatapointsResponse; |
39 | 43 | import com.google.cloud.location.GetLocationRequest;
|
40 | 44 | import com.google.cloud.location.ListLocationsRequest;
|
41 | 45 | import com.google.cloud.location.ListLocationsResponse;
|
@@ -105,6 +109,28 @@ public class GrpcIndexServiceStub extends IndexServiceStub {
|
105 | 109 | .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
|
106 | 110 | .build();
|
107 | 111 |
|
| 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 | + |
108 | 134 | private static final MethodDescriptor<ListLocationsRequest, ListLocationsResponse>
|
109 | 135 | listLocationsMethodDescriptor =
|
110 | 136 | MethodDescriptor.<ListLocationsRequest, ListLocationsResponse>newBuilder()
|
@@ -164,6 +190,10 @@ public class GrpcIndexServiceStub extends IndexServiceStub {
|
164 | 190 | private final UnaryCallable<DeleteIndexRequest, Operation> deleteIndexCallable;
|
165 | 191 | private final OperationCallable<DeleteIndexRequest, Empty, DeleteOperationMetadata>
|
166 | 192 | deleteIndexOperationCallable;
|
| 193 | + private final UnaryCallable<UpsertDatapointsRequest, UpsertDatapointsResponse> |
| 194 | + upsertDatapointsCallable; |
| 195 | + private final UnaryCallable<RemoveDatapointsRequest, RemoveDatapointsResponse> |
| 196 | + removeDatapointsCallable; |
167 | 197 | private final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable;
|
168 | 198 | private final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
|
169 | 199 | listLocationsPagedCallable;
|
@@ -265,6 +295,28 @@ protected GrpcIndexServiceStub(
|
265 | 295 | return params.build();
|
266 | 296 | })
|
267 | 297 | .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(); |
268 | 320 | GrpcCallSettings<ListLocationsRequest, ListLocationsResponse> listLocationsTransportSettings =
|
269 | 321 | GrpcCallSettings.<ListLocationsRequest, ListLocationsResponse>newBuilder()
|
270 | 322 | .setMethodDescriptor(listLocationsMethodDescriptor)
|
@@ -353,6 +405,12 @@ protected GrpcIndexServiceStub(
|
353 | 405 | settings.deleteIndexOperationSettings(),
|
354 | 406 | clientContext,
|
355 | 407 | operationsStub);
|
| 408 | + this.upsertDatapointsCallable = |
| 409 | + callableFactory.createUnaryCallable( |
| 410 | + upsertDatapointsTransportSettings, settings.upsertDatapointsSettings(), clientContext); |
| 411 | + this.removeDatapointsCallable = |
| 412 | + callableFactory.createUnaryCallable( |
| 413 | + removeDatapointsTransportSettings, settings.removeDatapointsSettings(), clientContext); |
356 | 414 | this.listLocationsCallable =
|
357 | 415 | callableFactory.createUnaryCallable(
|
358 | 416 | listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
|
@@ -430,6 +488,18 @@ public UnaryCallable<DeleteIndexRequest, Operation> deleteIndexCallable() {
|
430 | 488 | return deleteIndexOperationCallable;
|
431 | 489 | }
|
432 | 490 |
|
| 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 | + |
433 | 503 | @Override
|
434 | 504 | public UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
|
435 | 505 | return listLocationsCallable;
|
|
0 commit comments