From 49fb069d61270657145130470d3546ea3a33490d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 26 Jul 2022 19:26:29 +0000 Subject: [PATCH] feat: add DeploymentResourcePool in aiplatform v1beta1 deployment_resource_pool.proto (#998) - [ ] Regenerate this pull request now. feat: add DeploymentResourcePoolService in aiplatform v1beta1 deployment_resource_pool_service.proto feat: add SHARED_RESOURCES to DeploymentResourcesType in aiplatform v1beta1 model.proto PiperOrigin-RevId: 463147866 Source-Link: https://github.com/googleapis/googleapis/commit/627646187513c840b8481a0b4f6249eba04a418f Source-Link: https://github.com/googleapis/googleapis-gen/commit/57665f4b491d7c0f1e466e430701dbae0472f64e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTc2NjVmNGI0OTFkN2MwZjFlNDY2ZTQzMDcwMWRiYWUwNDcyZjY0ZSJ9 chore(bazel): update protobuf to v3.21.3 chore(bazel): update gax-java to 2.18.4 PiperOrigin-RevId: 463115700 Source-Link: https://github.com/googleapis/googleapis/commit/52130a9c3c289e6bc4ab1784bdde6081abdf3dd9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6a4d9d9bb3afb20b0f5fa4f5d9f6740b1d0eb19a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmE0ZDlkOWJiM2FmYjIwYjBmNWZhNGY1ZDlmNjc0MGIxZDBlYjE5YSJ9 --- .../DeploymentResourcePoolServiceClient.java | 1580 +++++++++++++++ ...DeploymentResourcePoolServiceSettings.java | 358 ++++ .../aiplatform/v1beta1/gapic_metadata.json | 39 + .../aiplatform/v1beta1/package-info.java | 18 + .../DeploymentResourcePoolServiceStub.java | 147 ++ ...oymentResourcePoolServiceStubSettings.java | 868 ++++++++ ...entResourcePoolServiceCallableFactory.java | 115 ++ ...GrpcDeploymentResourcePoolServiceStub.java | 566 ++++++ ...ploymentResourcePoolServiceClientTest.java | 816 ++++++++ .../MockDeploymentResourcePoolService.java | 59 + ...MockDeploymentResourcePoolServiceImpl.java | 169 ++ .../DeploymentResourcePoolServiceGrpc.java | 885 ++++++++ .../com/google/cloud/aiplatform/v1/Model.java | 9 +- ...ploymentResourcePoolOperationMetadata.java | 782 ++++++++ ...esourcePoolOperationMetadataOrBuilder.java | 61 + .../CreateDeploymentResourcePoolRequest.java | 1200 +++++++++++ ...eploymentResourcePoolRequestOrBuilder.java | 131 ++ .../DeleteDeploymentResourcePoolRequest.java | 684 +++++++ ...eploymentResourcePoolRequestOrBuilder.java | 58 + .../v1beta1/DeploymentResourcePool.java | 1256 ++++++++++++ .../v1beta1/DeploymentResourcePoolName.java | 240 +++ .../DeploymentResourcePoolOrBuilder.java | 133 ++ .../v1beta1/DeploymentResourcePoolProto.java | 96 + .../DeploymentResourcePoolServiceProto.java | 275 +++ .../cloud/aiplatform/v1beta1/Endpoint.java | 8 +- .../aiplatform/v1beta1/EndpointOrBuilder.java | 2 +- .../aiplatform/v1beta1/EndpointProto.java | 8 +- .../GetDeploymentResourcePoolRequest.java | 679 +++++++ ...eploymentResourcePoolRequestOrBuilder.java | 58 + .../ListDeploymentResourcePoolsRequest.java | 974 +++++++++ ...ploymentResourcePoolsRequestOrBuilder.java | 103 + .../ListDeploymentResourcePoolsResponse.java | 1235 ++++++++++++ ...loymentResourcePoolsResponseOrBuilder.java | 116 ++ .../cloud/aiplatform/v1beta1/Model.java | 33 +- .../cloud/aiplatform/v1beta1/ModelProto.java | 49 +- .../cloud/aiplatform/v1beta1/ProjectName.java | 168 ++ .../v1beta1/QueryDeployedModelsRequest.java | 960 +++++++++ .../QueryDeployedModelsRequestOrBuilder.java | 101 + .../v1beta1/QueryDeployedModelsResponse.java | 1783 +++++++++++++++++ .../QueryDeployedModelsResponseOrBuilder.java | 182 ++ ...ploymentResourcePoolOperationMetadata.java | 782 ++++++++ ...esourcePoolOperationMetadataOrBuilder.java | 61 + .../v1beta1/deployment_resource_pool.proto | 50 + .../deployment_resource_pool_service.proto | 219 ++ .../cloud/aiplatform/v1beta1/endpoint.proto | 4 - .../cloud/aiplatform/v1beta1/model.proto | 4 + 46 files changed, 18075 insertions(+), 49 deletions(-) create mode 100644 google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolServiceClient.java create mode 100644 google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolServiceSettings.java create mode 100644 google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/DeploymentResourcePoolServiceStub.java create mode 100644 google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/DeploymentResourcePoolServiceStubSettings.java create mode 100644 google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GrpcDeploymentResourcePoolServiceCallableFactory.java create mode 100644 google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GrpcDeploymentResourcePoolServiceStub.java create mode 100644 google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolServiceClientTest.java create mode 100644 google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/MockDeploymentResourcePoolService.java create mode 100644 google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/MockDeploymentResourcePoolServiceImpl.java create mode 100644 grpc-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolServiceGrpc.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/CreateDeploymentResourcePoolOperationMetadata.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/CreateDeploymentResourcePoolOperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/CreateDeploymentResourcePoolRequest.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/CreateDeploymentResourcePoolRequestOrBuilder.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/DeleteDeploymentResourcePoolRequest.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/DeleteDeploymentResourcePoolRequestOrBuilder.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePool.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolName.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolOrBuilder.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolProto.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolServiceProto.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/GetDeploymentResourcePoolRequest.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/GetDeploymentResourcePoolRequestOrBuilder.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListDeploymentResourcePoolsRequest.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListDeploymentResourcePoolsRequestOrBuilder.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListDeploymentResourcePoolsResponse.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListDeploymentResourcePoolsResponseOrBuilder.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ProjectName.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/QueryDeployedModelsRequest.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/QueryDeployedModelsRequestOrBuilder.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/QueryDeployedModelsResponse.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/QueryDeployedModelsResponseOrBuilder.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/UpdateDeploymentResourcePoolOperationMetadata.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/UpdateDeploymentResourcePoolOperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto create mode 100644 proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto diff --git a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolServiceClient.java b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolServiceClient.java new file mode 100644 index 000000000..bbc1b86b9 --- /dev/null +++ b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/DeploymentResourcePoolServiceClient.java @@ -0,0 +1,1580 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.aiplatform.v1beta1.stub.DeploymentResourcePoolServiceStub; +import com.google.cloud.aiplatform.v1beta1.stub.DeploymentResourcePoolServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A service that manages the DeploymentResourcePool resource. + * + *
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * DeploymentResourcePoolName name = + * DeploymentResourcePoolName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]"); + * DeploymentResourcePool response = + * deploymentResourcePoolServiceClient.getDeploymentResourcePool(name); + * } + * }+ * + *
Note: close() needs to be called on the DeploymentResourcePoolServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of + * DeploymentResourcePoolServiceSettings to create(). For example: + * + *
To customize credentials: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * DeploymentResourcePoolServiceSettings deploymentResourcePoolServiceSettings = + * DeploymentResourcePoolServiceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create(deploymentResourcePoolServiceSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * DeploymentResourcePoolServiceSettings deploymentResourcePoolServiceSettings = + * DeploymentResourcePoolServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create(deploymentResourcePoolServiceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class DeploymentResourcePoolServiceClient implements BackgroundResource { + private final DeploymentResourcePoolServiceSettings settings; + private final DeploymentResourcePoolServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of DeploymentResourcePoolServiceClient with default settings. */ + public static final DeploymentResourcePoolServiceClient create() throws IOException { + return create(DeploymentResourcePoolServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DeploymentResourcePoolServiceClient, using the given settings. The + * channels are created based on the settings passed in, or defaults for any settings that are not + * set. + */ + public static final DeploymentResourcePoolServiceClient create( + DeploymentResourcePoolServiceSettings settings) throws IOException { + return new DeploymentResourcePoolServiceClient(settings); + } + + /** + * Constructs an instance of DeploymentResourcePoolServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer using create(DeploymentResourcePoolServiceSettings). + */ + public static final DeploymentResourcePoolServiceClient create( + DeploymentResourcePoolServiceStub stub) { + return new DeploymentResourcePoolServiceClient(stub); + } + + /** + * Constructs an instance of DeploymentResourcePoolServiceClient, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected DeploymentResourcePoolServiceClient(DeploymentResourcePoolServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = + ((DeploymentResourcePoolServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected DeploymentResourcePoolServiceClient(DeploymentResourcePoolServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final DeploymentResourcePoolServiceSettings getSettings() { + return settings; + } + + public DeploymentResourcePoolServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a DeploymentResourcePool. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * DeploymentResourcePool deploymentResourcePool = DeploymentResourcePool.newBuilder().build(); + * String deploymentResourcePoolId = "deploymentResourcePoolId1805697578"; + * DeploymentResourcePool response = + * deploymentResourcePoolServiceClient + * .createDeploymentResourcePoolAsync( + * parent, deploymentResourcePool, deploymentResourcePoolId) + * .get(); + * } + * }+ * + * @param parent Required. The parent location resource where this DeploymentResourcePool will be + * created. Format: projects/{project}/locations/{location} + * @param deploymentResourcePool Required. The DeploymentResourcePool to create. + * @param deploymentResourcePoolId Required. The ID to use for the DeploymentResourcePool, which + * will become the final component of the DeploymentResourcePool's resource name. + *
The maximum length is 63 characters, and valid characters are + * `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture< + DeploymentResourcePool, CreateDeploymentResourcePoolOperationMetadata> + createDeploymentResourcePoolAsync( + LocationName parent, + DeploymentResourcePool deploymentResourcePool, + String deploymentResourcePoolId) { + CreateDeploymentResourcePoolRequest request = + CreateDeploymentResourcePoolRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDeploymentResourcePool(deploymentResourcePool) + .setDeploymentResourcePoolId(deploymentResourcePoolId) + .build(); + return createDeploymentResourcePoolAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a DeploymentResourcePool. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * DeploymentResourcePool deploymentResourcePool = DeploymentResourcePool.newBuilder().build(); + * String deploymentResourcePoolId = "deploymentResourcePoolId1805697578"; + * DeploymentResourcePool response = + * deploymentResourcePoolServiceClient + * .createDeploymentResourcePoolAsync( + * parent, deploymentResourcePool, deploymentResourcePoolId) + * .get(); + * } + * }+ * + * @param parent Required. The parent location resource where this DeploymentResourcePool will be + * created. Format: projects/{project}/locations/{location} + * @param deploymentResourcePool Required. The DeploymentResourcePool to create. + * @param deploymentResourcePoolId Required. The ID to use for the DeploymentResourcePool, which + * will become the final component of the DeploymentResourcePool's resource name. + *
The maximum length is 63 characters, and valid characters are + * `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture< + DeploymentResourcePool, CreateDeploymentResourcePoolOperationMetadata> + createDeploymentResourcePoolAsync( + String parent, + DeploymentResourcePool deploymentResourcePool, + String deploymentResourcePoolId) { + CreateDeploymentResourcePoolRequest request = + CreateDeploymentResourcePoolRequest.newBuilder() + .setParent(parent) + .setDeploymentResourcePool(deploymentResourcePool) + .setDeploymentResourcePoolId(deploymentResourcePoolId) + .build(); + return createDeploymentResourcePoolAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a DeploymentResourcePool. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * CreateDeploymentResourcePoolRequest request = + * CreateDeploymentResourcePoolRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDeploymentResourcePool(DeploymentResourcePool.newBuilder().build()) + * .setDeploymentResourcePoolId("deploymentResourcePoolId1805697578") + * .build(); + * DeploymentResourcePool response = + * deploymentResourcePoolServiceClient.createDeploymentResourcePoolAsync(request).get(); + * } + * }+ * + * @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< + DeploymentResourcePool, CreateDeploymentResourcePoolOperationMetadata> + createDeploymentResourcePoolAsync(CreateDeploymentResourcePoolRequest request) { + return createDeploymentResourcePoolOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a DeploymentResourcePool. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * CreateDeploymentResourcePoolRequest request = + * CreateDeploymentResourcePoolRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDeploymentResourcePool(DeploymentResourcePool.newBuilder().build()) + * .setDeploymentResourcePoolId("deploymentResourcePoolId1805697578") + * .build(); + * OperationFuture+ */ + public final OperationCallable< + CreateDeploymentResourcePoolRequest, + DeploymentResourcePool, + CreateDeploymentResourcePoolOperationMetadata> + createDeploymentResourcePoolOperationCallable() { + return stub.createDeploymentResourcePoolOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a DeploymentResourcePool. + * + *+ * future = + * deploymentResourcePoolServiceClient + * .createDeploymentResourcePoolOperationCallable() + * .futureCall(request); + * // Do something. + * DeploymentResourcePool response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * CreateDeploymentResourcePoolRequest request = + * CreateDeploymentResourcePoolRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDeploymentResourcePool(DeploymentResourcePool.newBuilder().build()) + * .setDeploymentResourcePoolId("deploymentResourcePoolId1805697578") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deploymentResourcePoolServiceClient + * .createDeploymentResourcePoolCallable() + * .futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * DeploymentResourcePoolName name = + * DeploymentResourcePoolName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]"); + * DeploymentResourcePool response = + * deploymentResourcePoolServiceClient.getDeploymentResourcePool(name); + * } + * }+ * + * @param name Required. The name of the DeploymentResourcePool to retrieve. Format: + * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeploymentResourcePool getDeploymentResourcePool(DeploymentResourcePoolName name) { + GetDeploymentResourcePoolRequest request = + GetDeploymentResourcePoolRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getDeploymentResourcePool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a DeploymentResourcePool. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * String name = + * DeploymentResourcePoolName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]") + * .toString(); + * DeploymentResourcePool response = + * deploymentResourcePoolServiceClient.getDeploymentResourcePool(name); + * } + * }+ * + * @param name Required. The name of the DeploymentResourcePool to retrieve. Format: + * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeploymentResourcePool getDeploymentResourcePool(String name) { + GetDeploymentResourcePoolRequest request = + GetDeploymentResourcePoolRequest.newBuilder().setName(name).build(); + return getDeploymentResourcePool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a DeploymentResourcePool. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * GetDeploymentResourcePoolRequest request = + * GetDeploymentResourcePoolRequest.newBuilder() + * .setName( + * DeploymentResourcePoolName.of( + * "[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]") + * .toString()) + * .build(); + * DeploymentResourcePool response = + * deploymentResourcePoolServiceClient.getDeploymentResourcePool(request); + * } + * }+ * + * @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 DeploymentResourcePool getDeploymentResourcePool( + GetDeploymentResourcePoolRequest request) { + return getDeploymentResourcePoolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a DeploymentResourcePool. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * GetDeploymentResourcePoolRequest request = + * GetDeploymentResourcePoolRequest.newBuilder() + * .setName( + * DeploymentResourcePoolName.of( + * "[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deploymentResourcePoolServiceClient + * .getDeploymentResourcePoolCallable() + * .futureCall(request); + * // Do something. + * DeploymentResourcePool response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * for (DeploymentResourcePool element : + * deploymentResourcePoolServiceClient.listDeploymentResourcePools(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent Location which owns this collection of + * DeploymentResourcePools. Format: projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeploymentResourcePoolsPagedResponse listDeploymentResourcePools( + ProjectName parent) { + ListDeploymentResourcePoolsRequest request = + ListDeploymentResourcePoolsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDeploymentResourcePools(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List DeploymentResourcePools in a location. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * for (DeploymentResourcePool element : + * deploymentResourcePoolServiceClient.listDeploymentResourcePools(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent Location which owns this collection of + * DeploymentResourcePools. Format: projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeploymentResourcePoolsPagedResponse listDeploymentResourcePools(String parent) { + ListDeploymentResourcePoolsRequest request = + ListDeploymentResourcePoolsRequest.newBuilder().setParent(parent).build(); + return listDeploymentResourcePools(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List DeploymentResourcePools in a location. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * ListDeploymentResourcePoolsRequest request = + * ListDeploymentResourcePoolsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (DeploymentResourcePool element : + * deploymentResourcePoolServiceClient.listDeploymentResourcePools(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @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 ListDeploymentResourcePoolsPagedResponse listDeploymentResourcePools( + ListDeploymentResourcePoolsRequest request) { + return listDeploymentResourcePoolsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List DeploymentResourcePools in a location. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * ListDeploymentResourcePoolsRequest request = + * ListDeploymentResourcePoolsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallable< + ListDeploymentResourcePoolsRequest, ListDeploymentResourcePoolsPagedResponse> + listDeploymentResourcePoolsPagedCallable() { + return stub.listDeploymentResourcePoolsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List DeploymentResourcePools in a location. + * + *future = + * deploymentResourcePoolServiceClient + * .listDeploymentResourcePoolsPagedCallable() + * .futureCall(request); + * // Do something. + * for (DeploymentResourcePool element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * ListDeploymentResourcePoolsRequest request = + * ListDeploymentResourcePoolsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListDeploymentResourcePoolsResponse response = + * deploymentResourcePoolServiceClient.listDeploymentResourcePoolsCallable().call(request); + * for (DeploymentResourcePool element : response.getDeploymentResourcePoolsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable< + ListDeploymentResourcePoolsRequest, ListDeploymentResourcePoolsResponse> + listDeploymentResourcePoolsCallable() { + return stub.listDeploymentResourcePoolsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a DeploymentResourcePool. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * DeploymentResourcePoolName name = + * DeploymentResourcePoolName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]"); + * deploymentResourcePoolServiceClient.deleteDeploymentResourcePoolAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the DeploymentResourcePool to delete. Format: + * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * String name = + * DeploymentResourcePoolName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]") + * .toString(); + * deploymentResourcePoolServiceClient.deleteDeploymentResourcePoolAsync(name).get(); + * } + * }+ * + * @param name Required. The name of the DeploymentResourcePool to delete. Format: + * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * DeleteDeploymentResourcePoolRequest request = + * DeleteDeploymentResourcePoolRequest.newBuilder() + * .setName( + * DeploymentResourcePoolName.of( + * "[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]") + * .toString()) + * .build(); + * deploymentResourcePoolServiceClient.deleteDeploymentResourcePoolAsync(request).get(); + * } + * }+ * + * @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
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * DeleteDeploymentResourcePoolRequest request = + * DeleteDeploymentResourcePoolRequest.newBuilder() + * .setName( + * DeploymentResourcePoolName.of( + * "[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]") + * .toString()) + * .build(); + * OperationFuture+ */ + public final OperationCallable< + DeleteDeploymentResourcePoolRequest, Empty, DeleteOperationMetadata> + deleteDeploymentResourcePoolOperationCallable() { + return stub.deleteDeploymentResourcePoolOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a DeploymentResourcePool. + * + *future = + * deploymentResourcePoolServiceClient + * .deleteDeploymentResourcePoolOperationCallable() + * .futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * DeleteDeploymentResourcePoolRequest request = + * DeleteDeploymentResourcePoolRequest.newBuilder() + * .setName( + * DeploymentResourcePoolName.of( + * "[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deploymentResourcePoolServiceClient + * .deleteDeploymentResourcePoolCallable() + * .futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * String deploymentResourcePool = "deploymentResourcePool-1928845137"; + * for (DeployedModel element : + * deploymentResourcePoolServiceClient + * .queryDeployedModels(deploymentResourcePool) + * .iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param deploymentResourcePool Required. The name of the target DeploymentResourcePool to query. + * Format: + * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QueryDeployedModelsPagedResponse queryDeployedModels(String deploymentResourcePool) { + QueryDeployedModelsRequest request = + QueryDeployedModelsRequest.newBuilder() + .setDeploymentResourcePool(deploymentResourcePool) + .build(); + return queryDeployedModels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List DeployedModels that have been deployed on this DeploymentResourcePool. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * QueryDeployedModelsRequest request = + * QueryDeployedModelsRequest.newBuilder() + * .setDeploymentResourcePool("deploymentResourcePool-1928845137") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (DeployedModel element : + * deploymentResourcePoolServiceClient.queryDeployedModels(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @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 QueryDeployedModelsPagedResponse queryDeployedModels( + QueryDeployedModelsRequest request) { + return queryDeployedModelsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List DeployedModels that have been deployed on this DeploymentResourcePool. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * QueryDeployedModelsRequest request = + * QueryDeployedModelsRequest.newBuilder() + * .setDeploymentResourcePool("deploymentResourcePool-1928845137") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deploymentResourcePoolServiceClient + * .queryDeployedModelsPagedCallable() + * .futureCall(request); + * // Do something. + * for (DeployedModel element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * QueryDeployedModelsRequest request = + * QueryDeployedModelsRequest.newBuilder() + * .setDeploymentResourcePool("deploymentResourcePool-1928845137") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * QueryDeployedModelsResponse response = + * deploymentResourcePoolServiceClient.queryDeployedModelsCallable().call(request); + * for (DeployedModel element : response.getDeployedModelsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Location element : + * deploymentResourcePoolServiceClient.listLocations(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deploymentResourcePoolServiceClient.listLocationsPagedCallable().futureCall(request); + * // Do something. + * for (Location element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListLocationsResponse response = + * deploymentResourcePoolServiceClient.listLocationsCallable().call(request); + * for (Location element : response.getLocationsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * Location response = deploymentResourcePoolServiceClient.getLocation(request); + * } + * }+ * + * @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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deploymentResourcePoolServiceClient.getLocationCallable().futureCall(request); + * // Do something. + * Location response = future.get(); + * } + * }
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]") + * .toString()) + * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Policy response = deploymentResourcePoolServiceClient.setIamPolicy(request); + * } + * }+ * + * @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 Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]") + * .toString()) + * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deploymentResourcePoolServiceClient.setIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]") + * .toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * Policy response = deploymentResourcePoolServiceClient.getIamPolicy(request); + * } + * }+ * + * @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 Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]") + * .toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deploymentResourcePoolServiceClient.getIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]") + * .toString()) + * .addAllPermissions(new ArrayList+ * + * @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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *()) + * .build(); + * TestIamPermissionsResponse response = + * deploymentResourcePoolServiceClient.testIamPermissions(request); + * } + * }
Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient = + * DeploymentResourcePoolServiceClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]") + * .toString()) + * .addAllPermissions(new ArrayList+ */ + public final UnaryCallable()) + * .build(); + * ApiFuture future = + * deploymentResourcePoolServiceClient.testIamPermissionsCallable().futureCall(request); + * // Do something. + * TestIamPermissionsResponse response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of getDeploymentResourcePool to 30 seconds: + * + *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. + * DeploymentResourcePoolServiceSettings.Builder deploymentResourcePoolServiceSettingsBuilder = + * DeploymentResourcePoolServiceSettings.newBuilder(); + * deploymentResourcePoolServiceSettingsBuilder + * .getDeploymentResourcePoolSettings() + * .setRetrySettings( + * deploymentResourcePoolServiceSettingsBuilder + * .getDeploymentResourcePoolSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * DeploymentResourcePoolServiceSettings deploymentResourcePoolServiceSettings = + * deploymentResourcePoolServiceSettingsBuilder.build(); + * }+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class DeploymentResourcePoolServiceSettings + extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction ======================= DeploymentResourcePoolServiceClient =======================
+ *
+ * Service Description: A service that manages the DeploymentResourcePool resource.
+ *
+ * Sample for DeploymentResourcePoolServiceClient:
+ *
+ * ======================= EndpointServiceClient =======================
*
* Service Description: A service for managing Vertex AI's Endpoints.
diff --git a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/DeploymentResourcePoolServiceStub.java b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/DeploymentResourcePoolServiceStub.java
new file mode 100644
index 000000000..c0f9acaf8
--- /dev/null
+++ b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/DeploymentResourcePoolServiceStub.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.aiplatform.v1beta1.stub;
+
+import static com.google.cloud.aiplatform.v1beta1.DeploymentResourcePoolServiceClient.ListDeploymentResourcePoolsPagedResponse;
+import static com.google.cloud.aiplatform.v1beta1.DeploymentResourcePoolServiceClient.ListLocationsPagedResponse;
+import static com.google.cloud.aiplatform.v1beta1.DeploymentResourcePoolServiceClient.QueryDeployedModelsPagedResponse;
+
+import com.google.api.core.BetaApi;
+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.v1beta1.CreateDeploymentResourcePoolOperationMetadata;
+import com.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest;
+import com.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest;
+import com.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata;
+import com.google.cloud.aiplatform.v1beta1.DeploymentResourcePool;
+import com.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest;
+import com.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest;
+import com.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsResponse;
+import com.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest;
+import com.google.cloud.aiplatform.v1beta1.QueryDeployedModelsResponse;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the DeploymentResourcePoolService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public abstract class DeploymentResourcePoolServiceStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ }
+
+ public OperationCallable<
+ CreateDeploymentResourcePoolRequest,
+ DeploymentResourcePool,
+ CreateDeploymentResourcePoolOperationMetadata>
+ createDeploymentResourcePoolOperationCallable() {
+ throw new UnsupportedOperationException(
+ "Not implemented: createDeploymentResourcePoolOperationCallable()");
+ }
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of getDeploymentResourcePool to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcDeploymentResourcePoolServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcDeploymentResourcePoolServiceStub extends DeploymentResourcePoolServiceStub {
+ private static final MethodDescriptor{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (DeploymentResourcePoolServiceClient deploymentResourcePoolServiceClient =
+ * DeploymentResourcePoolServiceClient.create()) {
+ * DeploymentResourcePoolName name =
+ * DeploymentResourcePoolName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT_RESOURCE_POOL]");
+ * DeploymentResourcePool response =
+ * deploymentResourcePoolServiceClient.getDeploymentResourcePool(name);
+ * }
+ * }
+ *
*
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * DeploymentResourcePoolServiceStubSettings.Builder deploymentResourcePoolServiceSettingsBuilder =
+ * DeploymentResourcePoolServiceStubSettings.newBuilder();
+ * deploymentResourcePoolServiceSettingsBuilder
+ * .getDeploymentResourcePoolSettings()
+ * .setRetrySettings(
+ * deploymentResourcePoolServiceSettingsBuilder
+ * .getDeploymentResourcePoolSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * DeploymentResourcePoolServiceStubSettings deploymentResourcePoolServiceSettings =
+ * deploymentResourcePoolServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class DeploymentResourcePoolServiceStubSettings
+ extends StubSettings