Skip to content
This repository was archived by the owner on Sep 9, 2023. It is now read-only.

Commit 3041b97

Browse files
feat: add BatchImportModelEvaluationSlices API in aiplatform v1 model_service.proto (#972)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 456604066 Source-Link: googleapis/googleapis@d57f437 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d9f3b867c60688ee2ed5dbf572ad88913d1fce45 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: https://github.com/googleapis/googleapis-gen/commit/d4dfc802a88fe77bc04191f4b1d9b59481e692fd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDRkZmM4MDJhODhmZTc3YmMwNDE5MWY0YjFkOWI1OTQ4MWU2OTJmZCJ9 feat: add BatchImportModelEvaluationSlices API in aiplatform v1beta1 model_service.proto PiperOrigin-RevId: 456559576 Source-Link: googleapis/googleapis@f5cd509 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b3549d7a62116d5dbf49e22fb3d4c759d5da8313 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjM1NDlkN2E2MjExNmQ1ZGJmNDllMjJmYjNkNGM3NTlkNWRhODMxMyJ9
1 parent 87b311d commit 3041b97

File tree

44 files changed

+6602
-363
lines changed

Some content is hidden

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

44 files changed

+6602
-363
lines changed

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

+126
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,132 @@ public final ModelEvaluation importModelEvaluation(ImportModelEvaluationRequest
15271527
return stub.importModelEvaluationCallable();
15281528
}
15291529

1530+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1531+
/**
1532+
* Imports a list of externally generated ModelEvaluationSlice.
1533+
*
1534+
* <p>Sample code:
1535+
*
1536+
* <pre>{@code
1537+
* // This snippet has been automatically generated for illustrative purposes only.
1538+
* // It may require modifications to work in your environment.
1539+
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1540+
* ModelEvaluationName parent =
1541+
* ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
1542+
* List<ModelEvaluationSlice> modelEvaluationSlices = new ArrayList<>();
1543+
* BatchImportModelEvaluationSlicesResponse response =
1544+
* modelServiceClient.batchImportModelEvaluationSlices(parent, modelEvaluationSlices);
1545+
* }
1546+
* }</pre>
1547+
*
1548+
* @param parent Required. The name of the parent ModelEvaluation resource. Format:
1549+
* `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
1550+
* @param modelEvaluationSlices Required. Model evaluation slice resource to be imported.
1551+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1552+
*/
1553+
public final BatchImportModelEvaluationSlicesResponse batchImportModelEvaluationSlices(
1554+
ModelEvaluationName parent, List<ModelEvaluationSlice> modelEvaluationSlices) {
1555+
BatchImportModelEvaluationSlicesRequest request =
1556+
BatchImportModelEvaluationSlicesRequest.newBuilder()
1557+
.setParent(parent == null ? null : parent.toString())
1558+
.addAllModelEvaluationSlices(modelEvaluationSlices)
1559+
.build();
1560+
return batchImportModelEvaluationSlices(request);
1561+
}
1562+
1563+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1564+
/**
1565+
* Imports a list of externally generated ModelEvaluationSlice.
1566+
*
1567+
* <p>Sample code:
1568+
*
1569+
* <pre>{@code
1570+
* // This snippet has been automatically generated for illustrative purposes only.
1571+
* // It may require modifications to work in your environment.
1572+
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1573+
* String parent =
1574+
* ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]").toString();
1575+
* List<ModelEvaluationSlice> modelEvaluationSlices = new ArrayList<>();
1576+
* BatchImportModelEvaluationSlicesResponse response =
1577+
* modelServiceClient.batchImportModelEvaluationSlices(parent, modelEvaluationSlices);
1578+
* }
1579+
* }</pre>
1580+
*
1581+
* @param parent Required. The name of the parent ModelEvaluation resource. Format:
1582+
* `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
1583+
* @param modelEvaluationSlices Required. Model evaluation slice resource to be imported.
1584+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1585+
*/
1586+
public final BatchImportModelEvaluationSlicesResponse batchImportModelEvaluationSlices(
1587+
String parent, List<ModelEvaluationSlice> modelEvaluationSlices) {
1588+
BatchImportModelEvaluationSlicesRequest request =
1589+
BatchImportModelEvaluationSlicesRequest.newBuilder()
1590+
.setParent(parent)
1591+
.addAllModelEvaluationSlices(modelEvaluationSlices)
1592+
.build();
1593+
return batchImportModelEvaluationSlices(request);
1594+
}
1595+
1596+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1597+
/**
1598+
* Imports a list of externally generated ModelEvaluationSlice.
1599+
*
1600+
* <p>Sample code:
1601+
*
1602+
* <pre>{@code
1603+
* // This snippet has been automatically generated for illustrative purposes only.
1604+
* // It may require modifications to work in your environment.
1605+
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1606+
* BatchImportModelEvaluationSlicesRequest request =
1607+
* BatchImportModelEvaluationSlicesRequest.newBuilder()
1608+
* .setParent(
1609+
* ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]")
1610+
* .toString())
1611+
* .addAllModelEvaluationSlices(new ArrayList<ModelEvaluationSlice>())
1612+
* .build();
1613+
* BatchImportModelEvaluationSlicesResponse response =
1614+
* modelServiceClient.batchImportModelEvaluationSlices(request);
1615+
* }
1616+
* }</pre>
1617+
*
1618+
* @param request The request object containing all of the parameters for the API call.
1619+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1620+
*/
1621+
public final BatchImportModelEvaluationSlicesResponse batchImportModelEvaluationSlices(
1622+
BatchImportModelEvaluationSlicesRequest request) {
1623+
return batchImportModelEvaluationSlicesCallable().call(request);
1624+
}
1625+
1626+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1627+
/**
1628+
* Imports a list of externally generated ModelEvaluationSlice.
1629+
*
1630+
* <p>Sample code:
1631+
*
1632+
* <pre>{@code
1633+
* // This snippet has been automatically generated for illustrative purposes only.
1634+
* // It may require modifications to work in your environment.
1635+
* try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
1636+
* BatchImportModelEvaluationSlicesRequest request =
1637+
* BatchImportModelEvaluationSlicesRequest.newBuilder()
1638+
* .setParent(
1639+
* ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]")
1640+
* .toString())
1641+
* .addAllModelEvaluationSlices(new ArrayList<ModelEvaluationSlice>())
1642+
* .build();
1643+
* ApiFuture<BatchImportModelEvaluationSlicesResponse> future =
1644+
* modelServiceClient.batchImportModelEvaluationSlicesCallable().futureCall(request);
1645+
* // Do something.
1646+
* BatchImportModelEvaluationSlicesResponse response = future.get();
1647+
* }
1648+
* }</pre>
1649+
*/
1650+
public final UnaryCallable<
1651+
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
1652+
batchImportModelEvaluationSlicesCallable() {
1653+
return stub.batchImportModelEvaluationSlicesCallable();
1654+
}
1655+
15301656
// AUTO-GENERATED DOCUMENTATION AND METHOD.
15311657
/**
15321658
* Gets a ModelEvaluation.

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

+15
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,14 @@ public UnaryCallSettings<ExportModelRequest, Operation> exportModelSettings() {
166166
return ((ModelServiceStubSettings) getStubSettings()).importModelEvaluationSettings();
167167
}
168168

169+
/** Returns the object with the settings used for calls to batchImportModelEvaluationSlices. */
170+
public UnaryCallSettings<
171+
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
172+
batchImportModelEvaluationSlicesSettings() {
173+
return ((ModelServiceStubSettings) getStubSettings())
174+
.batchImportModelEvaluationSlicesSettings();
175+
}
176+
169177
/** Returns the object with the settings used for calls to getModelEvaluation. */
170178
public UnaryCallSettings<GetModelEvaluationRequest, ModelEvaluation>
171179
getModelEvaluationSettings() {
@@ -402,6 +410,13 @@ public UnaryCallSettings.Builder<ExportModelRequest, Operation> exportModelSetti
402410
return getStubSettingsBuilder().importModelEvaluationSettings();
403411
}
404412

413+
/** Returns the builder for the settings used for calls to batchImportModelEvaluationSlices. */
414+
public UnaryCallSettings.Builder<
415+
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
416+
batchImportModelEvaluationSlicesSettings() {
417+
return getStubSettingsBuilder().batchImportModelEvaluationSlicesSettings();
418+
}
419+
405420
/** Returns the builder for the settings used for calls to getModelEvaluation. */
406421
public UnaryCallSettings.Builder<GetModelEvaluationRequest, ModelEvaluation>
407422
getModelEvaluationSettings() {

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

+3
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,9 @@
565565
"grpc": {
566566
"libraryClient": "ModelServiceClient",
567567
"rpcs": {
568+
"BatchImportModelEvaluationSlices": {
569+
"methods": ["batchImportModelEvaluationSlices", "batchImportModelEvaluationSlices", "batchImportModelEvaluationSlices", "batchImportModelEvaluationSlicesCallable"]
570+
},
568571
"DeleteModel": {
569572
"methods": ["deleteModelAsync", "deleteModelAsync", "deleteModelAsync", "deleteModelOperationCallable", "deleteModelCallable"]
570573
},

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

+48
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import com.google.api.gax.rpc.ClientContext;
3030
import com.google.api.gax.rpc.OperationCallable;
3131
import com.google.api.gax.rpc.UnaryCallable;
32+
import com.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesRequest;
33+
import com.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse;
3234
import com.google.cloud.aiplatform.v1.DeleteModelRequest;
3335
import com.google.cloud.aiplatform.v1.DeleteModelVersionRequest;
3436
import com.google.cloud.aiplatform.v1.DeleteOperationMetadata;
@@ -172,6 +174,23 @@ public class GrpcModelServiceStub extends ModelServiceStub {
172174
.setResponseMarshaller(ProtoUtils.marshaller(ModelEvaluation.getDefaultInstance()))
173175
.build();
174176

177+
private static final MethodDescriptor<
178+
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
179+
batchImportModelEvaluationSlicesMethodDescriptor =
180+
MethodDescriptor
181+
.<BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
182+
newBuilder()
183+
.setType(MethodDescriptor.MethodType.UNARY)
184+
.setFullMethodName(
185+
"google.cloud.aiplatform.v1.ModelService/BatchImportModelEvaluationSlices")
186+
.setRequestMarshaller(
187+
ProtoUtils.marshaller(
188+
BatchImportModelEvaluationSlicesRequest.getDefaultInstance()))
189+
.setResponseMarshaller(
190+
ProtoUtils.marshaller(
191+
BatchImportModelEvaluationSlicesResponse.getDefaultInstance()))
192+
.build();
193+
175194
private static final MethodDescriptor<GetModelEvaluationRequest, ModelEvaluation>
176195
getModelEvaluationMethodDescriptor =
177196
MethodDescriptor.<GetModelEvaluationRequest, ModelEvaluation>newBuilder()
@@ -289,6 +308,9 @@ public class GrpcModelServiceStub extends ModelServiceStub {
289308
exportModelOperationCallable;
290309
private final UnaryCallable<ImportModelEvaluationRequest, ModelEvaluation>
291310
importModelEvaluationCallable;
311+
private final UnaryCallable<
312+
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
313+
batchImportModelEvaluationSlicesCallable;
292314
private final UnaryCallable<GetModelEvaluationRequest, ModelEvaluation>
293315
getModelEvaluationCallable;
294316
private final UnaryCallable<ListModelEvaluationsRequest, ListModelEvaluationsResponse>
@@ -455,6 +477,20 @@ protected GrpcModelServiceStub(
455477
return params.build();
456478
})
457479
.build();
480+
GrpcCallSettings<
481+
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
482+
batchImportModelEvaluationSlicesTransportSettings =
483+
GrpcCallSettings
484+
.<BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
485+
newBuilder()
486+
.setMethodDescriptor(batchImportModelEvaluationSlicesMethodDescriptor)
487+
.setParamsExtractor(
488+
request -> {
489+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
490+
params.put("parent", String.valueOf(request.getParent()));
491+
return params.build();
492+
})
493+
.build();
458494
GrpcCallSettings<GetModelEvaluationRequest, ModelEvaluation>
459495
getModelEvaluationTransportSettings =
460496
GrpcCallSettings.<GetModelEvaluationRequest, ModelEvaluation>newBuilder()
@@ -622,6 +658,11 @@ protected GrpcModelServiceStub(
622658
importModelEvaluationTransportSettings,
623659
settings.importModelEvaluationSettings(),
624660
clientContext);
661+
this.batchImportModelEvaluationSlicesCallable =
662+
callableFactory.createUnaryCallable(
663+
batchImportModelEvaluationSlicesTransportSettings,
664+
settings.batchImportModelEvaluationSlicesSettings(),
665+
clientContext);
625666
this.getModelEvaluationCallable =
626667
callableFactory.createUnaryCallable(
627668
getModelEvaluationTransportSettings,
@@ -768,6 +809,13 @@ public UnaryCallable<ExportModelRequest, Operation> exportModelCallable() {
768809
return importModelEvaluationCallable;
769810
}
770811

812+
@Override
813+
public UnaryCallable<
814+
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
815+
batchImportModelEvaluationSlicesCallable() {
816+
return batchImportModelEvaluationSlicesCallable;
817+
}
818+
771819
@Override
772820
public UnaryCallable<GetModelEvaluationRequest, ModelEvaluation> getModelEvaluationCallable() {
773821
return getModelEvaluationCallable;

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

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import com.google.api.gax.core.BackgroundResource;
2626
import com.google.api.gax.rpc.OperationCallable;
2727
import com.google.api.gax.rpc.UnaryCallable;
28+
import com.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesRequest;
29+
import com.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse;
2830
import com.google.cloud.aiplatform.v1.DeleteModelRequest;
2931
import com.google.cloud.aiplatform.v1.DeleteModelVersionRequest;
3032
import com.google.cloud.aiplatform.v1.DeleteOperationMetadata;
@@ -150,6 +152,13 @@ public UnaryCallable<ExportModelRequest, Operation> exportModelCallable() {
150152
throw new UnsupportedOperationException("Not implemented: importModelEvaluationCallable()");
151153
}
152154

155+
public UnaryCallable<
156+
BatchImportModelEvaluationSlicesRequest, BatchImportModelEvaluationSlicesResponse>
157+
batchImportModelEvaluationSlicesCallable() {
158+
throw new UnsupportedOperationException(
159+
"Not implemented: batchImportModelEvaluationSlicesCallable()");
160+
}
161+
153162
public UnaryCallable<GetModelEvaluationRequest, ModelEvaluation> getModelEvaluationCallable() {
154163
throw new UnsupportedOperationException("Not implemented: getModelEvaluationCallable()");
155164
}

0 commit comments

Comments
 (0)