Skip to content

Commit

Permalink
feat: add BatchImportModelEvaluationSlices API in aiplatform v1 model…
Browse files Browse the repository at this point in the history
…_service.proto (#972)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 456604066

Source-Link: googleapis/googleapis@d57f437

Source-Link: googleapis/googleapis-gen@d9f3b86
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDlmM2I4NjdjNjA2ODhlZTJlZDVkYmY1NzJhZDg4OTEzZDFmY2U0NSJ9

feat: add model_version_id to BatchPredictionJob in aiplatform v1 batch_prediction_job.proto
feat: add model_version_id to DeployedModel in aiplatform v1 endpoint.proto

feat: add model_version_id to PredictResponse in aiplatform v1 prediction_service.proto
PiperOrigin-RevId: 456571762

Source-Link: googleapis/googleapis@19bd392

Source-Link: googleapis/googleapis-gen@d4dfc80
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDRkZmM4MDJhODhmZTc3YmMwNDE5MWY0YjFkOWI1OTQ4MWU2OTJmZCJ9

feat: add BatchImportModelEvaluationSlices API in aiplatform v1beta1 model_service.proto
PiperOrigin-RevId: 456559576

Source-Link: googleapis/googleapis@f5cd509

Source-Link: googleapis/googleapis-gen@b3549d7
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjM1NDlkN2E2MjExNmQ1ZGJmNDllMjJmYjNkNGM3NTlkNWRhODMxMyJ9
  • Loading branch information
gcf-owl-bot[bot] committed Jun 23, 2022
1 parent 56ad705 commit 7f45b24
Show file tree
Hide file tree
Showing 44 changed files with 6,602 additions and 363 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,132 @@ public final ModelEvaluation importModelEvaluation(ImportModelEvaluationRequest
return stub.importModelEvaluationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports a list of externally generated ModelEvaluationSlice.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
* ModelEvaluationName parent =
* ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
* List<ModelEvaluationSlice> modelEvaluationSlices = new ArrayList<>();
* BatchImportModelEvaluationSlicesResponse response =
* modelServiceClient.batchImportModelEvaluationSlices(parent, modelEvaluationSlices);
* }
* }</pre>
*
* @param parent Required. The name of the parent ModelEvaluation resource. Format:
* `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
* @param modelEvaluationSlices Required. Model evaluation slice resource to be imported.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final BatchImportModelEvaluationSlicesResponse batchImportModelEvaluationSlices(
ModelEvaluationName parent, List<ModelEvaluationSlice> modelEvaluationSlices) {
BatchImportModelEvaluationSlicesRequest request =
BatchImportModelEvaluationSlicesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.addAllModelEvaluationSlices(modelEvaluationSlices)
.build();
return batchImportModelEvaluationSlices(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports a list of externally generated ModelEvaluationSlice.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
* String parent =
* ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]").toString();
* List<ModelEvaluationSlice> modelEvaluationSlices = new ArrayList<>();
* BatchImportModelEvaluationSlicesResponse response =
* modelServiceClient.batchImportModelEvaluationSlices(parent, modelEvaluationSlices);
* }
* }</pre>
*
* @param parent Required. The name of the parent ModelEvaluation resource. Format:
* `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
* @param modelEvaluationSlices Required. Model evaluation slice resource to be imported.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final BatchImportModelEvaluationSlicesResponse batchImportModelEvaluationSlices(
String parent, List<ModelEvaluationSlice> modelEvaluationSlices) {
BatchImportModelEvaluationSlicesRequest request =
BatchImportModelEvaluationSlicesRequest.newBuilder()
.setParent(parent)
.addAllModelEvaluationSlices(modelEvaluationSlices)
.build();
return batchImportModelEvaluationSlices(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports a list of externally generated ModelEvaluationSlice.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
* BatchImportModelEvaluationSlicesRequest request =
* BatchImportModelEvaluationSlicesRequest.newBuilder()
* .setParent(
* ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]")
* .toString())
* .addAllModelEvaluationSlices(new ArrayList<ModelEvaluationSlice>())
* .build();
* BatchImportModelEvaluationSlicesResponse response =
* modelServiceClient.batchImportModelEvaluationSlices(request);
* }
* }</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 BatchImportModelEvaluationSlicesResponse batchImportModelEvaluationSlices(
BatchImportModelEvaluationSlicesRequest request) {
return batchImportModelEvaluationSlicesCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports a list of externally generated ModelEvaluationSlice.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
* BatchImportModelEvaluationSlicesRequest request =
* BatchImportModelEvaluationSlicesRequest.newBuilder()
* .setParent(
* ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]")
* .toString())
* .addAllModelEvaluationSlices(new ArrayList<ModelEvaluationSlice>())
* .build();
* ApiFuture<BatchImportModelEvaluationSlicesResponse> future =
* modelServiceClient.batchImportModelEvaluationSlicesCallable().futureCall(request);
* // Do something.
* BatchImportModelEvaluationSlicesResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
batchImportModelEvaluationSlicesCallable() {
return stub.batchImportModelEvaluationSlicesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelEvaluation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ public UnaryCallSettings<ExportModelRequest, Operation> exportModelSettings() {
return ((ModelServiceStubSettings) getStubSettings()).importModelEvaluationSettings();
}

/** Returns the object with the settings used for calls to batchImportModelEvaluationSlices. */
public UnaryCallSettings<
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
batchImportModelEvaluationSlicesSettings() {
return ((ModelServiceStubSettings) getStubSettings())
.batchImportModelEvaluationSlicesSettings();
}

/** Returns the object with the settings used for calls to getModelEvaluation. */
public UnaryCallSettings<GetModelEvaluationRequest, ModelEvaluation>
getModelEvaluationSettings() {
Expand Down Expand Up @@ -402,6 +410,13 @@ public UnaryCallSettings.Builder<ExportModelRequest, Operation> exportModelSetti
return getStubSettingsBuilder().importModelEvaluationSettings();
}

/** Returns the builder for the settings used for calls to batchImportModelEvaluationSlices. */
public UnaryCallSettings.Builder<
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
batchImportModelEvaluationSlicesSettings() {
return getStubSettingsBuilder().batchImportModelEvaluationSlicesSettings();
}

/** Returns the builder for the settings used for calls to getModelEvaluation. */
public UnaryCallSettings.Builder<GetModelEvaluationRequest, ModelEvaluation>
getModelEvaluationSettings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,9 @@
"grpc": {
"libraryClient": "ModelServiceClient",
"rpcs": {
"BatchImportModelEvaluationSlices": {
"methods": ["batchImportModelEvaluationSlices", "batchImportModelEvaluationSlices", "batchImportModelEvaluationSlices", "batchImportModelEvaluationSlicesCallable"]
},
"DeleteModel": {
"methods": ["deleteModelAsync", "deleteModelAsync", "deleteModelAsync", "deleteModelOperationCallable", "deleteModelCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesRequest;
import com.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse;
import com.google.cloud.aiplatform.v1.DeleteModelRequest;
import com.google.cloud.aiplatform.v1.DeleteModelVersionRequest;
import com.google.cloud.aiplatform.v1.DeleteOperationMetadata;
Expand Down Expand Up @@ -172,6 +174,23 @@ public class GrpcModelServiceStub extends ModelServiceStub {
.setResponseMarshaller(ProtoUtils.marshaller(ModelEvaluation.getDefaultInstance()))
.build();

private static final MethodDescriptor<
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
batchImportModelEvaluationSlicesMethodDescriptor =
MethodDescriptor
.<BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.ModelService/BatchImportModelEvaluationSlices")
.setRequestMarshaller(
ProtoUtils.marshaller(
BatchImportModelEvaluationSlicesRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(
BatchImportModelEvaluationSlicesResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<GetModelEvaluationRequest, ModelEvaluation>
getModelEvaluationMethodDescriptor =
MethodDescriptor.<GetModelEvaluationRequest, ModelEvaluation>newBuilder()
Expand Down Expand Up @@ -289,6 +308,9 @@ public class GrpcModelServiceStub extends ModelServiceStub {
exportModelOperationCallable;
private final UnaryCallable<ImportModelEvaluationRequest, ModelEvaluation>
importModelEvaluationCallable;
private final UnaryCallable<
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
batchImportModelEvaluationSlicesCallable;
private final UnaryCallable<GetModelEvaluationRequest, ModelEvaluation>
getModelEvaluationCallable;
private final UnaryCallable<ListModelEvaluationsRequest, ListModelEvaluationsResponse>
Expand Down Expand Up @@ -455,6 +477,20 @@ protected GrpcModelServiceStub(
return params.build();
})
.build();
GrpcCallSettings<
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
batchImportModelEvaluationSlicesTransportSettings =
GrpcCallSettings
.<BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
newBuilder()
.setMethodDescriptor(batchImportModelEvaluationSlicesMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
})
.build();
GrpcCallSettings<GetModelEvaluationRequest, ModelEvaluation>
getModelEvaluationTransportSettings =
GrpcCallSettings.<GetModelEvaluationRequest, ModelEvaluation>newBuilder()
Expand Down Expand Up @@ -622,6 +658,11 @@ protected GrpcModelServiceStub(
importModelEvaluationTransportSettings,
settings.importModelEvaluationSettings(),
clientContext);
this.batchImportModelEvaluationSlicesCallable =
callableFactory.createUnaryCallable(
batchImportModelEvaluationSlicesTransportSettings,
settings.batchImportModelEvaluationSlicesSettings(),
clientContext);
this.getModelEvaluationCallable =
callableFactory.createUnaryCallable(
getModelEvaluationTransportSettings,
Expand Down Expand Up @@ -768,6 +809,13 @@ public UnaryCallable<ExportModelRequest, Operation> exportModelCallable() {
return importModelEvaluationCallable;
}

@Override
public UnaryCallable<
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
batchImportModelEvaluationSlicesCallable() {
return batchImportModelEvaluationSlicesCallable;
}

@Override
public UnaryCallable<GetModelEvaluationRequest, ModelEvaluation> getModelEvaluationCallable() {
return getModelEvaluationCallable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesRequest;
import com.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse;
import com.google.cloud.aiplatform.v1.DeleteModelRequest;
import com.google.cloud.aiplatform.v1.DeleteModelVersionRequest;
import com.google.cloud.aiplatform.v1.DeleteOperationMetadata;
Expand Down Expand Up @@ -150,6 +152,13 @@ public UnaryCallable<ExportModelRequest, Operation> exportModelCallable() {
throw new UnsupportedOperationException("Not implemented: importModelEvaluationCallable()");
}

public UnaryCallable<
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
batchImportModelEvaluationSlicesCallable() {
throw new UnsupportedOperationException(
"Not implemented: batchImportModelEvaluationSlicesCallable()");
}

public UnaryCallable<GetModelEvaluationRequest, ModelEvaluation> getModelEvaluationCallable() {
throw new UnsupportedOperationException("Not implemented: getModelEvaluationCallable()");
}
Expand Down
Loading

0 comments on commit 7f45b24

Please sign in to comment.