Skip to content

Commit 3c65d52

Browse files
feat: [aiplatform] add UpdateExplanationDataset to aiplatform (#9549)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 541213716 Source-Link: https://togithub.com/googleapis/googleapis/commit/4a858c4e033098aaecd29dc9302f406d9eb39684 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/e4c3eab1fda49c5d9619bb82872a0a7e81f83528 Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiJlNGMzZWFiMWZkYTQ5YzVkOTYxOWJiODI4NzJhMGE3ZTgxZjgzNTI4In0= BEGIN_NESTED_COMMIT feat: [aiplatform] add bias_configs to ModelEvaluation PiperOrigin-RevId: 540693440 Source-Link: https://togithub.com/googleapis/googleapis/commit/2d7af5120792dfc48b80aaf52118bd1a12fca190 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/c5b5857483bc4f5b30d88850869f0e3302a82dc3 Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiJjNWI1ODU3NDgzYmM0ZjViMzBkODg4NTA4NjlmMGUzMzAyYTgyZGMzIn0= END_NESTED_COMMIT
1 parent a093cb3 commit 3c65d52

File tree

23 files changed

+5050
-263
lines changed

23 files changed

+5050
-263
lines changed

java-aiplatform/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>26.16.0</version>
23+
<version>26.17.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>

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

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,166 @@ public final UnaryCallable<UpdateModelRequest, Model> updateModelCallable() {
909909
return stub.updateModelCallable();
910910
}
911911

912+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
913+
/**
914+
* Incrementally update the dataset used for an examples model.
915+
*
916+
* <p>Sample code:
917+
*
918+
* <pre>{@code
919+
* // This snippet has been automatically generated and should be regarded as a code template only.
920+
* // It will require modifications to work:
921+
* // - It may require correct/in-range values for request initialization.
922+
* // - It may require specifying regional endpoints when creating the service client as shown in
923+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
924+
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
925+
* ModelName model = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
926+
* UpdateExplanationDatasetResponse response =
927+
* modelServiceClient.updateExplanationDatasetAsync(model).get();
928+
* }
929+
* }</pre>
930+
*
931+
* @param model Required. The resource name of the Model to update. Format:
932+
* `projects/{project}/locations/{location}/models/{model}`
933+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
934+
*/
935+
public final OperationFuture<
936+
UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata>
937+
updateExplanationDatasetAsync(ModelName model) {
938+
UpdateExplanationDatasetRequest request =
939+
UpdateExplanationDatasetRequest.newBuilder()
940+
.setModel(model == null ? null : model.toString())
941+
.build();
942+
return updateExplanationDatasetAsync(request);
943+
}
944+
945+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
946+
/**
947+
* Incrementally update the dataset used for an examples model.
948+
*
949+
* <p>Sample code:
950+
*
951+
* <pre>{@code
952+
* // This snippet has been automatically generated and should be regarded as a code template only.
953+
* // It will require modifications to work:
954+
* // - It may require correct/in-range values for request initialization.
955+
* // - It may require specifying regional endpoints when creating the service client as shown in
956+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
957+
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
958+
* String model = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
959+
* UpdateExplanationDatasetResponse response =
960+
* modelServiceClient.updateExplanationDatasetAsync(model).get();
961+
* }
962+
* }</pre>
963+
*
964+
* @param model Required. The resource name of the Model to update. Format:
965+
* `projects/{project}/locations/{location}/models/{model}`
966+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
967+
*/
968+
public final OperationFuture<
969+
UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata>
970+
updateExplanationDatasetAsync(String model) {
971+
UpdateExplanationDatasetRequest request =
972+
UpdateExplanationDatasetRequest.newBuilder().setModel(model).build();
973+
return updateExplanationDatasetAsync(request);
974+
}
975+
976+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
977+
/**
978+
* Incrementally update the dataset used for an examples model.
979+
*
980+
* <p>Sample code:
981+
*
982+
* <pre>{@code
983+
* // This snippet has been automatically generated and should be regarded as a code template only.
984+
* // It will require modifications to work:
985+
* // - It may require correct/in-range values for request initialization.
986+
* // - It may require specifying regional endpoints when creating the service client as shown in
987+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
988+
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
989+
* UpdateExplanationDatasetRequest request =
990+
* UpdateExplanationDatasetRequest.newBuilder()
991+
* .setModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
992+
* .setExamples(Examples.newBuilder().build())
993+
* .build();
994+
* UpdateExplanationDatasetResponse response =
995+
* modelServiceClient.updateExplanationDatasetAsync(request).get();
996+
* }
997+
* }</pre>
998+
*
999+
* @param request The request object containing all of the parameters for the API call.
1000+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1001+
*/
1002+
public final OperationFuture<
1003+
UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata>
1004+
updateExplanationDatasetAsync(UpdateExplanationDatasetRequest request) {
1005+
return updateExplanationDatasetOperationCallable().futureCall(request);
1006+
}
1007+
1008+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1009+
/**
1010+
* Incrementally update the dataset used for an examples model.
1011+
*
1012+
* <p>Sample code:
1013+
*
1014+
* <pre>{@code
1015+
* // This snippet has been automatically generated and should be regarded as a code template only.
1016+
* // It will require modifications to work:
1017+
* // - It may require correct/in-range values for request initialization.
1018+
* // - It may require specifying regional endpoints when creating the service client as shown in
1019+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1020+
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1021+
* UpdateExplanationDatasetRequest request =
1022+
* UpdateExplanationDatasetRequest.newBuilder()
1023+
* .setModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
1024+
* .setExamples(Examples.newBuilder().build())
1025+
* .build();
1026+
* OperationFuture<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata>
1027+
* future =
1028+
* modelServiceClient.updateExplanationDatasetOperationCallable().futureCall(request);
1029+
* // Do something.
1030+
* UpdateExplanationDatasetResponse response = future.get();
1031+
* }
1032+
* }</pre>
1033+
*/
1034+
public final OperationCallable<
1035+
UpdateExplanationDatasetRequest,
1036+
UpdateExplanationDatasetResponse,
1037+
UpdateExplanationDatasetOperationMetadata>
1038+
updateExplanationDatasetOperationCallable() {
1039+
return stub.updateExplanationDatasetOperationCallable();
1040+
}
1041+
1042+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1043+
/**
1044+
* Incrementally update the dataset used for an examples model.
1045+
*
1046+
* <p>Sample code:
1047+
*
1048+
* <pre>{@code
1049+
* // This snippet has been automatically generated and should be regarded as a code template only.
1050+
* // It will require modifications to work:
1051+
* // - It may require correct/in-range values for request initialization.
1052+
* // - It may require specifying regional endpoints when creating the service client as shown in
1053+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1054+
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1055+
* UpdateExplanationDatasetRequest request =
1056+
* UpdateExplanationDatasetRequest.newBuilder()
1057+
* .setModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
1058+
* .setExamples(Examples.newBuilder().build())
1059+
* .build();
1060+
* ApiFuture<Operation> future =
1061+
* modelServiceClient.updateExplanationDatasetCallable().futureCall(request);
1062+
* // Do something.
1063+
* Operation response = future.get();
1064+
* }
1065+
* }</pre>
1066+
*/
1067+
public final UnaryCallable<UpdateExplanationDatasetRequest, Operation>
1068+
updateExplanationDatasetCallable() {
1069+
return stub.updateExplanationDatasetCallable();
1070+
}
1071+
9121072
// AUTO-GENERATED DOCUMENTATION AND METHOD.
9131073
/**
9141074
* Deletes a Model.

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,22 @@ public UnaryCallSettings<UpdateModelRequest, Model> updateModelSettings() {
124124
return ((ModelServiceStubSettings) getStubSettings()).updateModelSettings();
125125
}
126126

127+
/** Returns the object with the settings used for calls to updateExplanationDataset. */
128+
public UnaryCallSettings<UpdateExplanationDatasetRequest, Operation>
129+
updateExplanationDatasetSettings() {
130+
return ((ModelServiceStubSettings) getStubSettings()).updateExplanationDatasetSettings();
131+
}
132+
133+
/** Returns the object with the settings used for calls to updateExplanationDataset. */
134+
public OperationCallSettings<
135+
UpdateExplanationDatasetRequest,
136+
UpdateExplanationDatasetResponse,
137+
UpdateExplanationDatasetOperationMetadata>
138+
updateExplanationDatasetOperationSettings() {
139+
return ((ModelServiceStubSettings) getStubSettings())
140+
.updateExplanationDatasetOperationSettings();
141+
}
142+
127143
/** Returns the object with the settings used for calls to deleteModel. */
128144
public UnaryCallSettings<DeleteModelRequest, Operation> deleteModelSettings() {
129145
return ((ModelServiceStubSettings) getStubSettings()).deleteModelSettings();
@@ -384,6 +400,21 @@ public UnaryCallSettings.Builder<UpdateModelRequest, Model> updateModelSettings(
384400
return getStubSettingsBuilder().updateModelSettings();
385401
}
386402

403+
/** Returns the builder for the settings used for calls to updateExplanationDataset. */
404+
public UnaryCallSettings.Builder<UpdateExplanationDatasetRequest, Operation>
405+
updateExplanationDatasetSettings() {
406+
return getStubSettingsBuilder().updateExplanationDatasetSettings();
407+
}
408+
409+
/** Returns the builder for the settings used for calls to updateExplanationDataset. */
410+
public OperationCallSettings.Builder<
411+
UpdateExplanationDatasetRequest,
412+
UpdateExplanationDatasetResponse,
413+
UpdateExplanationDatasetOperationMetadata>
414+
updateExplanationDatasetOperationSettings() {
415+
return getStubSettingsBuilder().updateExplanationDatasetOperationSettings();
416+
}
417+
387418
/** Returns the builder for the settings used for calls to deleteModel. */
388419
public UnaryCallSettings.Builder<DeleteModelRequest, Operation> deleteModelSettings() {
389420
return getStubSettingsBuilder().deleteModelSettings();

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,9 @@
700700
"TestIamPermissions": {
701701
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
702702
},
703+
"UpdateExplanationDataset": {
704+
"methods": ["updateExplanationDatasetAsync", "updateExplanationDatasetAsync", "updateExplanationDatasetAsync", "updateExplanationDatasetOperationCallable", "updateExplanationDatasetCallable"]
705+
},
703706
"UpdateModel": {
704707
"methods": ["updateModel", "updateModel", "updateModelCallable"]
705708
},

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

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959
import com.google.cloud.aiplatform.v1.Model;
6060
import com.google.cloud.aiplatform.v1.ModelEvaluation;
6161
import com.google.cloud.aiplatform.v1.ModelEvaluationSlice;
62+
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata;
63+
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest;
64+
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse;
6265
import com.google.cloud.aiplatform.v1.UpdateModelRequest;
6366
import com.google.cloud.aiplatform.v1.UploadModelOperationMetadata;
6467
import com.google.cloud.aiplatform.v1.UploadModelRequest;
@@ -133,6 +136,16 @@ public class GrpcModelServiceStub extends ModelServiceStub {
133136
.setResponseMarshaller(ProtoUtils.marshaller(Model.getDefaultInstance()))
134137
.build();
135138

139+
private static final MethodDescriptor<UpdateExplanationDatasetRequest, Operation>
140+
updateExplanationDatasetMethodDescriptor =
141+
MethodDescriptor.<UpdateExplanationDatasetRequest, Operation>newBuilder()
142+
.setType(MethodDescriptor.MethodType.UNARY)
143+
.setFullMethodName("google.cloud.aiplatform.v1.ModelService/UpdateExplanationDataset")
144+
.setRequestMarshaller(
145+
ProtoUtils.marshaller(UpdateExplanationDatasetRequest.getDefaultInstance()))
146+
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
147+
.build();
148+
136149
private static final MethodDescriptor<DeleteModelRequest, Operation> deleteModelMethodDescriptor =
137150
MethodDescriptor.<DeleteModelRequest, Operation>newBuilder()
138151
.setType(MethodDescriptor.MethodType.UNARY)
@@ -325,6 +338,13 @@ public class GrpcModelServiceStub extends ModelServiceStub {
325338
private final UnaryCallable<ListModelVersionsRequest, ListModelVersionsPagedResponse>
326339
listModelVersionsPagedCallable;
327340
private final UnaryCallable<UpdateModelRequest, Model> updateModelCallable;
341+
private final UnaryCallable<UpdateExplanationDatasetRequest, Operation>
342+
updateExplanationDatasetCallable;
343+
private final OperationCallable<
344+
UpdateExplanationDatasetRequest,
345+
UpdateExplanationDatasetResponse,
346+
UpdateExplanationDatasetOperationMetadata>
347+
updateExplanationDatasetOperationCallable;
328348
private final UnaryCallable<DeleteModelRequest, Operation> deleteModelCallable;
329349
private final OperationCallable<DeleteModelRequest, Empty, DeleteOperationMetadata>
330350
deleteModelOperationCallable;
@@ -462,6 +482,17 @@ protected GrpcModelServiceStub(
462482
return builder.build();
463483
})
464484
.build();
485+
GrpcCallSettings<UpdateExplanationDatasetRequest, Operation>
486+
updateExplanationDatasetTransportSettings =
487+
GrpcCallSettings.<UpdateExplanationDatasetRequest, Operation>newBuilder()
488+
.setMethodDescriptor(updateExplanationDatasetMethodDescriptor)
489+
.setParamsExtractor(
490+
request -> {
491+
RequestParamsBuilder builder = RequestParamsBuilder.create();
492+
builder.add("model", String.valueOf(request.getModel()));
493+
return builder.build();
494+
})
495+
.build();
465496
GrpcCallSettings<DeleteModelRequest, Operation> deleteModelTransportSettings =
466497
GrpcCallSettings.<DeleteModelRequest, Operation>newBuilder()
467498
.setMethodDescriptor(deleteModelMethodDescriptor)
@@ -679,6 +710,17 @@ protected GrpcModelServiceStub(
679710
this.updateModelCallable =
680711
callableFactory.createUnaryCallable(
681712
updateModelTransportSettings, settings.updateModelSettings(), clientContext);
713+
this.updateExplanationDatasetCallable =
714+
callableFactory.createUnaryCallable(
715+
updateExplanationDatasetTransportSettings,
716+
settings.updateExplanationDatasetSettings(),
717+
clientContext);
718+
this.updateExplanationDatasetOperationCallable =
719+
callableFactory.createOperationCallable(
720+
updateExplanationDatasetTransportSettings,
721+
settings.updateExplanationDatasetOperationSettings(),
722+
clientContext,
723+
operationsStub);
682724
this.deleteModelCallable =
683725
callableFactory.createUnaryCallable(
684726
deleteModelTransportSettings, settings.deleteModelSettings(), clientContext);
@@ -839,6 +881,21 @@ public UnaryCallable<UpdateModelRequest, Model> updateModelCallable() {
839881
return updateModelCallable;
840882
}
841883

884+
@Override
885+
public UnaryCallable<UpdateExplanationDatasetRequest, Operation>
886+
updateExplanationDatasetCallable() {
887+
return updateExplanationDatasetCallable;
888+
}
889+
890+
@Override
891+
public OperationCallable<
892+
UpdateExplanationDatasetRequest,
893+
UpdateExplanationDatasetResponse,
894+
UpdateExplanationDatasetOperationMetadata>
895+
updateExplanationDatasetOperationCallable() {
896+
return updateExplanationDatasetOperationCallable;
897+
}
898+
842899
@Override
843900
public UnaryCallable<DeleteModelRequest, Operation> deleteModelCallable() {
844901
return deleteModelCallable;

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
import com.google.cloud.aiplatform.v1.Model;
5555
import com.google.cloud.aiplatform.v1.ModelEvaluation;
5656
import com.google.cloud.aiplatform.v1.ModelEvaluationSlice;
57+
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata;
58+
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest;
59+
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse;
5760
import com.google.cloud.aiplatform.v1.UpdateModelRequest;
5861
import com.google.cloud.aiplatform.v1.UploadModelOperationMetadata;
5962
import com.google.cloud.aiplatform.v1.UploadModelRequest;
@@ -120,6 +123,20 @@ public UnaryCallable<UpdateModelRequest, Model> updateModelCallable() {
120123
throw new UnsupportedOperationException("Not implemented: updateModelCallable()");
121124
}
122125

126+
public OperationCallable<
127+
UpdateExplanationDatasetRequest,
128+
UpdateExplanationDatasetResponse,
129+
UpdateExplanationDatasetOperationMetadata>
130+
updateExplanationDatasetOperationCallable() {
131+
throw new UnsupportedOperationException(
132+
"Not implemented: updateExplanationDatasetOperationCallable()");
133+
}
134+
135+
public UnaryCallable<UpdateExplanationDatasetRequest, Operation>
136+
updateExplanationDatasetCallable() {
137+
throw new UnsupportedOperationException("Not implemented: updateExplanationDatasetCallable()");
138+
}
139+
123140
public OperationCallable<DeleteModelRequest, Empty, DeleteOperationMetadata>
124141
deleteModelOperationCallable() {
125142
throw new UnsupportedOperationException("Not implemented: deleteModelOperationCallable()");

0 commit comments

Comments
 (0)