Skip to content

Commit

Permalink
feat: [aiplatform] add UpdateExplanationDataset to aiplatform (#9549)
Browse files Browse the repository at this point in the history
- [ ] 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
  • Loading branch information
gcf-owl-bot[bot] authored Jun 22, 2023
1 parent a093cb3 commit 3c65d52
Show file tree
Hide file tree
Showing 23 changed files with 5,050 additions and 263 deletions.
2 changes: 1 addition & 1 deletion java-aiplatform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.16.0</version>
<version>26.17.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,166 @@ public final UnaryCallable<UpdateModelRequest, Model> updateModelCallable() {
return stub.updateModelCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Incrementally update the dataset used for an examples model.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
* ModelName model = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
* UpdateExplanationDatasetResponse response =
* modelServiceClient.updateExplanationDatasetAsync(model).get();
* }
* }</pre>
*
* @param model Required. The resource name of the Model to update. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<
UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata>
updateExplanationDatasetAsync(ModelName model) {
UpdateExplanationDatasetRequest request =
UpdateExplanationDatasetRequest.newBuilder()
.setModel(model == null ? null : model.toString())
.build();
return updateExplanationDatasetAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Incrementally update the dataset used for an examples model.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
* String model = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
* UpdateExplanationDatasetResponse response =
* modelServiceClient.updateExplanationDatasetAsync(model).get();
* }
* }</pre>
*
* @param model Required. The resource name of the Model to update. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<
UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata>
updateExplanationDatasetAsync(String model) {
UpdateExplanationDatasetRequest request =
UpdateExplanationDatasetRequest.newBuilder().setModel(model).build();
return updateExplanationDatasetAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Incrementally update the dataset used for an examples model.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
* UpdateExplanationDatasetRequest request =
* UpdateExplanationDatasetRequest.newBuilder()
* .setModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
* .setExamples(Examples.newBuilder().build())
* .build();
* UpdateExplanationDatasetResponse response =
* modelServiceClient.updateExplanationDatasetAsync(request).get();
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<
UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata>
updateExplanationDatasetAsync(UpdateExplanationDatasetRequest request) {
return updateExplanationDatasetOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Incrementally update the dataset used for an examples model.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
* UpdateExplanationDatasetRequest request =
* UpdateExplanationDatasetRequest.newBuilder()
* .setModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
* .setExamples(Examples.newBuilder().build())
* .build();
* OperationFuture<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata>
* future =
* modelServiceClient.updateExplanationDatasetOperationCallable().futureCall(request);
* // Do something.
* UpdateExplanationDatasetResponse response = future.get();
* }
* }</pre>
*/
public final OperationCallable<
UpdateExplanationDatasetRequest,
UpdateExplanationDatasetResponse,
UpdateExplanationDatasetOperationMetadata>
updateExplanationDatasetOperationCallable() {
return stub.updateExplanationDatasetOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Incrementally update the dataset used for an examples model.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
* UpdateExplanationDatasetRequest request =
* UpdateExplanationDatasetRequest.newBuilder()
* .setModel(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
* .setExamples(Examples.newBuilder().build())
* .build();
* ApiFuture<Operation> future =
* modelServiceClient.updateExplanationDatasetCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<UpdateExplanationDatasetRequest, Operation>
updateExplanationDatasetCallable() {
return stub.updateExplanationDatasetCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a Model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@ public UnaryCallSettings<UpdateModelRequest, Model> updateModelSettings() {
return ((ModelServiceStubSettings) getStubSettings()).updateModelSettings();
}

/** Returns the object with the settings used for calls to updateExplanationDataset. */
public UnaryCallSettings<UpdateExplanationDatasetRequest, Operation>
updateExplanationDatasetSettings() {
return ((ModelServiceStubSettings) getStubSettings()).updateExplanationDatasetSettings();
}

/** Returns the object with the settings used for calls to updateExplanationDataset. */
public OperationCallSettings<
UpdateExplanationDatasetRequest,
UpdateExplanationDatasetResponse,
UpdateExplanationDatasetOperationMetadata>
updateExplanationDatasetOperationSettings() {
return ((ModelServiceStubSettings) getStubSettings())
.updateExplanationDatasetOperationSettings();
}

/** Returns the object with the settings used for calls to deleteModel. */
public UnaryCallSettings<DeleteModelRequest, Operation> deleteModelSettings() {
return ((ModelServiceStubSettings) getStubSettings()).deleteModelSettings();
Expand Down Expand Up @@ -384,6 +400,21 @@ public UnaryCallSettings.Builder<UpdateModelRequest, Model> updateModelSettings(
return getStubSettingsBuilder().updateModelSettings();
}

/** Returns the builder for the settings used for calls to updateExplanationDataset. */
public UnaryCallSettings.Builder<UpdateExplanationDatasetRequest, Operation>
updateExplanationDatasetSettings() {
return getStubSettingsBuilder().updateExplanationDatasetSettings();
}

/** Returns the builder for the settings used for calls to updateExplanationDataset. */
public OperationCallSettings.Builder<
UpdateExplanationDatasetRequest,
UpdateExplanationDatasetResponse,
UpdateExplanationDatasetOperationMetadata>
updateExplanationDatasetOperationSettings() {
return getStubSettingsBuilder().updateExplanationDatasetOperationSettings();
}

/** Returns the builder for the settings used for calls to deleteModel. */
public UnaryCallSettings.Builder<DeleteModelRequest, Operation> deleteModelSettings() {
return getStubSettingsBuilder().deleteModelSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,9 @@
"TestIamPermissions": {
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
},
"UpdateExplanationDataset": {
"methods": ["updateExplanationDatasetAsync", "updateExplanationDatasetAsync", "updateExplanationDatasetAsync", "updateExplanationDatasetOperationCallable", "updateExplanationDatasetCallable"]
},
"UpdateModel": {
"methods": ["updateModel", "updateModel", "updateModelCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
import com.google.cloud.aiplatform.v1.Model;
import com.google.cloud.aiplatform.v1.ModelEvaluation;
import com.google.cloud.aiplatform.v1.ModelEvaluationSlice;
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata;
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest;
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse;
import com.google.cloud.aiplatform.v1.UpdateModelRequest;
import com.google.cloud.aiplatform.v1.UploadModelOperationMetadata;
import com.google.cloud.aiplatform.v1.UploadModelRequest;
Expand Down Expand Up @@ -133,6 +136,16 @@ public class GrpcModelServiceStub extends ModelServiceStub {
.setResponseMarshaller(ProtoUtils.marshaller(Model.getDefaultInstance()))
.build();

private static final MethodDescriptor<UpdateExplanationDatasetRequest, Operation>
updateExplanationDatasetMethodDescriptor =
MethodDescriptor.<UpdateExplanationDatasetRequest, Operation>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.aiplatform.v1.ModelService/UpdateExplanationDataset")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateExplanationDatasetRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();

private static final MethodDescriptor<DeleteModelRequest, Operation> deleteModelMethodDescriptor =
MethodDescriptor.<DeleteModelRequest, Operation>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
Expand Down Expand Up @@ -325,6 +338,13 @@ public class GrpcModelServiceStub extends ModelServiceStub {
private final UnaryCallable<ListModelVersionsRequest, ListModelVersionsPagedResponse>
listModelVersionsPagedCallable;
private final UnaryCallable<UpdateModelRequest, Model> updateModelCallable;
private final UnaryCallable<UpdateExplanationDatasetRequest, Operation>
updateExplanationDatasetCallable;
private final OperationCallable<
UpdateExplanationDatasetRequest,
UpdateExplanationDatasetResponse,
UpdateExplanationDatasetOperationMetadata>
updateExplanationDatasetOperationCallable;
private final UnaryCallable<DeleteModelRequest, Operation> deleteModelCallable;
private final OperationCallable<DeleteModelRequest, Empty, DeleteOperationMetadata>
deleteModelOperationCallable;
Expand Down Expand Up @@ -462,6 +482,17 @@ protected GrpcModelServiceStub(
return builder.build();
})
.build();
GrpcCallSettings<UpdateExplanationDatasetRequest, Operation>
updateExplanationDatasetTransportSettings =
GrpcCallSettings.<UpdateExplanationDatasetRequest, Operation>newBuilder()
.setMethodDescriptor(updateExplanationDatasetMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("model", String.valueOf(request.getModel()));
return builder.build();
})
.build();
GrpcCallSettings<DeleteModelRequest, Operation> deleteModelTransportSettings =
GrpcCallSettings.<DeleteModelRequest, Operation>newBuilder()
.setMethodDescriptor(deleteModelMethodDescriptor)
Expand Down Expand Up @@ -679,6 +710,17 @@ protected GrpcModelServiceStub(
this.updateModelCallable =
callableFactory.createUnaryCallable(
updateModelTransportSettings, settings.updateModelSettings(), clientContext);
this.updateExplanationDatasetCallable =
callableFactory.createUnaryCallable(
updateExplanationDatasetTransportSettings,
settings.updateExplanationDatasetSettings(),
clientContext);
this.updateExplanationDatasetOperationCallable =
callableFactory.createOperationCallable(
updateExplanationDatasetTransportSettings,
settings.updateExplanationDatasetOperationSettings(),
clientContext,
operationsStub);
this.deleteModelCallable =
callableFactory.createUnaryCallable(
deleteModelTransportSettings, settings.deleteModelSettings(), clientContext);
Expand Down Expand Up @@ -839,6 +881,21 @@ public UnaryCallable<UpdateModelRequest, Model> updateModelCallable() {
return updateModelCallable;
}

@Override
public UnaryCallable<UpdateExplanationDatasetRequest, Operation>
updateExplanationDatasetCallable() {
return updateExplanationDatasetCallable;
}

@Override
public OperationCallable<
UpdateExplanationDatasetRequest,
UpdateExplanationDatasetResponse,
UpdateExplanationDatasetOperationMetadata>
updateExplanationDatasetOperationCallable() {
return updateExplanationDatasetOperationCallable;
}

@Override
public UnaryCallable<DeleteModelRequest, Operation> deleteModelCallable() {
return deleteModelCallable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
import com.google.cloud.aiplatform.v1.Model;
import com.google.cloud.aiplatform.v1.ModelEvaluation;
import com.google.cloud.aiplatform.v1.ModelEvaluationSlice;
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata;
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest;
import com.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse;
import com.google.cloud.aiplatform.v1.UpdateModelRequest;
import com.google.cloud.aiplatform.v1.UploadModelOperationMetadata;
import com.google.cloud.aiplatform.v1.UploadModelRequest;
Expand Down Expand Up @@ -120,6 +123,20 @@ public UnaryCallable<UpdateModelRequest, Model> updateModelCallable() {
throw new UnsupportedOperationException("Not implemented: updateModelCallable()");
}

public OperationCallable<
UpdateExplanationDatasetRequest,
UpdateExplanationDatasetResponse,
UpdateExplanationDatasetOperationMetadata>
updateExplanationDatasetOperationCallable() {
throw new UnsupportedOperationException(
"Not implemented: updateExplanationDatasetOperationCallable()");
}

public UnaryCallable<UpdateExplanationDatasetRequest, Operation>
updateExplanationDatasetCallable() {
throw new UnsupportedOperationException("Not implemented: updateExplanationDatasetCallable()");
}

public OperationCallable<DeleteModelRequest, Empty, DeleteOperationMetadata>
deleteModelOperationCallable() {
throw new UnsupportedOperationException("Not implemented: deleteModelOperationCallable()");
Expand Down
Loading

0 comments on commit 3c65d52

Please sign in to comment.