Note: The VertexAI instance will start a service client when the first API call is + * made. Please close the VertexAI instance after making any API calls so that clients get closed as + * well. + * + *
{@code + * try (VertexAI vertexAi = new VertexAI("my-project", "us-central1"); ) { + * GenerativeModel model = new GenerativeModel("gemini-pro", vertexAi) + * // Do something with the model. + * } + * }+ */ +public class VertexAI implements AutoCloseable { + + private final String projectId; + private final String location; + private final GoogleCredentials credentials; + private Transport transport = Transport.GRPC; + // The clients will be instantiated lazily + private PredictionServiceClient predictionServiceClient = null; + private PredictionServiceClient predictionServiceRestClient = null; + + /** + * Construct a VertexAI instance with custom credentials. + * + * @param projectId the default project to use when making API calls + * @param location the default location to use when making API calls + * @param credentials the custom credentials to use when making API calls + */ + public VertexAI(String projectId, String location, GoogleCredentials credentials) { + this.projectId = projectId; + this.location = location; + this.credentials = credentials; + } + + /** + * Construct a VertexAI instance with default transport layer and custom credentials. + * + * @param projectId the default project to use when making API calls + * @param location the default location to use when making API calls + * @param transport the default {@link Transport} layer to use to send API requests + * @param credentials the default custom credentials to use when making API calls + */ + public VertexAI( + String projectId, String location, Transport transport, GoogleCredentials credentials) { + this(projectId, location, credentials); + this.transport = transport; + } + + /** + * Construct a VertexAI instance with application default credentials. + * + * @param projectId the default project to use when making API calls + * @param location the default location to use when making API calls + * @param scopes collection of scopes in the default credentials + */ + public VertexAI(String projectId, String location, String... scopes) throws IOException { + this( + projectId, + location, + scopes.length == 0 + ? GoogleCredentials.getApplicationDefault() + : GoogleCredentials.getApplicationDefault().createScoped(scopes)); + } + + /** + * Construct a VertexAI instance with default transport layer and application default credentials. + * + * @param projectId the default project to use when making API calls + * @param location the default location to use when making API calls + * @param transport the default {@link Transport} layer to use to send API requests + * @param scopes collection of scopes in the default credentials + */ + public VertexAI(String projectId, String location, Transport transport, String... scopes) + throws IOException { + this( + projectId, + location, + scopes.length == 0 + ? GoogleCredentials.getApplicationDefault() + : GoogleCredentials.getApplicationDefault().createScoped(scopes)); + this.transport = transport; + } + + /** Returns the default {@link Transport} layer to use to send API requests. */ + public Transport getTransport() { + return this.transport; + } + + /** Returns the default project to use when making API calls. */ + public String getProjectId() { + return this.projectId; + } + + /** Returns the default location to use when making API calls. */ + public String getLocation() { + return this.location; + } + + /** Returns the default credentials to use when making API calls. */ + public GoogleCredentials getCredentials() { + return credentials; + } + + /** Sets the value for {@link #getTransport()}. */ + public void setTransport(Transport transport) { + this.transport = transport; + } + + /** + * Returns the {@link PredictionServiceClient} with GRPC. The client will be instantiated when the + * first prediction API call is made. + */ + public PredictionServiceClient getPredictionServiceClient() throws IOException { + if (predictionServiceClient == null) { + PredictionServiceSettings settings = + PredictionServiceSettings.newBuilder() + .setEndpoint( + String.format("%s-autopush-aiplatform.sandbox.googleapis.com:443", location)) + .build(); + predictionServiceClient = PredictionServiceClient.create(settings); + } + return predictionServiceClient; + } + + /** + * Returns the {@link PredictionServiceClient} with REST. The client will be instantiated when the + * first prediction API call is made. + */ + public PredictionServiceClient getPredictionServiceRestClient() throws IOException { + if (predictionServiceRestClient == null) { + PredictionServiceSettings settings = + PredictionServiceSettings.newHttpJsonBuilder() + .setEndpoint( + String.format("%s-autopush-aiplatform.sandbox.googleapis.com:443", location)) + .build(); + predictionServiceRestClient = PredictionServiceClient.create(settings); + } + return predictionServiceRestClient; + } + + /** Closes the VertexAI instance together with all its instantiated clients. */ + @Override + public void close() { + if (predictionServiceClient != null) { + predictionServiceClient.close(); + } + if (predictionServiceRestClient != null) { + predictionServiceRestClient.close(); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/EndpointServiceClient.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/EndpointServiceClient.java new file mode 100644 index 000000000000..039e3af7771d --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/EndpointServiceClient.java @@ -0,0 +1,2177 @@ +/* + * Copyright 2023 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.vertexai.api; + +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.httpjson.longrunning.OperationsClient; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.stub.EndpointServiceStub; +import com.google.cloud.vertexai.api.stub.EndpointServiceStubSettings; +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.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A service for managing Vertex AI's Endpoints. + * + *
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 and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * EndpointName name = + * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + * Endpoint response = endpointServiceClient.getEndpoint(name); + * } + * }+ * + *
Note: close() needs to be called on the EndpointServiceClient 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 EndpointServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * EndpointServiceSettings endpointServiceSettings = + * EndpointServiceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * EndpointServiceClient endpointServiceClient = + * EndpointServiceClient.create(endpointServiceSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * EndpointServiceSettings endpointServiceSettings = + * EndpointServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * EndpointServiceClient endpointServiceClient = + * EndpointServiceClient.create(endpointServiceSettings); + * }+ * + *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * EndpointServiceSettings endpointServiceSettings = + * EndpointServiceSettings.newHttpJsonBuilder().build(); + * EndpointServiceClient endpointServiceClient = + * EndpointServiceClient.create(endpointServiceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class EndpointServiceClient implements BackgroundResource { + private final EndpointServiceSettings settings; + private final EndpointServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of EndpointServiceClient with default settings. */ + public static final EndpointServiceClient create() throws IOException { + return create(EndpointServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of EndpointServiceClient, 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 EndpointServiceClient create(EndpointServiceSettings settings) + throws IOException { + return new EndpointServiceClient(settings); + } + + /** + * Constructs an instance of EndpointServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(EndpointServiceSettings). + */ + public static final EndpointServiceClient create(EndpointServiceStub stub) { + return new EndpointServiceClient(stub); + } + + /** + * Constructs an instance of EndpointServiceClient, 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 EndpointServiceClient(EndpointServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((EndpointServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected EndpointServiceClient(EndpointServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final EndpointServiceSettings getSettings() { + return settings; + } + + public EndpointServiceStub 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 com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an Endpoint. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Endpoint endpoint = Endpoint.newBuilder().build(); + * Endpoint response = endpointServiceClient.createEndpointAsync(parent, endpoint).get(); + * } + * }+ * + * @param parent Required. The resource name of the Location to create the Endpoint in. Format: + * `projects/{project}/locations/{location}` + * @param endpoint Required. The Endpoint to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Endpoint endpoint = Endpoint.newBuilder().build(); + * Endpoint response = endpointServiceClient.createEndpointAsync(parent, endpoint).get(); + * } + * }+ * + * @param parent Required. The resource name of the Location to create the Endpoint in. Format: + * `projects/{project}/locations/{location}` + * @param endpoint Required. The Endpoint to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Endpoint endpoint = Endpoint.newBuilder().build(); + * String endpointId = "endpointId-1837754992"; + * Endpoint response = + * endpointServiceClient.createEndpointAsync(parent, endpoint, endpointId).get(); + * } + * }+ * + * @param parent Required. The resource name of the Location to create the Endpoint in. Format: + * `projects/{project}/locations/{location}` + * @param endpoint Required. The Endpoint to create. + * @param endpointId Immutable. The ID to use for endpoint, which will become the final component + * of the endpoint resource name. If not provided, Vertex AI will generate a value for this + * ID. + *
If the first character is a letter, this value may be up to 63 characters, and valid + * characters are `[a-z0-9-]`. The last character must be a letter or number. + *
If the first character is a number, this value may be up to 9 characters, and valid + * characters are `[0-9]` with no leading zeros. + *
When using HTTP/JSON, this field is populated based on a query string argument, such as
+ * `?endpoint_id=12345`. This is the fallback for fields that are not included in either the
+ * URI or the body.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * If the first character is a letter, this value may be up to 63 characters, and valid
+ * characters are `[a-z0-9-]`. The last character must be a letter or number.
+ * If the first character is a number, this value may be up to 9 characters, and valid
+ * characters are `[0-9]` with no leading zeros.
+ * When using HTTP/JSON, this field is populated based on a query string argument, such as
+ * `?endpoint_id=12345`. This is the fallback for fields that are not included in either the
+ * URI or the body.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * If this field is non-empty, then the Endpoint's
+ * [traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split] will be overwritten
+ * with it. To refer to the ID of the just being deployed Model, a "0" should be used, and the
+ * actual ID of the new DeployedModel will be filled in its place by this method. The traffic
+ * percentage values must add up to 100.
+ * If this field is empty, then the Endpoint's
+ * [traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split] is not updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * If this field is non-empty, then the Endpoint's
+ * [traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split] will be overwritten
+ * with it. To refer to the ID of the just being deployed Model, a "0" should be used, and the
+ * actual ID of the new DeployedModel will be filled in its place by this method. The traffic
+ * percentage values must add up to 100.
+ * If this field is empty, then the Endpoint's
+ * [traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split] is not updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Sample code:
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
+ *
+ * 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:
+ *
+ * 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 getEndpoint to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * Note: close() needs to be called on the PredictionServiceClient 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 PredictionServiceSettings to
+ * create(). For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class PredictionServiceClient implements BackgroundResource {
+ private final PredictionServiceSettings settings;
+ private final PredictionServiceStub stub;
+
+ /** Constructs an instance of PredictionServiceClient with default settings. */
+ public static final PredictionServiceClient create() throws IOException {
+ return create(PredictionServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of PredictionServiceClient, 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 PredictionServiceClient create(PredictionServiceSettings settings)
+ throws IOException {
+ return new PredictionServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of PredictionServiceClient, using the given stub for making calls. This
+ * is for advanced usage - prefer using create(PredictionServiceSettings).
+ */
+ public static final PredictionServiceClient create(PredictionServiceStub stub) {
+ return new PredictionServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of PredictionServiceClient, 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 PredictionServiceClient(PredictionServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((PredictionServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected PredictionServiceClient(PredictionServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final PredictionServiceSettings getSettings() {
+ return settings;
+ }
+
+ public PredictionServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Perform an online prediction.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The response includes the following HTTP headers:
+ *
+ * Sample code:
+ *
+ * A [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] may have an upper limit
+ * on the number of instances it supports per request. When this limit it is exceeded for an
+ * AutoML model, the [RawPredict][google.cloud.vertexai.v1beta1.PredictionService.RawPredict]
+ * method returns an error. When this limit is exceeded for a custom-trained model, the
+ * behavior varies depending on the model.
+ * You can specify the schema for each instance in the
+ * [predict_schemata.instance_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.instance_schema_uri]
+ * field when you create a [Model][google.cloud.vertexai.v1beta1.Model]. This schema applies
+ * when you deploy the `Model` as a `DeployedModel` to an
+ * [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] and use the `RawPredict` method.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HttpBody rawPredict(EndpointName endpoint, HttpBody httpBody) {
+ RawPredictRequest request =
+ RawPredictRequest.newBuilder()
+ .setEndpoint(endpoint == null ? null : endpoint.toString())
+ .setHttpBody(httpBody)
+ .build();
+ return rawPredict(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Perform an online prediction with an arbitrary HTTP payload.
+ *
+ * The response includes the following HTTP headers:
+ *
+ * Sample code:
+ *
+ * A [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] may have an upper limit
+ * on the number of instances it supports per request. When this limit it is exceeded for an
+ * AutoML model, the [RawPredict][google.cloud.vertexai.v1beta1.PredictionService.RawPredict]
+ * method returns an error. When this limit is exceeded for a custom-trained model, the
+ * behavior varies depending on the model.
+ * You can specify the schema for each instance in the
+ * [predict_schemata.instance_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.instance_schema_uri]
+ * field when you create a [Model][google.cloud.vertexai.v1beta1.Model]. This schema applies
+ * when you deploy the `Model` as a `DeployedModel` to an
+ * [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] and use the `RawPredict` method.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HttpBody rawPredict(String endpoint, HttpBody httpBody) {
+ RawPredictRequest request =
+ RawPredictRequest.newBuilder().setEndpoint(endpoint).setHttpBody(httpBody).build();
+ return rawPredict(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Perform an online prediction with an arbitrary HTTP payload.
+ *
+ * The response includes the following HTTP headers:
+ *
+ * Sample code:
+ *
+ * The response includes the following HTTP headers:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * If [deployed_model_id][google.cloud.vertexai.v1beta1.ExplainRequest.deployed_model_id] is
+ * specified, the corresponding DeployModel must have
+ * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] populated. If
+ * [deployed_model_id][google.cloud.vertexai.v1beta1.ExplainRequest.deployed_model_id] is not
+ * specified, all DeployedModels must have
+ * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] populated.
+ *
+ * Sample code:
+ *
+ * If [deployed_model_id][google.cloud.vertexai.v1beta1.ExplainRequest.deployed_model_id] is
+ * specified, the corresponding DeployModel must have
+ * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] populated. If
+ * [deployed_model_id][google.cloud.vertexai.v1beta1.ExplainRequest.deployed_model_id] is not
+ * specified, all DeployedModels must have
+ * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] populated.
+ *
+ * Sample code:
+ *
+ * If [deployed_model_id][google.cloud.vertexai.v1beta1.ExplainRequest.deployed_model_id] is
+ * specified, the corresponding DeployModel must have
+ * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] populated. If
+ * [deployed_model_id][google.cloud.vertexai.v1beta1.ExplainRequest.deployed_model_id] is not
+ * specified, all DeployedModels must have
+ * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] populated.
+ *
+ * Sample code:
+ *
+ * If [deployed_model_id][google.cloud.vertexai.v1beta1.ExplainRequest.deployed_model_id] is
+ * specified, the corresponding DeployModel must have
+ * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] populated. If
+ * [deployed_model_id][google.cloud.vertexai.v1beta1.ExplainRequest.deployed_model_id] is not
+ * specified, all DeployedModels must have
+ * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] populated.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Sample code:
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
+ *
+ * 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:
+ *
+ * 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 predict to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= EndpointServiceClient =======================
+ *
+ * Service Description: A service for managing Vertex AI's Endpoints.
+ *
+ * Sample for EndpointServiceClient:
+ *
+ * ======================= PredictionServiceClient =======================
+ *
+ * Service Description: A service for online predictions and explanations.
+ *
+ * Sample for PredictionServiceClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class EndpointServiceStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
+ }
+
+ public OperationCallable 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 getEndpoint to 30 seconds:
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Endpoint endpoint = Endpoint.newBuilder().build();
+ * String endpointId = "endpointId-1837754992";
+ * Endpoint response =
+ * endpointServiceClient.createEndpointAsync(parent, endpoint, endpointId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to create the Endpoint in. Format:
+ * `projects/{project}/locations/{location}`
+ * @param endpoint Required. The Endpoint to create.
+ * @param endpointId Immutable. The ID to use for endpoint, which will become the final component
+ * of the endpoint resource name. If not provided, Vertex AI will generate a value for this
+ * ID.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * CreateEndpointRequest request =
+ * CreateEndpointRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setEndpoint(Endpoint.newBuilder().build())
+ * .setEndpointId("endpointId-1837754992")
+ * .build();
+ * Endpoint response = endpointServiceClient.createEndpointAsync(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{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * CreateEndpointRequest request =
+ * CreateEndpointRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setEndpoint(Endpoint.newBuilder().build())
+ * .setEndpointId("endpointId-1837754992")
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * CreateEndpointRequest request =
+ * CreateEndpointRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setEndpoint(Endpoint.newBuilder().build())
+ * .setEndpointId("endpointId-1837754992")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * EndpointName name =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * Endpoint response = endpointServiceClient.getEndpoint(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Endpoint resource. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Endpoint getEndpoint(EndpointName name) {
+ GetEndpointRequest request =
+ GetEndpointRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getEndpoint(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets an Endpoint.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * String name =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString();
+ * Endpoint response = endpointServiceClient.getEndpoint(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Endpoint resource. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Endpoint getEndpoint(String name) {
+ GetEndpointRequest request = GetEndpointRequest.newBuilder().setName(name).build();
+ return getEndpoint(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets an Endpoint.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * GetEndpointRequest request =
+ * GetEndpointRequest.newBuilder()
+ * .setName(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .build();
+ * Endpoint response = endpointServiceClient.getEndpoint(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 Endpoint getEndpoint(GetEndpointRequest request) {
+ return getEndpointCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets an Endpoint.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * GetEndpointRequest request =
+ * GetEndpointRequest.newBuilder()
+ * .setName(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Endpoint element : endpointServiceClient.listEndpoints(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location from which to list the Endpoints.
+ * Format: `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListEndpointsPagedResponse listEndpoints(LocationName parent) {
+ ListEndpointsRequest request =
+ ListEndpointsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listEndpoints(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Endpoints in a Location.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Endpoint element : endpointServiceClient.listEndpoints(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location from which to list the Endpoints.
+ * Format: `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListEndpointsPagedResponse listEndpoints(String parent) {
+ ListEndpointsRequest request = ListEndpointsRequest.newBuilder().setParent(parent).build();
+ return listEndpoints(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Endpoints in a Location.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * ListEndpointsRequest request =
+ * ListEndpointsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * for (Endpoint element : endpointServiceClient.listEndpoints(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 ListEndpointsPagedResponse listEndpoints(ListEndpointsRequest request) {
+ return listEndpointsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Endpoints in a Location.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * ListEndpointsRequest request =
+ * ListEndpointsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * ListEndpointsRequest request =
+ * ListEndpointsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * while (true) {
+ * ListEndpointsResponse response =
+ * endpointServiceClient.listEndpointsCallable().call(request);
+ * for (Endpoint element : response.getEndpointsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * Endpoint endpoint = Endpoint.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Endpoint response = endpointServiceClient.updateEndpoint(endpoint, updateMask);
+ * }
+ * }
+ *
+ * @param endpoint Required. The Endpoint which replaces the resource on the server.
+ * @param updateMask Required. The update mask applies to the resource. See
+ * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Endpoint updateEndpoint(Endpoint endpoint, FieldMask updateMask) {
+ UpdateEndpointRequest request =
+ UpdateEndpointRequest.newBuilder().setEndpoint(endpoint).setUpdateMask(updateMask).build();
+ return updateEndpoint(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates an Endpoint.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * UpdateEndpointRequest request =
+ * UpdateEndpointRequest.newBuilder()
+ * .setEndpoint(Endpoint.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Endpoint response = endpointServiceClient.updateEndpoint(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 Endpoint updateEndpoint(UpdateEndpointRequest request) {
+ return updateEndpointCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates an Endpoint.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * UpdateEndpointRequest request =
+ * UpdateEndpointRequest.newBuilder()
+ * .setEndpoint(Endpoint.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * EndpointName name =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * endpointServiceClient.deleteEndpointAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the Endpoint resource to be deleted. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * String name =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString();
+ * endpointServiceClient.deleteEndpointAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the Endpoint resource to be deleted. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * DeleteEndpointRequest request =
+ * DeleteEndpointRequest.newBuilder()
+ * .setName(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .build();
+ * endpointServiceClient.deleteEndpointAsync(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{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * DeleteEndpointRequest request =
+ * DeleteEndpointRequest.newBuilder()
+ * .setName(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * DeleteEndpointRequest request =
+ * DeleteEndpointRequest.newBuilder()
+ * .setName(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * EndpointName endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * DeployedModel deployedModel = DeployedModel.newBuilder().build();
+ * Map
+ *
+ * @param endpoint Required. The name of the Endpoint resource into which to deploy a Model.
+ * Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param deployedModel Required. The DeployedModel to be created within the Endpoint. Note that
+ * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split] must be
+ * updated for the DeployedModel to start receiving traffic, either as part of this call, or
+ * via
+ * [EndpointService.UpdateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.UpdateEndpoint].
+ * @param trafficSplit A map from a DeployedModel's ID to the percentage of this Endpoint's
+ * traffic that should be forwarded to that DeployedModel.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * String endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString();
+ * DeployedModel deployedModel = DeployedModel.newBuilder().build();
+ * Map
+ *
+ * @param endpoint Required. The name of the Endpoint resource into which to deploy a Model.
+ * Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param deployedModel Required. The DeployedModel to be created within the Endpoint. Note that
+ * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split] must be
+ * updated for the DeployedModel to start receiving traffic, either as part of this call, or
+ * via
+ * [EndpointService.UpdateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.UpdateEndpoint].
+ * @param trafficSplit A map from a DeployedModel's ID to the percentage of this Endpoint's
+ * traffic that should be forwarded to that DeployedModel.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * DeployModelRequest request =
+ * DeployModelRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setDeployedModel(DeployedModel.newBuilder().build())
+ * .putAllTrafficSplit(new HashMap
+ *
+ * @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{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * DeployModelRequest request =
+ * DeployModelRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setDeployedModel(DeployedModel.newBuilder().build())
+ * .putAllTrafficSplit(new HashMap
+ */
+ public final OperationCallable<
+ DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata>
+ deployModelOperationCallable() {
+ return stub.deployModelOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deploys a Model into this Endpoint, creating a DeployedModel within it.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * DeployModelRequest request =
+ * DeployModelRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setDeployedModel(DeployedModel.newBuilder().build())
+ * .putAllTrafficSplit(new HashMap
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * EndpointName endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * String deployedModelId = "deployedModelId-1817547906";
+ * Map
+ *
+ * @param endpoint Required. The name of the Endpoint resource from which to undeploy a Model.
+ * Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param deployedModelId Required. The ID of the DeployedModel to be undeployed from the
+ * Endpoint.
+ * @param trafficSplit If this field is provided, then the Endpoint's
+ * [traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split] will be overwritten
+ * with it. If last DeployedModel is being undeployed from the Endpoint, the
+ * [Endpoint.traffic_split] will always end up empty when this call returns. A DeployedModel
+ * will be successfully undeployed only if it doesn't have any traffic assigned to it when
+ * this method executes, or if this field unassigns any traffic to it.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * String endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString();
+ * String deployedModelId = "deployedModelId-1817547906";
+ * Map
+ *
+ * @param endpoint Required. The name of the Endpoint resource from which to undeploy a Model.
+ * Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param deployedModelId Required. The ID of the DeployedModel to be undeployed from the
+ * Endpoint.
+ * @param trafficSplit If this field is provided, then the Endpoint's
+ * [traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split] will be overwritten
+ * with it. If last DeployedModel is being undeployed from the Endpoint, the
+ * [Endpoint.traffic_split] will always end up empty when this call returns. A DeployedModel
+ * will be successfully undeployed only if it doesn't have any traffic assigned to it when
+ * this method executes, or if this field unassigns any traffic to it.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * UndeployModelRequest request =
+ * UndeployModelRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setDeployedModelId("deployedModelId-1817547906")
+ * .putAllTrafficSplit(new HashMap
+ *
+ * @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{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * UndeployModelRequest request =
+ * UndeployModelRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setDeployedModelId("deployedModelId-1817547906")
+ * .putAllTrafficSplit(new HashMap
+ */
+ public final OperationCallable<
+ UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata>
+ undeployModelOperationCallable() {
+ return stub.undeployModelOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and freeing all resources
+ * it's using.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * UndeployModelRequest request =
+ * UndeployModelRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setDeployedModelId("deployedModelId-1817547906")
+ * .putAllTrafficSplit(new HashMap
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * EndpointName endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * DeployedModel deployedModel = DeployedModel.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * MutateDeployedModelResponse response =
+ * endpointServiceClient.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get();
+ * }
+ * }
+ *
+ * @param endpoint Required. The name of the Endpoint resource into which to mutate a
+ * DeployedModel. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param deployedModel Required. The DeployedModel to be mutated within the Endpoint. Only the
+ * following fields can be mutated:
+ *
+ *
+ *
+ * @param updateMask Required. The update mask applies to the resource. See
+ * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * String endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString();
+ * DeployedModel deployedModel = DeployedModel.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * MutateDeployedModelResponse response =
+ * endpointServiceClient.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get();
+ * }
+ * }
+ *
+ * @param endpoint Required. The name of the Endpoint resource into which to mutate a
+ * DeployedModel. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param deployedModel Required. The DeployedModel to be mutated within the Endpoint. Only the
+ * following fields can be mutated:
+ *
+ *
+ *
+ * @param updateMask Required. The update mask applies to the resource. See
+ * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * MutateDeployedModelRequest request =
+ * MutateDeployedModelRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setDeployedModel(DeployedModel.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * MutateDeployedModelResponse response =
+ * endpointServiceClient.mutateDeployedModelAsync(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{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * MutateDeployedModelRequest request =
+ * MutateDeployedModelRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setDeployedModel(DeployedModel.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ MutateDeployedModelRequest,
+ MutateDeployedModelResponse,
+ MutateDeployedModelOperationMetadata>
+ mutateDeployedModelOperationCallable() {
+ return stub.mutateDeployedModelOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates an existing deployed model. Updatable fields include `min_replica_count`,
+ * `max_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and
+ * `enable_container_logging` (v1beta1 only).
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * MutateDeployedModelRequest request =
+ * MutateDeployedModelRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setDeployedModel(DeployedModel.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : endpointServiceClient.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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response =
+ * endpointServiceClient.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{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = endpointServiceClient.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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Policy response = endpointServiceClient.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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * Policy response = endpointServiceClient.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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EndpointServiceSettings.Builder endpointServiceSettingsBuilder =
+ * EndpointServiceSettings.newBuilder();
+ * endpointServiceSettingsBuilder
+ * .getEndpointSettings()
+ * .setRetrySettings(
+ * endpointServiceSettingsBuilder
+ * .getEndpointSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * EndpointServiceSettings endpointServiceSettings = endpointServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class EndpointServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * EndpointName endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * List
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PredictionServiceSettings predictionServiceSettings =
+ * PredictionServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * PredictionServiceClient predictionServiceClient =
+ * PredictionServiceClient.create(predictionServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PredictionServiceSettings predictionServiceSettings =
+ * PredictionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PredictionServiceClient predictionServiceClient =
+ * PredictionServiceClient.create(predictionServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PredictionServiceSettings predictionServiceSettings =
+ * PredictionServiceSettings.newHttpJsonBuilder().build();
+ * PredictionServiceClient predictionServiceClient =
+ * PredictionServiceClient.create(predictionServiceSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * EndpointName endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * List
+ *
+ * @param endpoint Required. The name of the Endpoint requested to serve the prediction. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param instances Required. The instances that are the input to the prediction call. A
+ * DeployedModel may have an upper limit on the number of instances it supports per request,
+ * and when it is exceeded the prediction call errors in case of AutoML Models, or, in case of
+ * customer created Models, the behaviour is as documented by that Model. The schema of any
+ * single instance may be specified via Endpoint's DeployedModels'
+ * [Model's][google.cloud.vertexai.v1beta1.DeployedModel.model]
+ * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+ * [instance_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.instance_schema_uri].
+ * @param parameters The parameters that govern the prediction. The schema of the parameters may
+ * be specified via Endpoint's DeployedModels' [Model's
+ * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+ * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+ * [parameters_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.parameters_schema_uri].
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PredictResponse predict(
+ EndpointName endpoint, List{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * String endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString();
+ * List
+ *
+ * @param endpoint Required. The name of the Endpoint requested to serve the prediction. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param instances Required. The instances that are the input to the prediction call. A
+ * DeployedModel may have an upper limit on the number of instances it supports per request,
+ * and when it is exceeded the prediction call errors in case of AutoML Models, or, in case of
+ * customer created Models, the behaviour is as documented by that Model. The schema of any
+ * single instance may be specified via Endpoint's DeployedModels'
+ * [Model's][google.cloud.vertexai.v1beta1.DeployedModel.model]
+ * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+ * [instance_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.instance_schema_uri].
+ * @param parameters The parameters that govern the prediction. The schema of the parameters may
+ * be specified via Endpoint's DeployedModels' [Model's
+ * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+ * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+ * [parameters_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.parameters_schema_uri].
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PredictResponse predict(String endpoint, List{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * PredictRequest request =
+ * PredictRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllInstances(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 PredictResponse predict(PredictRequest request) {
+ return predictCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Perform an online prediction.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * PredictRequest request =
+ * PredictRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllInstances(new ArrayList
+ */
+ public final UnaryCallable
+ *
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * EndpointName endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * HttpBody httpBody = HttpBody.newBuilder().build();
+ * HttpBody response = predictionServiceClient.rawPredict(endpoint, httpBody);
+ * }
+ * }
+ *
+ * @param endpoint Required. The name of the Endpoint requested to serve the prediction. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param httpBody The prediction input. Supports HTTP headers and arbitrary data payload.
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * String endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString();
+ * HttpBody httpBody = HttpBody.newBuilder().build();
+ * HttpBody response = predictionServiceClient.rawPredict(endpoint, httpBody);
+ * }
+ * }
+ *
+ * @param endpoint Required. The name of the Endpoint requested to serve the prediction. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param httpBody The prediction input. Supports HTTP headers and arbitrary data payload.
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * RawPredictRequest request =
+ * RawPredictRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setHttpBody(HttpBody.newBuilder().build())
+ * .build();
+ * HttpBody response = predictionServiceClient.rawPredict(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 HttpBody rawPredict(RawPredictRequest request) {
+ return rawPredictCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Perform an online prediction with an arbitrary HTTP payload.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * RawPredictRequest request =
+ * RawPredictRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setHttpBody(HttpBody.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * DirectPredictRequest request =
+ * DirectPredictRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllInputs(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 DirectPredictResponse directPredict(DirectPredictRequest request) {
+ return directPredictCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Perform an unary online prediction request for Vertex first-party products and frameworks.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * DirectPredictRequest request =
+ * DirectPredictRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllInputs(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * DirectRawPredictRequest request =
+ * DirectRawPredictRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setMethodName("methodName-723163380")
+ * .setInput(ByteString.EMPTY)
+ * .build();
+ * DirectRawPredictResponse response = predictionServiceClient.directRawPredict(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 DirectRawPredictResponse directRawPredict(DirectRawPredictRequest request) {
+ return directRawPredictCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Perform an online prediction request through gRPC.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * DirectRawPredictRequest request =
+ * DirectRawPredictRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setMethodName("methodName-723163380")
+ * .setInput(ByteString.EMPTY)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * BidiStream
+ */
+ public final BidiStreamingCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * StreamingPredictRequest request =
+ * StreamingPredictRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllInputs(new ArrayList
+ */
+ public final ServerStreamingCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * BidiStream
+ */
+ public final BidiStreamingCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * EndpointName endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * List
+ *
+ * @param endpoint Required. The name of the Endpoint requested to serve the explanation. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param instances Required. The instances that are the input to the explanation call. A
+ * DeployedModel may have an upper limit on the number of instances it supports per request,
+ * and when it is exceeded the explanation call errors in case of AutoML Models, or, in case
+ * of customer created Models, the behaviour is as documented by that Model. The schema of any
+ * single instance may be specified via Endpoint's DeployedModels'
+ * [Model's][google.cloud.vertexai.v1beta1.DeployedModel.model]
+ * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+ * [instance_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.instance_schema_uri].
+ * @param parameters The parameters that govern the prediction. The schema of the parameters may
+ * be specified via Endpoint's DeployedModels' [Model's
+ * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+ * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+ * [parameters_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.parameters_schema_uri].
+ * @param deployedModelId If specified, this ExplainRequest will be served by the chosen
+ * DeployedModel, overriding
+ * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ExplainResponse explain(
+ EndpointName endpoint, List{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * String endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString();
+ * List
+ *
+ * @param endpoint Required. The name of the Endpoint requested to serve the explanation. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param instances Required. The instances that are the input to the explanation call. A
+ * DeployedModel may have an upper limit on the number of instances it supports per request,
+ * and when it is exceeded the explanation call errors in case of AutoML Models, or, in case
+ * of customer created Models, the behaviour is as documented by that Model. The schema of any
+ * single instance may be specified via Endpoint's DeployedModels'
+ * [Model's][google.cloud.vertexai.v1beta1.DeployedModel.model]
+ * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+ * [instance_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.instance_schema_uri].
+ * @param parameters The parameters that govern the prediction. The schema of the parameters may
+ * be specified via Endpoint's DeployedModels' [Model's
+ * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+ * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+ * [parameters_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.parameters_schema_uri].
+ * @param deployedModelId If specified, this ExplainRequest will be served by the chosen
+ * DeployedModel, overriding
+ * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ExplainResponse explain(
+ String endpoint, List{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * ExplainRequest request =
+ * ExplainRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllInstances(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 ExplainResponse explain(ExplainRequest request) {
+ return explainCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Perform an online explanation.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * ExplainRequest request =
+ * ExplainRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllInstances(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * EndpointName endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * List
+ *
+ * @param endpoint Required. The name of the Endpoint requested to perform token counting. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param instances Required. The instances that are the input to token counting call. Schema is
+ * identical to the prediction schema of the underlying model.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CountTokensResponse countTokens(EndpointName endpoint, List{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * String endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString();
+ * List
+ *
+ * @param endpoint Required. The name of the Endpoint requested to perform token counting. Format:
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+ * @param instances Required. The instances that are the input to token counting call. Schema is
+ * identical to the prediction schema of the underlying model.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CountTokensResponse countTokens(String endpoint, List{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * CountTokensRequest request =
+ * CountTokensRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setModel("model104069929")
+ * .addAllInstances(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 CountTokensResponse countTokens(CountTokensRequest request) {
+ return countTokensCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Perform a token counting.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * CountTokensRequest request =
+ * CountTokensRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setModel("model104069929")
+ * .addAllInstances(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * GenerateContentRequest request =
+ * GenerateContentRequest.newBuilder()
+ * .setEndpoint(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setModel("model104069929")
+ * .addAllContents(new ArrayList
+ */
+ public final ServerStreamingCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : predictionServiceClient.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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response =
+ * predictionServiceClient.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{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = predictionServiceClient.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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Policy response = predictionServiceClient.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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * Policy response = predictionServiceClient.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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PredictionServiceSettings.Builder predictionServiceSettingsBuilder =
+ * PredictionServiceSettings.newBuilder();
+ * predictionServiceSettingsBuilder
+ * .predictSettings()
+ * .setRetrySettings(
+ * predictionServiceSettingsBuilder
+ * .predictSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * PredictionServiceSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class PredictionServiceSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * EndpointName name =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * Endpoint response = endpointServiceClient.getEndpoint(name);
+ * }
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * EndpointName endpoint =
+ * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * List
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.vertexai.api;
+
+import javax.annotation.Generated;
diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/EndpointServiceStub.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/EndpointServiceStub.java
new file mode 100644
index 000000000000..96d0c79bb609
--- /dev/null
+++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/EndpointServiceStub.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2023 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.vertexai.api.stub;
+
+import static com.google.cloud.vertexai.api.EndpointServiceClient.ListEndpointsPagedResponse;
+import static com.google.cloud.vertexai.api.EndpointServiceClient.ListLocationsPagedResponse;
+
+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.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.cloud.vertexai.api.CreateEndpointOperationMetadata;
+import com.google.cloud.vertexai.api.CreateEndpointRequest;
+import com.google.cloud.vertexai.api.DeleteEndpointRequest;
+import com.google.cloud.vertexai.api.DeleteOperationMetadata;
+import com.google.cloud.vertexai.api.DeployModelOperationMetadata;
+import com.google.cloud.vertexai.api.DeployModelRequest;
+import com.google.cloud.vertexai.api.DeployModelResponse;
+import com.google.cloud.vertexai.api.Endpoint;
+import com.google.cloud.vertexai.api.GetEndpointRequest;
+import com.google.cloud.vertexai.api.ListEndpointsRequest;
+import com.google.cloud.vertexai.api.ListEndpointsResponse;
+import com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata;
+import com.google.cloud.vertexai.api.MutateDeployedModelRequest;
+import com.google.cloud.vertexai.api.MutateDeployedModelResponse;
+import com.google.cloud.vertexai.api.UndeployModelOperationMetadata;
+import com.google.cloud.vertexai.api.UndeployModelRequest;
+import com.google.cloud.vertexai.api.UndeployModelResponse;
+import com.google.cloud.vertexai.api.UpdateEndpointRequest;
+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 EndpointService service API.
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EndpointServiceStubSettings.Builder endpointServiceSettingsBuilder =
+ * EndpointServiceStubSettings.newBuilder();
+ * endpointServiceSettingsBuilder
+ * .getEndpointSettings()
+ * .setRetrySettings(
+ * endpointServiceSettingsBuilder
+ * .getEndpointSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * EndpointServiceStubSettings endpointServiceSettings = endpointServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class EndpointServiceStubSettings extends StubSettings