diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index be1529c33618..9f2b4b8f4da9 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -1022,6 +1022,13 @@ pom import + + com.google.cloud + google-cloud-vertexai-bom + 0.1.0-SNAPSHOT + pom + import + com.google.cloud google-cloud-video-intelligence-bom diff --git a/generation/consolidate_config.sh b/generation/consolidate_config.sh index 8b5c5d0aac58..5db8bbaa463c 100755 --- a/generation/consolidate_config.sh +++ b/generation/consolidate_config.sh @@ -102,4 +102,4 @@ annotateArtifactVersion 'dependency' 'grafeas' annotateArtifactVersion 'dependency' 'proto-google-cloud-orgpolicy-v1' annotateArtifactVersion 'dependency' 'proto-google-identity-accesscontextmanager-v1' annotateArtifactVersion 'dependency' 'proto-google-cloud-os-config-v1' -annotateArtifactVersion 'dependency' 'google-cloud-resourcemanager' \ No newline at end of file +annotateArtifactVersion 'dependency' 'google-cloud-resourcemanager' diff --git a/java-resourcemanager/README.md b/java-resourcemanager/README.md index f475ca1d362c..061bac197d62 100644 --- a/java-resourcemanager/README.md +++ b/java-resourcemanager/README.md @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.27.0 + 26.28.0 pom import @@ -336,7 +336,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-resourcemanager.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-resourcemanager/1.32.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-resourcemanager/1.33.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/java-vertexai/.repo-metadata.json b/java-vertexai/.repo-metadata.json new file mode 100644 index 000000000000..ce125aa5663f --- /dev/null +++ b/java-vertexai/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "vertexai", + "name_pretty": "VertexAI API", + "product_documentation": "https://cloud.google.com/vertex-ai/docs", + "api_description": "Vertex AI is an integrated suite of machine learning tools and services for building and using ML models with AutoML or custom code. It offers both novices and experts the best workbench for the entire machine learning development lifecycle.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-vertexai/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/java-vertexai", + "repo_short": "java-vertexai", + "distribution_name": "com.google.cloud:google-cloud-vertexai", + "api_id": "vertexai.googleapis.com", + "library_type": "GAPIC_COMBO", + "requires_billing": true +} diff --git a/java-vertexai/README.md b/java-vertexai/README.md new file mode 100644 index 000000000000..dd6e14737147 --- /dev/null +++ b/java-vertexai/README.md @@ -0,0 +1,13 @@ +# Vertex AI Java SDK + +> [!IMPORTANT] +> Thanks for your interest in the Vertex AI SDKs! **You can start using this SDK and its samples on December 13, 2023.** Until then, check out our [blog post](https://blog.google/technology/ai/google-gemini-ai/) to learn more about Google's Gemini multimodal model. + +The Vertex AI SDK enables developers to use Google's state-of-the-art generative AI models (like Gemini) to build AI-powered features and applications. + +*More details and information coming soon!* + +## License + +Apache 2.0 - See [LICENSE] for more information. + diff --git a/java-vertexai/google-cloud-vertexai-bom/pom.xml b/java-vertexai/google-cloud-vertexai-bom/pom.xml new file mode 100644 index 000000000000..3bb85f831c26 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.cloud + google-cloud-vertexai-bom + 0.1.0-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.26.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google VertexAI API BOM + + BOM for VertexAI API + + + + true + + + + + + com.google.cloud + google-cloud-vertexai + 0.1.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-vertexai-v1beta1 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-vertexai-v1beta1 + 0.1.0-SNAPSHOT + + + + diff --git a/java-vertexai/google-cloud-vertexai/pom.xml b/java-vertexai/google-cloud-vertexai/pom.xml new file mode 100644 index 000000000000..43b85b3f41dc --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/pom.xml @@ -0,0 +1,123 @@ + + + 4.0.0 + com.google.cloud + google-cloud-vertexai + 0.1.0-SNAPSHOT + jar + Google VertexAI API + VertexAI API Vertex AI is an integrated suite of machine learning tools and services for building and using ML models with AutoML or custom code. It offers both novices and experts the best workbench for the entire machine learning development lifecycle. + + com.google.cloud + google-cloud-vertexai-parent + 0.1.0-SNAPSHOT + + + google-cloud-vertexai + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-vertexai-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + org.mockito + mockito-core + test + + + com.google.truth + truth + test + + + + com.google.api.grpc + grpc-google-cloud-vertexai-v1beta1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/Transport.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/Transport.java new file mode 100644 index 000000000000..6237100c3c07 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/Transport.java @@ -0,0 +1,23 @@ +/* + * 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; + +/** Transport used for sending request */ +public enum Transport { + REST, + GRPC +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/VertexAI.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/VertexAI.java new file mode 100644 index 000000000000..2fa5033dcafb --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/VertexAI.java @@ -0,0 +1,177 @@ +/* + * 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; + +import com.google.auth.oauth2.GoogleCredentials; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.PredictionServiceSettings; +import java.io.IOException; + +/** + * This class holds default settings and credentials to make Vertex AI API calls. + * + *

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: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

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 createEndpointAsync( + LocationName parent, Endpoint endpoint) { + CreateEndpointRequest request = + CreateEndpointRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setEndpoint(endpoint) + .build(); + return createEndpointAsync(request); + } + + // 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()) {
+   *   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 createEndpointAsync( + String parent, Endpoint endpoint) { + CreateEndpointRequest request = + CreateEndpointRequest.newBuilder().setParent(parent).setEndpoint(endpoint).build(); + return createEndpointAsync(request); + } + + // 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();
+   *   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 createEndpointAsync( + LocationName parent, Endpoint endpoint, String endpointId) { + CreateEndpointRequest request = + CreateEndpointRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setEndpoint(endpoint) + .setEndpointId(endpointId) + .build(); + return createEndpointAsync(request); + } + + // 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()) {
+   *   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. + *

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 createEndpointAsync( + String parent, Endpoint endpoint, String endpointId) { + CreateEndpointRequest request = + CreateEndpointRequest.newBuilder() + .setParent(parent) + .setEndpoint(endpoint) + .setEndpointId(endpointId) + .build(); + return createEndpointAsync(request); + } + + // 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()) {
+   *   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 createEndpointAsync( + CreateEndpointRequest request) { + return createEndpointOperationCallable().futureCall(request); + } + + // 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()) {
+   *   CreateEndpointRequest request =
+   *       CreateEndpointRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .setEndpointId("endpointId-1837754992")
+   *           .build();
+   *   OperationFuture future =
+   *       endpointServiceClient.createEndpointOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Endpoint response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createEndpointOperationCallable() { + return stub.createEndpointOperationCallable(); + } + + // 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()) {
+   *   CreateEndpointRequest request =
+   *       CreateEndpointRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .setEndpointId("endpointId-1837754992")
+   *           .build();
+   *   ApiFuture future =
+   *       endpointServiceClient.createEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createEndpointCallable() { + return stub.createEndpointCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets 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()) {
+   *   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. + * + *

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 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. + * + *

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()) {
+   *   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. + * + *

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()) {
+   *   GetEndpointRequest request =
+   *       GetEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = endpointServiceClient.getEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   Endpoint response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getEndpointCallable() { + return stub.getEndpointCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Endpoints in a Location. + * + *

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]");
+   *   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. + * + *

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();
+   *   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. + * + *

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()) {
+   *   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. + * + *

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()) {
+   *   ListEndpointsRequest request =
+   *       ListEndpointsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setReadMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       endpointServiceClient.listEndpointsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Endpoint element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listEndpointsPagedCallable() { + return stub.listEndpointsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Endpoints in a Location. + * + *

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()) {
+   *   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 listEndpointsCallable() { + return stub.listEndpointsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates 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()) {
+   *   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. + * + *

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()) {
+   *   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. + * + *

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()) {
+   *   UpdateEndpointRequest request =
+   *       UpdateEndpointRequest.newBuilder()
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       endpointServiceClient.updateEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   Endpoint response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateEndpointCallable() { + return stub.updateEndpointCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes 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()) {
+   *   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 deleteEndpointAsync( + EndpointName name) { + DeleteEndpointRequest request = + DeleteEndpointRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteEndpointAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes 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()) {
+   *   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 deleteEndpointAsync(String name) { + DeleteEndpointRequest request = DeleteEndpointRequest.newBuilder().setName(name).build(); + return deleteEndpointAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes 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()) {
+   *   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 deleteEndpointAsync( + DeleteEndpointRequest request) { + return deleteEndpointOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes 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()) {
+   *   DeleteEndpointRequest request =
+   *       DeleteEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       endpointServiceClient.deleteEndpointOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteEndpointOperationCallable() { + return stub.deleteEndpointOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes 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()) {
+   *   DeleteEndpointRequest request =
+   *       DeleteEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       endpointServiceClient.deleteEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteEndpointCallable() { + return stub.deleteEndpointCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys a Model into this Endpoint, creating a DeployedModel within it. + * + *

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()) {
+   *   EndpointName endpoint =
+   *       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+   *   DeployedModel deployedModel = DeployedModel.newBuilder().build();
+   *   Map trafficSplit = new HashMap<>();
+   *   DeployModelResponse response =
+   *       endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get();
+   * }
+   * }
+ * + * @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. + *

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 deployModelAsync( + EndpointName endpoint, DeployedModel deployedModel, Map trafficSplit) { + DeployModelRequest request = + DeployModelRequest.newBuilder() + .setEndpoint(endpoint == null ? null : endpoint.toString()) + .setDeployedModel(deployedModel) + .putAllTrafficSplit(trafficSplit) + .build(); + return deployModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys a Model into this Endpoint, creating a DeployedModel within it. + * + *

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 endpoint =
+   *       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *           .toString();
+   *   DeployedModel deployedModel = DeployedModel.newBuilder().build();
+   *   Map trafficSplit = new HashMap<>();
+   *   DeployModelResponse response =
+   *       endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get();
+   * }
+   * }
+ * + * @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. + *

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 deployModelAsync( + String endpoint, DeployedModel deployedModel, Map trafficSplit) { + DeployModelRequest request = + DeployModelRequest.newBuilder() + .setEndpoint(endpoint) + .setDeployedModel(deployedModel) + .putAllTrafficSplit(trafficSplit) + .build(); + return deployModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys a Model into this Endpoint, creating a DeployedModel within it. + * + *

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()) {
+   *   DeployModelRequest request =
+   *       DeployModelRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setDeployedModel(DeployedModel.newBuilder().build())
+   *           .putAllTrafficSplit(new HashMap())
+   *           .build();
+   *   DeployModelResponse response = endpointServiceClient.deployModelAsync(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 deployModelAsync( + DeployModelRequest request) { + return deployModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys a Model into this Endpoint, creating a DeployedModel within it. + * + *

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()) {
+   *   DeployModelRequest request =
+   *       DeployModelRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setDeployedModel(DeployedModel.newBuilder().build())
+   *           .putAllTrafficSplit(new HashMap())
+   *           .build();
+   *   OperationFuture future =
+   *       endpointServiceClient.deployModelOperationCallable().futureCall(request);
+   *   // Do something.
+   *   DeployModelResponse response = future.get();
+   * }
+   * }
+ */ + 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. + * + *

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()) {
+   *   DeployModelRequest request =
+   *       DeployModelRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setDeployedModel(DeployedModel.newBuilder().build())
+   *           .putAllTrafficSplit(new HashMap())
+   *           .build();
+   *   ApiFuture future = endpointServiceClient.deployModelCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deployModelCallable() { + return stub.deployModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and freeing all resources + * it's using. + * + *

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()) {
+   *   EndpointName endpoint =
+   *       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+   *   String deployedModelId = "deployedModelId-1817547906";
+   *   Map trafficSplit = new HashMap<>();
+   *   UndeployModelResponse response =
+   *       endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get();
+   * }
+   * }
+ * + * @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 + undeployModelAsync( + EndpointName endpoint, String deployedModelId, Map trafficSplit) { + UndeployModelRequest request = + UndeployModelRequest.newBuilder() + .setEndpoint(endpoint == null ? null : endpoint.toString()) + .setDeployedModelId(deployedModelId) + .putAllTrafficSplit(trafficSplit) + .build(); + return undeployModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and freeing all resources + * it's using. + * + *

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 endpoint =
+   *       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *           .toString();
+   *   String deployedModelId = "deployedModelId-1817547906";
+   *   Map trafficSplit = new HashMap<>();
+   *   UndeployModelResponse response =
+   *       endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get();
+   * }
+   * }
+ * + * @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 + undeployModelAsync( + String endpoint, String deployedModelId, Map trafficSplit) { + UndeployModelRequest request = + UndeployModelRequest.newBuilder() + .setEndpoint(endpoint) + .setDeployedModelId(deployedModelId) + .putAllTrafficSplit(trafficSplit) + .build(); + return undeployModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and freeing all resources + * it's using. + * + *

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()) {
+   *   UndeployModelRequest request =
+   *       UndeployModelRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setDeployedModelId("deployedModelId-1817547906")
+   *           .putAllTrafficSplit(new HashMap())
+   *           .build();
+   *   UndeployModelResponse response = endpointServiceClient.undeployModelAsync(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 + undeployModelAsync(UndeployModelRequest request) { + return undeployModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and freeing all resources + * it's using. + * + *

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()) {
+   *   UndeployModelRequest request =
+   *       UndeployModelRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setDeployedModelId("deployedModelId-1817547906")
+   *           .putAllTrafficSplit(new HashMap())
+   *           .build();
+   *   OperationFuture future =
+   *       endpointServiceClient.undeployModelOperationCallable().futureCall(request);
+   *   // Do something.
+   *   UndeployModelResponse response = future.get();
+   * }
+   * }
+ */ + 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. + * + *

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()) {
+   *   UndeployModelRequest request =
+   *       UndeployModelRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setDeployedModelId("deployedModelId-1817547906")
+   *           .putAllTrafficSplit(new HashMap())
+   *           .build();
+   *   ApiFuture future =
+   *       endpointServiceClient.undeployModelCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable undeployModelCallable() { + return stub.undeployModelCallable(); + } + + // 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). + * + *

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()) {
+   *   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: + *
    + *
  • `min_replica_count` in either + * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or + * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources] + *
  • `max_replica_count` in either + * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or + * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources] + *
  • [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs] + *
  • `disable_container_logging` (v1 only) + *
  • `enable_container_logging` (v1beta1 only) + *
+ * + * @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 + mutateDeployedModelAsync( + EndpointName endpoint, DeployedModel deployedModel, FieldMask updateMask) { + MutateDeployedModelRequest request = + MutateDeployedModelRequest.newBuilder() + .setEndpoint(endpoint == null ? null : endpoint.toString()) + .setDeployedModel(deployedModel) + .setUpdateMask(updateMask) + .build(); + return mutateDeployedModelAsync(request); + } + + // 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). + * + *

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 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: + *
    + *
  • `min_replica_count` in either + * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or + * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources] + *
  • `max_replica_count` in either + * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or + * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources] + *
  • [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs] + *
  • `disable_container_logging` (v1 only) + *
  • `enable_container_logging` (v1beta1 only) + *
+ * + * @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 + mutateDeployedModelAsync(String endpoint, DeployedModel deployedModel, FieldMask updateMask) { + MutateDeployedModelRequest request = + MutateDeployedModelRequest.newBuilder() + .setEndpoint(endpoint) + .setDeployedModel(deployedModel) + .setUpdateMask(updateMask) + .build(); + return mutateDeployedModelAsync(request); + } + + // 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). + * + *

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()) {
+   *   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 + mutateDeployedModelAsync(MutateDeployedModelRequest request) { + return mutateDeployedModelOperationCallable().futureCall(request); + } + + // 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). + * + *

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()) {
+   *   MutateDeployedModelRequest request =
+   *       MutateDeployedModelRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setDeployedModel(DeployedModel.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       endpointServiceClient.mutateDeployedModelOperationCallable().futureCall(request);
+   *   // Do something.
+   *   MutateDeployedModelResponse response = future.get();
+   * }
+   * }
+ */ + 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). + * + *

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()) {
+   *   MutateDeployedModelRequest request =
+   *       MutateDeployedModelRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setDeployedModel(DeployedModel.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       endpointServiceClient.mutateDeployedModelCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable mutateDeployedModelCallable() { + return stub.mutateDeployedModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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()) {
+   *   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. + * + *

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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       endpointServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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()) {
+   *   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 listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

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()) {
+   *   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. + * + *

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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = endpointServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = endpointServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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. + * + *

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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = endpointServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // 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. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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())
+   *           .build();
+   *   TestIamPermissionsResponse response = endpointServiceClient.testIamPermissions(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 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. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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())
+   *           .build();
+   *   ApiFuture future =
+   *       endpointServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListEndpointsPagedResponse + extends AbstractPagedListResponse< + ListEndpointsRequest, + ListEndpointsResponse, + Endpoint, + ListEndpointsPage, + ListEndpointsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListEndpointsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListEndpointsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListEndpointsPagedResponse(ListEndpointsPage page) { + super(page, ListEndpointsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListEndpointsPage + extends AbstractPage< + ListEndpointsRequest, ListEndpointsResponse, Endpoint, ListEndpointsPage> { + + private ListEndpointsPage( + PageContext context, + ListEndpointsResponse response) { + super(context, response); + } + + private static ListEndpointsPage createEmptyPage() { + return new ListEndpointsPage(null, null); + } + + @Override + protected ListEndpointsPage createPage( + PageContext context, + ListEndpointsResponse response) { + return new ListEndpointsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListEndpointsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListEndpointsRequest, + ListEndpointsResponse, + Endpoint, + ListEndpointsPage, + ListEndpointsFixedSizeCollection> { + + private ListEndpointsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListEndpointsFixedSizeCollection createEmptyCollection() { + return new ListEndpointsFixedSizeCollection(null, 0); + } + + @Override + protected ListEndpointsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListEndpointsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/EndpointServiceSettings.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/EndpointServiceSettings.java new file mode 100644 index 000000000000..6cd419405dff --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/EndpointServiceSettings.java @@ -0,0 +1,421 @@ +/* + * 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 static com.google.cloud.vertexai.api.EndpointServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.vertexai.api.EndpointServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +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.EndpointServiceStubSettings; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link EndpointServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (aiplatform.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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
+ * 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 { + + /** Returns the object with the settings used for calls to createEndpoint. */ + public UnaryCallSettings createEndpointSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).createEndpointSettings(); + } + + /** Returns the object with the settings used for calls to createEndpoint. */ + public OperationCallSettings + createEndpointOperationSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).createEndpointOperationSettings(); + } + + /** Returns the object with the settings used for calls to getEndpoint. */ + public UnaryCallSettings getEndpointSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).getEndpointSettings(); + } + + /** Returns the object with the settings used for calls to listEndpoints. */ + public PagedCallSettings + listEndpointsSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).listEndpointsSettings(); + } + + /** Returns the object with the settings used for calls to updateEndpoint. */ + public UnaryCallSettings updateEndpointSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).updateEndpointSettings(); + } + + /** Returns the object with the settings used for calls to deleteEndpoint. */ + public UnaryCallSettings deleteEndpointSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).deleteEndpointSettings(); + } + + /** Returns the object with the settings used for calls to deleteEndpoint. */ + public OperationCallSettings + deleteEndpointOperationSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).deleteEndpointOperationSettings(); + } + + /** Returns the object with the settings used for calls to deployModel. */ + public UnaryCallSettings deployModelSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).deployModelSettings(); + } + + /** Returns the object with the settings used for calls to deployModel. */ + public OperationCallSettings< + DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata> + deployModelOperationSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).deployModelOperationSettings(); + } + + /** Returns the object with the settings used for calls to undeployModel. */ + public UnaryCallSettings undeployModelSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).undeployModelSettings(); + } + + /** Returns the object with the settings used for calls to undeployModel. */ + public OperationCallSettings< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).undeployModelOperationSettings(); + } + + /** Returns the object with the settings used for calls to mutateDeployedModel. */ + public UnaryCallSettings mutateDeployedModelSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).mutateDeployedModelSettings(); + } + + /** Returns the object with the settings used for calls to mutateDeployedModel. */ + public OperationCallSettings< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).mutateDeployedModelOperationSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((EndpointServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((EndpointServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((EndpointServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final EndpointServiceSettings create(EndpointServiceStubSettings stub) + throws IOException { + return new EndpointServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return EndpointServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return EndpointServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return EndpointServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return EndpointServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return EndpointServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return EndpointServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return EndpointServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EndpointServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected EndpointServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for EndpointServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(EndpointServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(EndpointServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(EndpointServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(EndpointServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(EndpointServiceStubSettings.newHttpJsonBuilder()); + } + + public EndpointServiceStubSettings.Builder getStubSettingsBuilder() { + return ((EndpointServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createEndpoint. */ + public UnaryCallSettings.Builder createEndpointSettings() { + return getStubSettingsBuilder().createEndpointSettings(); + } + + /** Returns the builder for the settings used for calls to createEndpoint. */ + public OperationCallSettings.Builder< + CreateEndpointRequest, Endpoint, CreateEndpointOperationMetadata> + createEndpointOperationSettings() { + return getStubSettingsBuilder().createEndpointOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getEndpoint. */ + public UnaryCallSettings.Builder getEndpointSettings() { + return getStubSettingsBuilder().getEndpointSettings(); + } + + /** Returns the builder for the settings used for calls to listEndpoints. */ + public PagedCallSettings.Builder< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse> + listEndpointsSettings() { + return getStubSettingsBuilder().listEndpointsSettings(); + } + + /** Returns the builder for the settings used for calls to updateEndpoint. */ + public UnaryCallSettings.Builder updateEndpointSettings() { + return getStubSettingsBuilder().updateEndpointSettings(); + } + + /** Returns the builder for the settings used for calls to deleteEndpoint. */ + public UnaryCallSettings.Builder deleteEndpointSettings() { + return getStubSettingsBuilder().deleteEndpointSettings(); + } + + /** Returns the builder for the settings used for calls to deleteEndpoint. */ + public OperationCallSettings.Builder + deleteEndpointOperationSettings() { + return getStubSettingsBuilder().deleteEndpointOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deployModel. */ + public UnaryCallSettings.Builder deployModelSettings() { + return getStubSettingsBuilder().deployModelSettings(); + } + + /** Returns the builder for the settings used for calls to deployModel. */ + public OperationCallSettings.Builder< + DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata> + deployModelOperationSettings() { + return getStubSettingsBuilder().deployModelOperationSettings(); + } + + /** Returns the builder for the settings used for calls to undeployModel. */ + public UnaryCallSettings.Builder undeployModelSettings() { + return getStubSettingsBuilder().undeployModelSettings(); + } + + /** Returns the builder for the settings used for calls to undeployModel. */ + public OperationCallSettings.Builder< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationSettings() { + return getStubSettingsBuilder().undeployModelOperationSettings(); + } + + /** Returns the builder for the settings used for calls to mutateDeployedModel. */ + public UnaryCallSettings.Builder + mutateDeployedModelSettings() { + return getStubSettingsBuilder().mutateDeployedModelSettings(); + } + + /** Returns the builder for the settings used for calls to mutateDeployedModel. */ + public OperationCallSettings.Builder< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationSettings() { + return getStubSettingsBuilder().mutateDeployedModelOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public EndpointServiceSettings build() throws IOException { + return new EndpointServiceSettings(this); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/PredictionServiceClient.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/PredictionServiceClient.java new file mode 100644 index 000000000000..983741ae6c7c --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/PredictionServiceClient.java @@ -0,0 +1,1653 @@ +/* + * 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.HttpBody; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +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.BidiStreamingCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +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.PredictionServiceStub; +import com.google.cloud.vertexai.api.stub.PredictionServiceStubSettings; +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.protobuf.Value; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A service for online predictions and explanations. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ *   EndpointName endpoint =
+ *       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ *   List instances = new ArrayList<>();
+ *   Value parameters = Value.newBuilder().setBoolValue(true).build();
+ *   PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters);
+ * }
+ * }
+ * + *

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: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

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: + * + *

{@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);
+ * }
+ * + *

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
+ * PredictionServiceSettings predictionServiceSettings =
+ *     PredictionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PredictionServiceClient predictionServiceClient =
+ *     PredictionServiceClient.create(predictionServiceSettings);
+ * }
+ * + *

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
+ * PredictionServiceSettings predictionServiceSettings =
+ *     PredictionServiceSettings.newHttpJsonBuilder().build();
+ * PredictionServiceClient predictionServiceClient =
+ *     PredictionServiceClient.create(predictionServiceSettings);
+ * }
+ * + *

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: + * + *

{@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 instances = new ArrayList<>();
+   *   Value parameters = Value.newBuilder().setBoolValue(true).build();
+   *   PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters);
+   * }
+   * }
+ * + * @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 instances, Value parameters) { + PredictRequest request = + PredictRequest.newBuilder() + .setEndpoint(endpoint == null ? null : endpoint.toString()) + .addAllInstances(instances) + .setParameters(parameters) + .build(); + return predict(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform an online prediction. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   String endpoint =
+   *       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *           .toString();
+   *   List instances = new ArrayList<>();
+   *   Value parameters = Value.newBuilder().setBoolValue(true).build();
+   *   PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters);
+   * }
+   * }
+ * + * @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 instances, Value parameters) { + PredictRequest request = + PredictRequest.newBuilder() + .setEndpoint(endpoint) + .addAllInstances(instances) + .setParameters(parameters) + .build(); + return predict(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform an online prediction. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   PredictRequest request =
+   *       PredictRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .addAllInstances(new ArrayList())
+   *           .setParameters(Value.newBuilder().setBoolValue(true).build())
+   *           .build();
+   *   PredictResponse response = predictionServiceClient.predict(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 PredictResponse predict(PredictRequest request) { + return predictCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform an online prediction. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   PredictRequest request =
+   *       PredictRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .addAllInstances(new ArrayList())
+   *           .setParameters(Value.newBuilder().setBoolValue(true).build())
+   *           .build();
+   *   ApiFuture future =
+   *       predictionServiceClient.predictCallable().futureCall(request);
+   *   // Do something.
+   *   PredictResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable predictCallable() { + return stub.predictCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform an online prediction with an arbitrary HTTP payload. + * + *

The response includes the following HTTP headers: + * + *

    + *
  • `X-Vertex-AI-Endpoint-Id`: ID of the [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] + * that served this prediction. + *
+ * + *
    + *
  • `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's + * [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] that served this prediction. + *
+ * + *

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 (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. + *

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: + * + *

    + *
  • `X-Vertex-AI-Endpoint-Id`: ID of the [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] + * that served this prediction. + *
+ * + *
    + *
  • `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's + * [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] that served this prediction. + *
+ * + *

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 (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. + *

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: + * + *

    + *
  • `X-Vertex-AI-Endpoint-Id`: ID of the [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] + * that served this prediction. + *
+ * + *
    + *
  • `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's + * [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] that served this prediction. + *
+ * + *

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 (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. + * + *

The response includes the following HTTP headers: + * + *

    + *
  • `X-Vertex-AI-Endpoint-Id`: ID of the [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] + * that served this prediction. + *
+ * + *
    + *
  • `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's + * [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] that served this prediction. + *
+ * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   RawPredictRequest request =
+   *       RawPredictRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setHttpBody(HttpBody.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = predictionServiceClient.rawPredictCallable().futureCall(request);
+   *   // Do something.
+   *   HttpBody response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable rawPredictCallable() { + return stub.rawPredictCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform an unary online prediction request for Vertex first-party products and frameworks. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   DirectPredictRequest request =
+   *       DirectPredictRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .addAllInputs(new ArrayList())
+   *           .setParameters(Tensor.newBuilder().build())
+   *           .build();
+   *   DirectPredictResponse response = predictionServiceClient.directPredict(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 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. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   DirectPredictRequest request =
+   *       DirectPredictRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .addAllInputs(new ArrayList())
+   *           .setParameters(Tensor.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       predictionServiceClient.directPredictCallable().futureCall(request);
+   *   // Do something.
+   *   DirectPredictResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable directPredictCallable() { + return stub.directPredictCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform an online prediction request through gRPC. + * + *

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 (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. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   DirectRawPredictRequest request =
+   *       DirectRawPredictRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setMethodName("methodName-723163380")
+   *           .setInput(ByteString.EMPTY)
+   *           .build();
+   *   ApiFuture future =
+   *       predictionServiceClient.directRawPredictCallable().futureCall(request);
+   *   // Do something.
+   *   DirectRawPredictResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + directRawPredictCallable() { + return stub.directRawPredictCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform a streaming online prediction request for Vertex first-party products and frameworks. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   BidiStream bidiStream =
+   *       predictionServiceClient.streamingPredictCallable().call();
+   *   StreamingPredictRequest request =
+   *       StreamingPredictRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .addAllInputs(new ArrayList())
+   *           .setParameters(Tensor.newBuilder().build())
+   *           .build();
+   *   bidiStream.send(request);
+   *   for (StreamingPredictResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final BidiStreamingCallable + streamingPredictCallable() { + return stub.streamingPredictCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform a server-side streaming online prediction request for Vertex LLM streaming. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   StreamingPredictRequest request =
+   *       StreamingPredictRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .addAllInputs(new ArrayList())
+   *           .setParameters(Tensor.newBuilder().build())
+   *           .build();
+   *   ServerStream stream =
+   *       predictionServiceClient.serverStreamingPredictCallable().call(request);
+   *   for (StreamingPredictResponse response : stream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final ServerStreamingCallable + serverStreamingPredictCallable() { + return stub.serverStreamingPredictCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform a streaming online prediction request through gRPC. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   BidiStream bidiStream =
+   *       predictionServiceClient.streamingRawPredictCallable().call();
+   *   StreamingRawPredictRequest request =
+   *       StreamingRawPredictRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setMethodName("methodName-723163380")
+   *           .setInput(ByteString.EMPTY)
+   *           .build();
+   *   bidiStream.send(request);
+   *   for (StreamingRawPredictResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final BidiStreamingCallable + streamingRawPredictCallable() { + return stub.streamingRawPredictCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform an online explanation. + * + *

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: + * + *

{@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 instances = new ArrayList<>();
+   *   Value parameters = Value.newBuilder().setBoolValue(true).build();
+   *   String deployedModelId = "deployedModelId-1817547906";
+   *   ExplainResponse response =
+   *       predictionServiceClient.explain(endpoint, instances, parameters, deployedModelId);
+   * }
+   * }
+ * + * @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 instances, Value parameters, String deployedModelId) { + ExplainRequest request = + ExplainRequest.newBuilder() + .setEndpoint(endpoint == null ? null : endpoint.toString()) + .addAllInstances(instances) + .setParameters(parameters) + .setDeployedModelId(deployedModelId) + .build(); + return explain(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform an online explanation. + * + *

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: + * + *

{@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 instances = new ArrayList<>();
+   *   Value parameters = Value.newBuilder().setBoolValue(true).build();
+   *   String deployedModelId = "deployedModelId-1817547906";
+   *   ExplainResponse response =
+   *       predictionServiceClient.explain(endpoint, instances, parameters, deployedModelId);
+   * }
+   * }
+ * + * @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 instances, Value parameters, String deployedModelId) { + ExplainRequest request = + ExplainRequest.newBuilder() + .setEndpoint(endpoint) + .addAllInstances(instances) + .setParameters(parameters) + .setDeployedModelId(deployedModelId) + .build(); + return explain(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform an online explanation. + * + *

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: + * + *

{@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())
+   *           .setParameters(Value.newBuilder().setBoolValue(true).build())
+   *           .setExplanationSpecOverride(ExplanationSpecOverride.newBuilder().build())
+   *           .putAllConcurrentExplanationSpecOverride(
+   *               new HashMap())
+   *           .setDeployedModelId("deployedModelId-1817547906")
+   *           .build();
+   *   ExplainResponse response = predictionServiceClient.explain(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 ExplainResponse explain(ExplainRequest request) { + return explainCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform an online explanation. + * + *

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: + * + *

{@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())
+   *           .setParameters(Value.newBuilder().setBoolValue(true).build())
+   *           .setExplanationSpecOverride(ExplanationSpecOverride.newBuilder().build())
+   *           .putAllConcurrentExplanationSpecOverride(
+   *               new HashMap())
+   *           .setDeployedModelId("deployedModelId-1817547906")
+   *           .build();
+   *   ApiFuture future =
+   *       predictionServiceClient.explainCallable().futureCall(request);
+   *   // Do something.
+   *   ExplainResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable explainCallable() { + return stub.explainCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform a token counting. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   EndpointName endpoint =
+   *       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+   *   List instances = new ArrayList<>();
+   *   CountTokensResponse response = predictionServiceClient.countTokens(endpoint, instances);
+   * }
+   * }
+ * + * @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 instances) { + CountTokensRequest request = + CountTokensRequest.newBuilder() + .setEndpoint(endpoint == null ? null : endpoint.toString()) + .addAllInstances(instances) + .build(); + return countTokens(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform a token counting. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   String endpoint =
+   *       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *           .toString();
+   *   List instances = new ArrayList<>();
+   *   CountTokensResponse response = predictionServiceClient.countTokens(endpoint, instances);
+   * }
+   * }
+ * + * @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 instances) { + CountTokensRequest request = + CountTokensRequest.newBuilder().setEndpoint(endpoint).addAllInstances(instances).build(); + return countTokens(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform a token counting. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   CountTokensRequest request =
+   *       CountTokensRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setModel("model104069929")
+   *           .addAllInstances(new ArrayList())
+   *           .addAllContents(new ArrayList())
+   *           .build();
+   *   CountTokensResponse response = predictionServiceClient.countTokens(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 CountTokensResponse countTokens(CountTokensRequest request) { + return countTokensCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Perform a token counting. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   CountTokensRequest request =
+   *       CountTokensRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setModel("model104069929")
+   *           .addAllInstances(new ArrayList())
+   *           .addAllContents(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       predictionServiceClient.countTokensCallable().futureCall(request);
+   *   // Do something.
+   *   CountTokensResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable countTokensCallable() { + return stub.countTokensCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Generate content with multimodal inputs with streaming support. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   GenerateContentRequest request =
+   *       GenerateContentRequest.newBuilder()
+   *           .setEndpoint(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setModel("model104069929")
+   *           .addAllContents(new ArrayList())
+   *           .addAllTools(new ArrayList())
+   *           .addAllSafetySettings(new ArrayList())
+   *           .setGenerationConfig(GenerationConfig.newBuilder().build())
+   *           .build();
+   *   ServerStream stream =
+   *       predictionServiceClient.streamGenerateContentCallable().call(request);
+   *   for (GenerateContentResponse response : stream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final ServerStreamingCallable + streamGenerateContentCallable() { + return stub.streamGenerateContentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (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. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       predictionServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (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 listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

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 (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. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       predictionServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

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 (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 future = predictionServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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. + * + *

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 (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = predictionServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // 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. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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())
+   *           .build();
+   *   TestIamPermissionsResponse response = predictionServiceClient.testIamPermissions(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 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. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated 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())
+   *           .build();
+   *   ApiFuture future =
+   *       predictionServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/PredictionServiceSettings.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/PredictionServiceSettings.java new file mode 100644 index 000000000000..e01a8a5526b3 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/PredictionServiceSettings.java @@ -0,0 +1,377 @@ +/* + * 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 static com.google.cloud.vertexai.api.PredictionServiceClient.ListLocationsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +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.PredictionServiceStubSettings; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link PredictionServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (aiplatform.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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: + * + *

{@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 { + + /** Returns the object with the settings used for calls to predict. */ + public UnaryCallSettings predictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).predictSettings(); + } + + /** Returns the object with the settings used for calls to rawPredict. */ + public UnaryCallSettings rawPredictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).rawPredictSettings(); + } + + /** Returns the object with the settings used for calls to directPredict. */ + public UnaryCallSettings directPredictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).directPredictSettings(); + } + + /** Returns the object with the settings used for calls to directRawPredict. */ + public UnaryCallSettings + directRawPredictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).directRawPredictSettings(); + } + + /** Returns the object with the settings used for calls to streamingPredict. */ + public StreamingCallSettings + streamingPredictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).streamingPredictSettings(); + } + + /** Returns the object with the settings used for calls to serverStreamingPredict. */ + public ServerStreamingCallSettings + serverStreamingPredictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).serverStreamingPredictSettings(); + } + + /** Returns the object with the settings used for calls to streamingRawPredict. */ + public StreamingCallSettings + streamingRawPredictSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).streamingRawPredictSettings(); + } + + /** Returns the object with the settings used for calls to explain. */ + public UnaryCallSettings explainSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).explainSettings(); + } + + /** Returns the object with the settings used for calls to countTokens. */ + public UnaryCallSettings countTokensSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).countTokensSettings(); + } + + /** Returns the object with the settings used for calls to streamGenerateContent. */ + public ServerStreamingCallSettings + streamGenerateContentSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).streamGenerateContentSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((PredictionServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((PredictionServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((PredictionServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final PredictionServiceSettings create(PredictionServiceStubSettings stub) + throws IOException { + return new PredictionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return PredictionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return PredictionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return PredictionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return PredictionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return PredictionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return PredictionServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return PredictionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PredictionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected PredictionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for PredictionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(PredictionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(PredictionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(PredictionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(PredictionServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(PredictionServiceStubSettings.newHttpJsonBuilder()); + } + + public PredictionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((PredictionServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to predict. */ + public UnaryCallSettings.Builder predictSettings() { + return getStubSettingsBuilder().predictSettings(); + } + + /** Returns the builder for the settings used for calls to rawPredict. */ + public UnaryCallSettings.Builder rawPredictSettings() { + return getStubSettingsBuilder().rawPredictSettings(); + } + + /** Returns the builder for the settings used for calls to directPredict. */ + public UnaryCallSettings.Builder + directPredictSettings() { + return getStubSettingsBuilder().directPredictSettings(); + } + + /** Returns the builder for the settings used for calls to directRawPredict. */ + public UnaryCallSettings.Builder + directRawPredictSettings() { + return getStubSettingsBuilder().directRawPredictSettings(); + } + + /** Returns the builder for the settings used for calls to streamingPredict. */ + public StreamingCallSettings.Builder + streamingPredictSettings() { + return getStubSettingsBuilder().streamingPredictSettings(); + } + + /** Returns the builder for the settings used for calls to serverStreamingPredict. */ + public ServerStreamingCallSettings.Builder + serverStreamingPredictSettings() { + return getStubSettingsBuilder().serverStreamingPredictSettings(); + } + + /** Returns the builder for the settings used for calls to streamingRawPredict. */ + public StreamingCallSettings.Builder + streamingRawPredictSettings() { + return getStubSettingsBuilder().streamingRawPredictSettings(); + } + + /** Returns the builder for the settings used for calls to explain. */ + public UnaryCallSettings.Builder explainSettings() { + return getStubSettingsBuilder().explainSettings(); + } + + /** Returns the builder for the settings used for calls to countTokens. */ + public UnaryCallSettings.Builder + countTokensSettings() { + return getStubSettingsBuilder().countTokensSettings(); + } + + /** Returns the builder for the settings used for calls to streamGenerateContent. */ + public ServerStreamingCallSettings.Builder + streamGenerateContentSettings() { + return getStubSettingsBuilder().streamGenerateContentSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public PredictionServiceSettings build() throws IOException { + return new PredictionServiceSettings(this); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/gapic_metadata.json b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/gapic_metadata.json new file mode 100644 index 000000000000..7277f77a4046 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/gapic_metadata.json @@ -0,0 +1,111 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.vertexai.v1beta1", + "libraryPackage": "com.google.cloud.vertexai.api", + "services": { + "EndpointService": { + "clients": { + "grpc": { + "libraryClient": "EndpointServiceClient", + "rpcs": { + "CreateEndpoint": { + "methods": ["createEndpointAsync", "createEndpointAsync", "createEndpointAsync", "createEndpointAsync", "createEndpointAsync", "createEndpointOperationCallable", "createEndpointCallable"] + }, + "DeleteEndpoint": { + "methods": ["deleteEndpointAsync", "deleteEndpointAsync", "deleteEndpointAsync", "deleteEndpointOperationCallable", "deleteEndpointCallable"] + }, + "DeployModel": { + "methods": ["deployModelAsync", "deployModelAsync", "deployModelAsync", "deployModelOperationCallable", "deployModelCallable"] + }, + "GetEndpoint": { + "methods": ["getEndpoint", "getEndpoint", "getEndpoint", "getEndpointCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListEndpoints": { + "methods": ["listEndpoints", "listEndpoints", "listEndpoints", "listEndpointsPagedCallable", "listEndpointsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "MutateDeployedModel": { + "methods": ["mutateDeployedModelAsync", "mutateDeployedModelAsync", "mutateDeployedModelAsync", "mutateDeployedModelOperationCallable", "mutateDeployedModelCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UndeployModel": { + "methods": ["undeployModelAsync", "undeployModelAsync", "undeployModelAsync", "undeployModelOperationCallable", "undeployModelCallable"] + }, + "UpdateEndpoint": { + "methods": ["updateEndpoint", "updateEndpoint", "updateEndpointCallable"] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "CountTokens": { + "methods": ["countTokens", "countTokens", "countTokens", "countTokensCallable"] + }, + "DirectPredict": { + "methods": ["directPredict", "directPredictCallable"] + }, + "DirectRawPredict": { + "methods": ["directRawPredict", "directRawPredictCallable"] + }, + "Explain": { + "methods": ["explain", "explain", "explain", "explainCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "Predict": { + "methods": ["predict", "predict", "predict", "predictCallable"] + }, + "RawPredict": { + "methods": ["rawPredict", "rawPredict", "rawPredict", "rawPredictCallable"] + }, + "ServerStreamingPredict": { + "methods": ["serverStreamingPredictCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "StreamGenerateContent": { + "methods": ["streamGenerateContentCallable"] + }, + "StreamingPredict": { + "methods": ["streamingPredictCallable"] + }, + "StreamingRawPredict": { + "methods": ["streamingRawPredictCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/package-info.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/package-info.java new file mode 100644 index 000000000000..eecd14739c21 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/package-info.java @@ -0,0 +1,65 @@ +/* + * 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. + */ + +/** + * A client to Vertex AI API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= EndpointServiceClient ======================= + * + *

Service Description: A service for managing Vertex AI's Endpoints. + * + *

Sample for EndpointServiceClient: + * + *

{@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);
+ * }
+ * }
+ * + *

======================= PredictionServiceClient ======================= + * + *

Service Description: A service for online predictions and explanations. + * + *

Sample for PredictionServiceClient: + * + *

{@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 instances = new ArrayList<>();
+ *   Value parameters = Value.newBuilder().setBoolValue(true).build();
+ *   PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters);
+ * }
+ * }
+ */ +@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. + * + *

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 + createEndpointOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createEndpointOperationCallable()"); + } + + public UnaryCallable createEndpointCallable() { + throw new UnsupportedOperationException("Not implemented: createEndpointCallable()"); + } + + public UnaryCallable getEndpointCallable() { + throw new UnsupportedOperationException("Not implemented: getEndpointCallable()"); + } + + public UnaryCallable + listEndpointsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listEndpointsPagedCallable()"); + } + + public UnaryCallable listEndpointsCallable() { + throw new UnsupportedOperationException("Not implemented: listEndpointsCallable()"); + } + + public UnaryCallable updateEndpointCallable() { + throw new UnsupportedOperationException("Not implemented: updateEndpointCallable()"); + } + + public OperationCallable + deleteEndpointOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteEndpointOperationCallable()"); + } + + public UnaryCallable deleteEndpointCallable() { + throw new UnsupportedOperationException("Not implemented: deleteEndpointCallable()"); + } + + public OperationCallable + deployModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deployModelOperationCallable()"); + } + + public UnaryCallable deployModelCallable() { + throw new UnsupportedOperationException("Not implemented: deployModelCallable()"); + } + + public OperationCallable< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: undeployModelOperationCallable()"); + } + + public UnaryCallable undeployModelCallable() { + throw new UnsupportedOperationException("Not implemented: undeployModelCallable()"); + } + + public OperationCallable< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: mutateDeployedModelOperationCallable()"); + } + + public UnaryCallable mutateDeployedModelCallable() { + throw new UnsupportedOperationException("Not implemented: mutateDeployedModelCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/EndpointServiceStubSettings.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/EndpointServiceStubSettings.java new file mode 100644 index 000000000000..cc9c47d0e718 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/EndpointServiceStubSettings.java @@ -0,0 +1,1015 @@ +/* + * 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.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +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.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link EndpointServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (aiplatform.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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
+ * 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 { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createEndpointSettings; + private final OperationCallSettings< + CreateEndpointRequest, Endpoint, CreateEndpointOperationMetadata> + createEndpointOperationSettings; + private final UnaryCallSettings getEndpointSettings; + private final PagedCallSettings< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse> + listEndpointsSettings; + private final UnaryCallSettings updateEndpointSettings; + private final UnaryCallSettings deleteEndpointSettings; + private final OperationCallSettings + deleteEndpointOperationSettings; + private final UnaryCallSettings deployModelSettings; + private final OperationCallSettings< + DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata> + deployModelOperationSettings; + private final UnaryCallSettings undeployModelSettings; + private final OperationCallSettings< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationSettings; + private final UnaryCallSettings + mutateDeployedModelSettings; + private final OperationCallSettings< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_ENDPOINTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEndpointsRequest injectToken(ListEndpointsRequest payload, String token) { + return ListEndpointsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEndpointsRequest injectPageSize(ListEndpointsRequest payload, int pageSize) { + return ListEndpointsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEndpointsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEndpointsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEndpointsResponse payload) { + return payload.getEndpointsList() == null + ? ImmutableList.of() + : payload.getEndpointsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse> + LIST_ENDPOINTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEndpointsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ENDPOINTS_PAGE_STR_DESC, request, context); + return ListEndpointsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createEndpoint. */ + public UnaryCallSettings createEndpointSettings() { + return createEndpointSettings; + } + + /** Returns the object with the settings used for calls to createEndpoint. */ + public OperationCallSettings + createEndpointOperationSettings() { + return createEndpointOperationSettings; + } + + /** Returns the object with the settings used for calls to getEndpoint. */ + public UnaryCallSettings getEndpointSettings() { + return getEndpointSettings; + } + + /** Returns the object with the settings used for calls to listEndpoints. */ + public PagedCallSettings + listEndpointsSettings() { + return listEndpointsSettings; + } + + /** Returns the object with the settings used for calls to updateEndpoint. */ + public UnaryCallSettings updateEndpointSettings() { + return updateEndpointSettings; + } + + /** Returns the object with the settings used for calls to deleteEndpoint. */ + public UnaryCallSettings deleteEndpointSettings() { + return deleteEndpointSettings; + } + + /** Returns the object with the settings used for calls to deleteEndpoint. */ + public OperationCallSettings + deleteEndpointOperationSettings() { + return deleteEndpointOperationSettings; + } + + /** Returns the object with the settings used for calls to deployModel. */ + public UnaryCallSettings deployModelSettings() { + return deployModelSettings; + } + + /** Returns the object with the settings used for calls to deployModel. */ + public OperationCallSettings< + DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata> + deployModelOperationSettings() { + return deployModelOperationSettings; + } + + /** Returns the object with the settings used for calls to undeployModel. */ + public UnaryCallSettings undeployModelSettings() { + return undeployModelSettings; + } + + /** Returns the object with the settings used for calls to undeployModel. */ + public OperationCallSettings< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationSettings() { + return undeployModelOperationSettings; + } + + /** Returns the object with the settings used for calls to mutateDeployedModel. */ + public UnaryCallSettings mutateDeployedModelSettings() { + return mutateDeployedModelSettings; + } + + /** Returns the object with the settings used for calls to mutateDeployedModel. */ + public OperationCallSettings< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationSettings() { + return mutateDeployedModelOperationSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public EndpointServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcEndpointServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonEndpointServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "aiplatform.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "aiplatform.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(EndpointServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(EndpointServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EndpointServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected EndpointServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createEndpointSettings = settingsBuilder.createEndpointSettings().build(); + createEndpointOperationSettings = settingsBuilder.createEndpointOperationSettings().build(); + getEndpointSettings = settingsBuilder.getEndpointSettings().build(); + listEndpointsSettings = settingsBuilder.listEndpointsSettings().build(); + updateEndpointSettings = settingsBuilder.updateEndpointSettings().build(); + deleteEndpointSettings = settingsBuilder.deleteEndpointSettings().build(); + deleteEndpointOperationSettings = settingsBuilder.deleteEndpointOperationSettings().build(); + deployModelSettings = settingsBuilder.deployModelSettings().build(); + deployModelOperationSettings = settingsBuilder.deployModelOperationSettings().build(); + undeployModelSettings = settingsBuilder.undeployModelSettings().build(); + undeployModelOperationSettings = settingsBuilder.undeployModelOperationSettings().build(); + mutateDeployedModelSettings = settingsBuilder.mutateDeployedModelSettings().build(); + mutateDeployedModelOperationSettings = + settingsBuilder.mutateDeployedModelOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for EndpointServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createEndpointSettings; + private final OperationCallSettings.Builder< + CreateEndpointRequest, Endpoint, CreateEndpointOperationMetadata> + createEndpointOperationSettings; + private final UnaryCallSettings.Builder getEndpointSettings; + private final PagedCallSettings.Builder< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse> + listEndpointsSettings; + private final UnaryCallSettings.Builder updateEndpointSettings; + private final UnaryCallSettings.Builder + deleteEndpointSettings; + private final OperationCallSettings.Builder< + DeleteEndpointRequest, Empty, DeleteOperationMetadata> + deleteEndpointOperationSettings; + private final UnaryCallSettings.Builder deployModelSettings; + private final OperationCallSettings.Builder< + DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata> + deployModelOperationSettings; + private final UnaryCallSettings.Builder undeployModelSettings; + private final OperationCallSettings.Builder< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationSettings; + private final UnaryCallSettings.Builder + mutateDeployedModelSettings; + private final OperationCallSettings.Builder< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createEndpointSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createEndpointOperationSettings = OperationCallSettings.newBuilder(); + getEndpointSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listEndpointsSettings = PagedCallSettings.newBuilder(LIST_ENDPOINTS_PAGE_STR_FACT); + updateEndpointSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteEndpointSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteEndpointOperationSettings = OperationCallSettings.newBuilder(); + deployModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deployModelOperationSettings = OperationCallSettings.newBuilder(); + undeployModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + undeployModelOperationSettings = OperationCallSettings.newBuilder(); + mutateDeployedModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + mutateDeployedModelOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createEndpointSettings, + getEndpointSettings, + listEndpointsSettings, + updateEndpointSettings, + deleteEndpointSettings, + deployModelSettings, + undeployModelSettings, + mutateDeployedModelSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(EndpointServiceStubSettings settings) { + super(settings); + + createEndpointSettings = settings.createEndpointSettings.toBuilder(); + createEndpointOperationSettings = settings.createEndpointOperationSettings.toBuilder(); + getEndpointSettings = settings.getEndpointSettings.toBuilder(); + listEndpointsSettings = settings.listEndpointsSettings.toBuilder(); + updateEndpointSettings = settings.updateEndpointSettings.toBuilder(); + deleteEndpointSettings = settings.deleteEndpointSettings.toBuilder(); + deleteEndpointOperationSettings = settings.deleteEndpointOperationSettings.toBuilder(); + deployModelSettings = settings.deployModelSettings.toBuilder(); + deployModelOperationSettings = settings.deployModelOperationSettings.toBuilder(); + undeployModelSettings = settings.undeployModelSettings.toBuilder(); + undeployModelOperationSettings = settings.undeployModelOperationSettings.toBuilder(); + mutateDeployedModelSettings = settings.mutateDeployedModelSettings.toBuilder(); + mutateDeployedModelOperationSettings = + settings.mutateDeployedModelOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createEndpointSettings, + getEndpointSettings, + listEndpointsSettings, + updateEndpointSettings, + deleteEndpointSettings, + deployModelSettings, + undeployModelSettings, + mutateDeployedModelSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listEndpointsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deployModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .undeployModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .mutateDeployedModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createEndpointOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Endpoint.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + CreateEndpointOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteEndpointOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DeleteOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deployModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(DeployModelResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + DeployModelOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .undeployModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(UndeployModelResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + UndeployModelOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .mutateDeployedModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + MutateDeployedModelResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + MutateDeployedModelOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createEndpoint. */ + public UnaryCallSettings.Builder createEndpointSettings() { + return createEndpointSettings; + } + + /** Returns the builder for the settings used for calls to createEndpoint. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateEndpointRequest, Endpoint, CreateEndpointOperationMetadata> + createEndpointOperationSettings() { + return createEndpointOperationSettings; + } + + /** Returns the builder for the settings used for calls to getEndpoint. */ + public UnaryCallSettings.Builder getEndpointSettings() { + return getEndpointSettings; + } + + /** Returns the builder for the settings used for calls to listEndpoints. */ + public PagedCallSettings.Builder< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse> + listEndpointsSettings() { + return listEndpointsSettings; + } + + /** Returns the builder for the settings used for calls to updateEndpoint. */ + public UnaryCallSettings.Builder updateEndpointSettings() { + return updateEndpointSettings; + } + + /** Returns the builder for the settings used for calls to deleteEndpoint. */ + public UnaryCallSettings.Builder deleteEndpointSettings() { + return deleteEndpointSettings; + } + + /** Returns the builder for the settings used for calls to deleteEndpoint. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteEndpointOperationSettings() { + return deleteEndpointOperationSettings; + } + + /** Returns the builder for the settings used for calls to deployModel. */ + public UnaryCallSettings.Builder deployModelSettings() { + return deployModelSettings; + } + + /** Returns the builder for the settings used for calls to deployModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata> + deployModelOperationSettings() { + return deployModelOperationSettings; + } + + /** Returns the builder for the settings used for calls to undeployModel. */ + public UnaryCallSettings.Builder undeployModelSettings() { + return undeployModelSettings; + } + + /** Returns the builder for the settings used for calls to undeployModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationSettings() { + return undeployModelOperationSettings; + } + + /** Returns the builder for the settings used for calls to mutateDeployedModel. */ + public UnaryCallSettings.Builder + mutateDeployedModelSettings() { + return mutateDeployedModelSettings; + } + + /** Returns the builder for the settings used for calls to mutateDeployedModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationSettings() { + return mutateDeployedModelOperationSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public EndpointServiceStubSettings build() throws IOException { + return new EndpointServiceStubSettings(this); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcEndpointServiceCallableFactory.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcEndpointServiceCallableFactory.java new file mode 100644 index 000000000000..60ac542bc073 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcEndpointServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the EndpointService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcEndpointServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcEndpointServiceStub.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcEndpointServiceStub.java new file mode 100644 index 000000000000..38a179c5bda6 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcEndpointServiceStub.java @@ -0,0 +1,643 @@ +/* + * 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.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +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.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the EndpointService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcEndpointServiceStub extends EndpointServiceStub { + private static final MethodDescriptor + createEndpointMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/CreateEndpoint") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateEndpointRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getEndpointMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/GetEndpoint") + .setRequestMarshaller(ProtoUtils.marshaller(GetEndpointRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Endpoint.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listEndpointsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/ListEndpoints") + .setRequestMarshaller( + ProtoUtils.marshaller(ListEndpointsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListEndpointsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateEndpointMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/UpdateEndpoint") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateEndpointRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Endpoint.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteEndpointMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/DeleteEndpoint") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteEndpointRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deployModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/DeployModel") + .setRequestMarshaller(ProtoUtils.marshaller(DeployModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + undeployModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/UndeployModel") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeployModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + mutateDeployedModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.EndpointService/MutateDeployedModel") + .setRequestMarshaller( + ProtoUtils.marshaller(MutateDeployedModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createEndpointCallable; + private final OperationCallable + createEndpointOperationCallable; + private final UnaryCallable getEndpointCallable; + private final UnaryCallable listEndpointsCallable; + private final UnaryCallable + listEndpointsPagedCallable; + private final UnaryCallable updateEndpointCallable; + private final UnaryCallable deleteEndpointCallable; + private final OperationCallable + deleteEndpointOperationCallable; + private final UnaryCallable deployModelCallable; + private final OperationCallable< + DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata> + deployModelOperationCallable; + private final UnaryCallable undeployModelCallable; + private final OperationCallable< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationCallable; + private final UnaryCallable mutateDeployedModelCallable; + private final OperationCallable< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcEndpointServiceStub create(EndpointServiceStubSettings settings) + throws IOException { + return new GrpcEndpointServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcEndpointServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcEndpointServiceStub( + EndpointServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcEndpointServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcEndpointServiceStub( + EndpointServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcEndpointServiceStub, 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 GrpcEndpointServiceStub( + EndpointServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcEndpointServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcEndpointServiceStub, 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 GrpcEndpointServiceStub( + EndpointServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createEndpointTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createEndpointMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getEndpointTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEndpointMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listEndpointsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listEndpointsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateEndpointTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateEndpointMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint.name", String.valueOf(request.getEndpoint().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteEndpointTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteEndpointMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deployModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deployModelMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + GrpcCallSettings undeployModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeployModelMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + GrpcCallSettings mutateDeployedModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(mutateDeployedModelMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createEndpointCallable = + callableFactory.createUnaryCallable( + createEndpointTransportSettings, settings.createEndpointSettings(), clientContext); + this.createEndpointOperationCallable = + callableFactory.createOperationCallable( + createEndpointTransportSettings, + settings.createEndpointOperationSettings(), + clientContext, + operationsStub); + this.getEndpointCallable = + callableFactory.createUnaryCallable( + getEndpointTransportSettings, settings.getEndpointSettings(), clientContext); + this.listEndpointsCallable = + callableFactory.createUnaryCallable( + listEndpointsTransportSettings, settings.listEndpointsSettings(), clientContext); + this.listEndpointsPagedCallable = + callableFactory.createPagedCallable( + listEndpointsTransportSettings, settings.listEndpointsSettings(), clientContext); + this.updateEndpointCallable = + callableFactory.createUnaryCallable( + updateEndpointTransportSettings, settings.updateEndpointSettings(), clientContext); + this.deleteEndpointCallable = + callableFactory.createUnaryCallable( + deleteEndpointTransportSettings, settings.deleteEndpointSettings(), clientContext); + this.deleteEndpointOperationCallable = + callableFactory.createOperationCallable( + deleteEndpointTransportSettings, + settings.deleteEndpointOperationSettings(), + clientContext, + operationsStub); + this.deployModelCallable = + callableFactory.createUnaryCallable( + deployModelTransportSettings, settings.deployModelSettings(), clientContext); + this.deployModelOperationCallable = + callableFactory.createOperationCallable( + deployModelTransportSettings, + settings.deployModelOperationSettings(), + clientContext, + operationsStub); + this.undeployModelCallable = + callableFactory.createUnaryCallable( + undeployModelTransportSettings, settings.undeployModelSettings(), clientContext); + this.undeployModelOperationCallable = + callableFactory.createOperationCallable( + undeployModelTransportSettings, + settings.undeployModelOperationSettings(), + clientContext, + operationsStub); + this.mutateDeployedModelCallable = + callableFactory.createUnaryCallable( + mutateDeployedModelTransportSettings, + settings.mutateDeployedModelSettings(), + clientContext); + this.mutateDeployedModelOperationCallable = + callableFactory.createOperationCallable( + mutateDeployedModelTransportSettings, + settings.mutateDeployedModelOperationSettings(), + clientContext, + operationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createEndpointCallable() { + return createEndpointCallable; + } + + @Override + public OperationCallable + createEndpointOperationCallable() { + return createEndpointOperationCallable; + } + + @Override + public UnaryCallable getEndpointCallable() { + return getEndpointCallable; + } + + @Override + public UnaryCallable listEndpointsCallable() { + return listEndpointsCallable; + } + + @Override + public UnaryCallable + listEndpointsPagedCallable() { + return listEndpointsPagedCallable; + } + + @Override + public UnaryCallable updateEndpointCallable() { + return updateEndpointCallable; + } + + @Override + public UnaryCallable deleteEndpointCallable() { + return deleteEndpointCallable; + } + + @Override + public OperationCallable + deleteEndpointOperationCallable() { + return deleteEndpointOperationCallable; + } + + @Override + public UnaryCallable deployModelCallable() { + return deployModelCallable; + } + + @Override + public OperationCallable + deployModelOperationCallable() { + return deployModelOperationCallable; + } + + @Override + public UnaryCallable undeployModelCallable() { + return undeployModelCallable; + } + + @Override + public OperationCallable< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationCallable() { + return undeployModelOperationCallable; + } + + @Override + public UnaryCallable mutateDeployedModelCallable() { + return mutateDeployedModelCallable; + } + + @Override + public OperationCallable< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationCallable() { + return mutateDeployedModelOperationCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcPredictionServiceCallableFactory.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcPredictionServiceCallableFactory.java new file mode 100644 index 000000000000..e2cc4c77a9bd --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcPredictionServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the PredictionService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcPredictionServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcPredictionServiceStub.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcPredictionServiceStub.java new file mode 100644 index 000000000000..35f9f1fe0f04 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcPredictionServiceStub.java @@ -0,0 +1,623 @@ +/* + * 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.PredictionServiceClient.ListLocationsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +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.CountTokensRequest; +import com.google.cloud.vertexai.api.CountTokensResponse; +import com.google.cloud.vertexai.api.DirectPredictRequest; +import com.google.cloud.vertexai.api.DirectPredictResponse; +import com.google.cloud.vertexai.api.DirectRawPredictRequest; +import com.google.cloud.vertexai.api.DirectRawPredictResponse; +import com.google.cloud.vertexai.api.ExplainRequest; +import com.google.cloud.vertexai.api.ExplainResponse; +import com.google.cloud.vertexai.api.GenerateContentRequest; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.PredictRequest; +import com.google.cloud.vertexai.api.PredictResponse; +import com.google.cloud.vertexai.api.RawPredictRequest; +import com.google.cloud.vertexai.api.StreamingPredictRequest; +import com.google.cloud.vertexai.api.StreamingPredictResponse; +import com.google.cloud.vertexai.api.StreamingRawPredictRequest; +import com.google.cloud.vertexai.api.StreamingRawPredictResponse; +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.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the PredictionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcPredictionServiceStub extends PredictionServiceStub { + private static final MethodDescriptor predictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.PredictionService/Predict") + .setRequestMarshaller(ProtoUtils.marshaller(PredictRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PredictResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor rawPredictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.PredictionService/RawPredict") + .setRequestMarshaller(ProtoUtils.marshaller(RawPredictRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + directPredictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.PredictionService/DirectPredict") + .setRequestMarshaller( + ProtoUtils.marshaller(DirectPredictRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(DirectPredictResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + directRawPredictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.PredictionService/DirectRawPredict") + .setRequestMarshaller( + ProtoUtils.marshaller(DirectRawPredictRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(DirectRawPredictResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + streamingPredictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.PredictionService/StreamingPredict") + .setRequestMarshaller( + ProtoUtils.marshaller(StreamingPredictRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingPredictResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + serverStreamingPredictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.PredictionService/ServerStreamingPredict") + .setRequestMarshaller( + ProtoUtils.marshaller(StreamingPredictRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingPredictResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + streamingRawPredictMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.PredictionService/StreamingRawPredict") + .setRequestMarshaller( + ProtoUtils.marshaller(StreamingRawPredictRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingRawPredictResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor explainMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.PredictionService/Explain") + .setRequestMarshaller(ProtoUtils.marshaller(ExplainRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ExplainResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + countTokensMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.PredictionService/CountTokens") + .setRequestMarshaller(ProtoUtils.marshaller(CountTokensRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CountTokensResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + streamGenerateContentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.PredictionService/StreamGenerateContent") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateContentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateContentResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable predictCallable; + private final UnaryCallable rawPredictCallable; + private final UnaryCallable directPredictCallable; + private final UnaryCallable + directRawPredictCallable; + private final BidiStreamingCallable + streamingPredictCallable; + private final ServerStreamingCallable + serverStreamingPredictCallable; + private final BidiStreamingCallable + streamingRawPredictCallable; + private final UnaryCallable explainCallable; + private final UnaryCallable countTokensCallable; + private final ServerStreamingCallable + streamGenerateContentCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcPredictionServiceStub create(PredictionServiceStubSettings settings) + throws IOException { + return new GrpcPredictionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcPredictionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcPredictionServiceStub( + PredictionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcPredictionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcPredictionServiceStub( + PredictionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcPredictionServiceStub, 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 GrpcPredictionServiceStub( + PredictionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcPredictionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcPredictionServiceStub, 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 GrpcPredictionServiceStub( + PredictionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings predictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(predictMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + GrpcCallSettings rawPredictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rawPredictMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + GrpcCallSettings directPredictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(directPredictMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + GrpcCallSettings + directRawPredictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(directRawPredictMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + GrpcCallSettings + streamingPredictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamingPredictMethodDescriptor) + .build(); + GrpcCallSettings + serverStreamingPredictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(serverStreamingPredictMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + GrpcCallSettings + streamingRawPredictTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamingRawPredictMethodDescriptor) + .build(); + GrpcCallSettings explainTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(explainMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + GrpcCallSettings countTokensTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(countTokensMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + GrpcCallSettings + streamGenerateContentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamGenerateContentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("model", String.valueOf(request.getModel())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.predictCallable = + callableFactory.createUnaryCallable( + predictTransportSettings, settings.predictSettings(), clientContext); + this.rawPredictCallable = + callableFactory.createUnaryCallable( + rawPredictTransportSettings, settings.rawPredictSettings(), clientContext); + this.directPredictCallable = + callableFactory.createUnaryCallable( + directPredictTransportSettings, settings.directPredictSettings(), clientContext); + this.directRawPredictCallable = + callableFactory.createUnaryCallable( + directRawPredictTransportSettings, settings.directRawPredictSettings(), clientContext); + this.streamingPredictCallable = + callableFactory.createBidiStreamingCallable( + streamingPredictTransportSettings, settings.streamingPredictSettings(), clientContext); + this.serverStreamingPredictCallable = + callableFactory.createServerStreamingCallable( + serverStreamingPredictTransportSettings, + settings.serverStreamingPredictSettings(), + clientContext); + this.streamingRawPredictCallable = + callableFactory.createBidiStreamingCallable( + streamingRawPredictTransportSettings, + settings.streamingRawPredictSettings(), + clientContext); + this.explainCallable = + callableFactory.createUnaryCallable( + explainTransportSettings, settings.explainSettings(), clientContext); + this.countTokensCallable = + callableFactory.createUnaryCallable( + countTokensTransportSettings, settings.countTokensSettings(), clientContext); + this.streamGenerateContentCallable = + callableFactory.createServerStreamingCallable( + streamGenerateContentTransportSettings, + settings.streamGenerateContentSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable predictCallable() { + return predictCallable; + } + + @Override + public UnaryCallable rawPredictCallable() { + return rawPredictCallable; + } + + @Override + public UnaryCallable directPredictCallable() { + return directPredictCallable; + } + + @Override + public UnaryCallable + directRawPredictCallable() { + return directRawPredictCallable; + } + + @Override + public BidiStreamingCallable + streamingPredictCallable() { + return streamingPredictCallable; + } + + @Override + public ServerStreamingCallable + serverStreamingPredictCallable() { + return serverStreamingPredictCallable; + } + + @Override + public BidiStreamingCallable + streamingRawPredictCallable() { + return streamingRawPredictCallable; + } + + @Override + public UnaryCallable explainCallable() { + return explainCallable; + } + + @Override + public UnaryCallable countTokensCallable() { + return countTokensCallable; + } + + @Override + public ServerStreamingCallable + streamGenerateContentCallable() { + return streamGenerateContentCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonEndpointServiceCallableFactory.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonEndpointServiceCallableFactory.java new file mode 100644 index 000000000000..612a87329f77 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonEndpointServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the EndpointService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonEndpointServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonEndpointServiceStub.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonEndpointServiceStub.java new file mode 100644 index 000000000000..f1d00c3b6947 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonEndpointServiceStub.java @@ -0,0 +1,3009 @@ +/* + * 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.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +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.common.collect.ImmutableMap; +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.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the EndpointService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonEndpointServiceStub extends EndpointServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Endpoint.getDescriptor()) + .add(DeployModelOperationMetadata.getDescriptor()) + .add(Empty.getDescriptor()) + .add(DeployModelResponse.getDescriptor()) + .add(MutateDeployedModelOperationMetadata.getDescriptor()) + .add(DeleteOperationMetadata.getDescriptor()) + .add(CreateEndpointOperationMetadata.getDescriptor()) + .add(UndeployModelOperationMetadata.getDescriptor()) + .add(UndeployModelResponse.getDescriptor()) + .add(MutateDeployedModelResponse.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createEndpointMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/CreateEndpoint") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/endpoints", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "endpointId", request.getEndpointId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("endpoint", request.getEndpoint(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateEndpointRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getEndpointMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/GetEndpoint") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/endpoints/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Endpoint.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listEndpointsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/ListEndpoints") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/endpoints", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "readMask", request.getReadMask()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListEndpointsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateEndpointMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/UpdateEndpoint") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint.name=projects/*/locations/*/endpoints/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "endpoint.name", request.getEndpoint().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("endpoint", request.getEndpoint(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Endpoint.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteEndpointMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/DeleteEndpoint") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/endpoints/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteEndpointRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deployModelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/DeployModel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:deployModel", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "endpoint", request.getEndpoint()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeployModelRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + undeployModelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.EndpointService/UndeployModel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:undeployModel", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "endpoint", request.getEndpoint()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UndeployModelRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + mutateDeployedModelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.EndpointService/MutateDeployedModel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "endpoint", request.getEndpoint()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (MutateDeployedModelRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/ui/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=projects/*}/locations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/ui/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=projects/*/locations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy", + "/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy", + "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", + "/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy", + "/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy", + "/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy", + "/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy", + "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", + "/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy", + "/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy", + "/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", + "/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions", + "/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions", + "/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions", + "/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions", + "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", + "/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions", + "/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions", + "/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createEndpointCallable; + private final OperationCallable + createEndpointOperationCallable; + private final UnaryCallable getEndpointCallable; + private final UnaryCallable listEndpointsCallable; + private final UnaryCallable + listEndpointsPagedCallable; + private final UnaryCallable updateEndpointCallable; + private final UnaryCallable deleteEndpointCallable; + private final OperationCallable + deleteEndpointOperationCallable; + private final UnaryCallable deployModelCallable; + private final OperationCallable< + DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata> + deployModelOperationCallable; + private final UnaryCallable undeployModelCallable; + private final OperationCallable< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationCallable; + private final UnaryCallable mutateDeployedModelCallable; + private final OperationCallable< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonEndpointServiceStub create(EndpointServiceStubSettings settings) + throws IOException { + return new HttpJsonEndpointServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonEndpointServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonEndpointServiceStub( + EndpointServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonEndpointServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonEndpointServiceStub( + EndpointServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonEndpointServiceStub, 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 HttpJsonEndpointServiceStub( + EndpointServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonEndpointServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonEndpointServiceStub, 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 HttpJsonEndpointServiceStub( + EndpointServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/ui/{name=projects/*/locations/*/operations/*}:cancel") + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel") + .build()) + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/ui/{name=projects/*/locations/*/operations/*}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/datasets/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/extensions/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/indexes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/studies/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/schedules/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete("/v1beta1/{name=projects/*/locations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}") + .build()) + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/operations/*}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/datasets/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/extensions/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/indexes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/studies/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/schedules/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1beta1/{name=projects/*/locations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}") + .build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*}/operations") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/datasets/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/edgeDevices/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/endpoints/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/extensions/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featurestores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/customJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/indexes/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/modelMonitors/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/migratableResources/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/models/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/studies/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/ui/{name=projects/*/locations/*/schedules/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/specialistPools/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/tensorboards/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1beta1/{name=projects/*/locations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/datasets/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/extensions/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/indexes/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/modelMonitors/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/models/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/studies/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/schedules/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations") + .build()) + .build()) + .put( + "google.longrunning.Operations.WaitOperation", + HttpRule.newBuilder() + .setPost("/ui/{name=projects/*/locations/*/operations/*}:wait") + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/models/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost("/v1beta1/{name=projects/*/locations/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait") + .build()) + .build()) + .build()); + + HttpJsonCallSettings createEndpointTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createEndpointMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getEndpointTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEndpointMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listEndpointsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listEndpointsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateEndpointTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateEndpointMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint.name", String.valueOf(request.getEndpoint().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteEndpointTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteEndpointMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deployModelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deployModelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings undeployModelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(undeployModelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + mutateDeployedModelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(mutateDeployedModelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createEndpointCallable = + callableFactory.createUnaryCallable( + createEndpointTransportSettings, settings.createEndpointSettings(), clientContext); + this.createEndpointOperationCallable = + callableFactory.createOperationCallable( + createEndpointTransportSettings, + settings.createEndpointOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getEndpointCallable = + callableFactory.createUnaryCallable( + getEndpointTransportSettings, settings.getEndpointSettings(), clientContext); + this.listEndpointsCallable = + callableFactory.createUnaryCallable( + listEndpointsTransportSettings, settings.listEndpointsSettings(), clientContext); + this.listEndpointsPagedCallable = + callableFactory.createPagedCallable( + listEndpointsTransportSettings, settings.listEndpointsSettings(), clientContext); + this.updateEndpointCallable = + callableFactory.createUnaryCallable( + updateEndpointTransportSettings, settings.updateEndpointSettings(), clientContext); + this.deleteEndpointCallable = + callableFactory.createUnaryCallable( + deleteEndpointTransportSettings, settings.deleteEndpointSettings(), clientContext); + this.deleteEndpointOperationCallable = + callableFactory.createOperationCallable( + deleteEndpointTransportSettings, + settings.deleteEndpointOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deployModelCallable = + callableFactory.createUnaryCallable( + deployModelTransportSettings, settings.deployModelSettings(), clientContext); + this.deployModelOperationCallable = + callableFactory.createOperationCallable( + deployModelTransportSettings, + settings.deployModelOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.undeployModelCallable = + callableFactory.createUnaryCallable( + undeployModelTransportSettings, settings.undeployModelSettings(), clientContext); + this.undeployModelOperationCallable = + callableFactory.createOperationCallable( + undeployModelTransportSettings, + settings.undeployModelOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.mutateDeployedModelCallable = + callableFactory.createUnaryCallable( + mutateDeployedModelTransportSettings, + settings.mutateDeployedModelSettings(), + clientContext); + this.mutateDeployedModelOperationCallable = + callableFactory.createOperationCallable( + mutateDeployedModelTransportSettings, + settings.mutateDeployedModelOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createEndpointMethodDescriptor); + methodDescriptors.add(getEndpointMethodDescriptor); + methodDescriptors.add(listEndpointsMethodDescriptor); + methodDescriptors.add(updateEndpointMethodDescriptor); + methodDescriptors.add(deleteEndpointMethodDescriptor); + methodDescriptors.add(deployModelMethodDescriptor); + methodDescriptors.add(undeployModelMethodDescriptor); + methodDescriptors.add(mutateDeployedModelMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createEndpointCallable() { + return createEndpointCallable; + } + + @Override + public OperationCallable + createEndpointOperationCallable() { + return createEndpointOperationCallable; + } + + @Override + public UnaryCallable getEndpointCallable() { + return getEndpointCallable; + } + + @Override + public UnaryCallable listEndpointsCallable() { + return listEndpointsCallable; + } + + @Override + public UnaryCallable + listEndpointsPagedCallable() { + return listEndpointsPagedCallable; + } + + @Override + public UnaryCallable updateEndpointCallable() { + return updateEndpointCallable; + } + + @Override + public UnaryCallable deleteEndpointCallable() { + return deleteEndpointCallable; + } + + @Override + public OperationCallable + deleteEndpointOperationCallable() { + return deleteEndpointOperationCallable; + } + + @Override + public UnaryCallable deployModelCallable() { + return deployModelCallable; + } + + @Override + public OperationCallable + deployModelOperationCallable() { + return deployModelOperationCallable; + } + + @Override + public UnaryCallable undeployModelCallable() { + return undeployModelCallable; + } + + @Override + public OperationCallable< + UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> + undeployModelOperationCallable() { + return undeployModelOperationCallable; + } + + @Override + public UnaryCallable mutateDeployedModelCallable() { + return mutateDeployedModelCallable; + } + + @Override + public OperationCallable< + MutateDeployedModelRequest, + MutateDeployedModelResponse, + MutateDeployedModelOperationMetadata> + mutateDeployedModelOperationCallable() { + return mutateDeployedModelOperationCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonPredictionServiceCallableFactory.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonPredictionServiceCallableFactory.java new file mode 100644 index 000000000000..9891f5d47e81 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonPredictionServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the PredictionService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonPredictionServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonPredictionServiceStub.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonPredictionServiceStub.java new file mode 100644 index 000000000000..68b4547307cf --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonPredictionServiceStub.java @@ -0,0 +1,997 @@ +/* + * 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.PredictionServiceClient.ListLocationsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +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.CountTokensRequest; +import com.google.cloud.vertexai.api.CountTokensResponse; +import com.google.cloud.vertexai.api.DirectPredictRequest; +import com.google.cloud.vertexai.api.DirectPredictResponse; +import com.google.cloud.vertexai.api.DirectRawPredictRequest; +import com.google.cloud.vertexai.api.DirectRawPredictResponse; +import com.google.cloud.vertexai.api.ExplainRequest; +import com.google.cloud.vertexai.api.ExplainResponse; +import com.google.cloud.vertexai.api.GenerateContentRequest; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.PredictRequest; +import com.google.cloud.vertexai.api.PredictResponse; +import com.google.cloud.vertexai.api.RawPredictRequest; +import com.google.cloud.vertexai.api.StreamingPredictRequest; +import com.google.cloud.vertexai.api.StreamingPredictResponse; +import com.google.cloud.vertexai.api.StreamingRawPredictRequest; +import com.google.cloud.vertexai.api.StreamingRawPredictResponse; +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.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the PredictionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonPredictionServiceStub extends PredictionServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + predictMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.PredictionService/Predict") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:predict", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "endpoint", request.getEndpoint()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PredictResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor rawPredictMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.PredictionService/RawPredict") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "endpoint", request.getEndpoint()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(HttpBody.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + directPredictMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.PredictionService/DirectPredict") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:directPredict", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "endpoint", request.getEndpoint()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DirectPredictResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + directRawPredictMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.PredictionService/DirectRawPredict") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:directRawPredict", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "endpoint", request.getEndpoint()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DirectRawPredictResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + serverStreamingPredictMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.PredictionService/ServerStreamingPredict") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:serverStreamingPredict", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "endpoint", request.getEndpoint()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:serverStreamingPredict") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamingPredictResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + explainMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.PredictionService/Explain") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:explain", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "endpoint", request.getEndpoint()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ExplainResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + countTokensMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.aiplatform.v1beta1.PredictionService/CountTokens") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:countTokens", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "endpoint", request.getEndpoint()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:countTokens") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CountTokensResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + streamGenerateContentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.PredictionService/StreamGenerateContent") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{model=projects/*/locations/*/endpoints/*}:streamGenerateContent", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "model", request.getModel()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{model=projects/*/locations/*/publishers/*/models/*}:streamGenerateContent") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearModel().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateContentResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/ui/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=projects/*}/locations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/ui/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=projects/*/locations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy", + "/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy", + "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", + "/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy", + "/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy", + "/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy", + "/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy", + "/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy", + "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", + "/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy", + "/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy", + "/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", + "/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions", + "/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions", + "/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions", + "/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions", + "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", + "/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions", + "/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions", + "/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable predictCallable; + private final UnaryCallable rawPredictCallable; + private final UnaryCallable directPredictCallable; + private final UnaryCallable + directRawPredictCallable; + private final ServerStreamingCallable + serverStreamingPredictCallable; + private final UnaryCallable explainCallable; + private final UnaryCallable countTokensCallable; + private final ServerStreamingCallable + streamGenerateContentCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonPredictionServiceStub create(PredictionServiceStubSettings settings) + throws IOException { + return new HttpJsonPredictionServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonPredictionServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonPredictionServiceStub( + PredictionServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonPredictionServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonPredictionServiceStub( + PredictionServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonPredictionServiceStub, 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 HttpJsonPredictionServiceStub( + PredictionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonPredictionServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonPredictionServiceStub, 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 HttpJsonPredictionServiceStub( + PredictionServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings predictTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(predictMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings rawPredictTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(rawPredictMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + directPredictTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(directPredictMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + directRawPredictTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(directRawPredictMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + serverStreamingPredictTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(serverStreamingPredictMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings explainTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(explainMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings countTokensTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(countTokensMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("endpoint", String.valueOf(request.getEndpoint())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + streamGenerateContentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(streamGenerateContentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("model", String.valueOf(request.getModel())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.predictCallable = + callableFactory.createUnaryCallable( + predictTransportSettings, settings.predictSettings(), clientContext); + this.rawPredictCallable = + callableFactory.createUnaryCallable( + rawPredictTransportSettings, settings.rawPredictSettings(), clientContext); + this.directPredictCallable = + callableFactory.createUnaryCallable( + directPredictTransportSettings, settings.directPredictSettings(), clientContext); + this.directRawPredictCallable = + callableFactory.createUnaryCallable( + directRawPredictTransportSettings, settings.directRawPredictSettings(), clientContext); + this.serverStreamingPredictCallable = + callableFactory.createServerStreamingCallable( + serverStreamingPredictTransportSettings, + settings.serverStreamingPredictSettings(), + clientContext); + this.explainCallable = + callableFactory.createUnaryCallable( + explainTransportSettings, settings.explainSettings(), clientContext); + this.countTokensCallable = + callableFactory.createUnaryCallable( + countTokensTransportSettings, settings.countTokensSettings(), clientContext); + this.streamGenerateContentCallable = + callableFactory.createServerStreamingCallable( + streamGenerateContentTransportSettings, + settings.streamGenerateContentSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(predictMethodDescriptor); + methodDescriptors.add(rawPredictMethodDescriptor); + methodDescriptors.add(directPredictMethodDescriptor); + methodDescriptors.add(directRawPredictMethodDescriptor); + methodDescriptors.add(serverStreamingPredictMethodDescriptor); + methodDescriptors.add(explainMethodDescriptor); + methodDescriptors.add(countTokensMethodDescriptor); + methodDescriptors.add(streamGenerateContentMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable predictCallable() { + return predictCallable; + } + + @Override + public UnaryCallable rawPredictCallable() { + return rawPredictCallable; + } + + @Override + public UnaryCallable directPredictCallable() { + return directPredictCallable; + } + + @Override + public UnaryCallable + directRawPredictCallable() { + return directRawPredictCallable; + } + + @Override + public ServerStreamingCallable + serverStreamingPredictCallable() { + return serverStreamingPredictCallable; + } + + @Override + public UnaryCallable explainCallable() { + return explainCallable; + } + + @Override + public UnaryCallable countTokensCallable() { + return countTokensCallable; + } + + @Override + public ServerStreamingCallable + streamGenerateContentCallable() { + return streamGenerateContentCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public BidiStreamingCallable + streamingPredictCallable() { + throw new UnsupportedOperationException( + "Not implemented: streamingPredictCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public BidiStreamingCallable + streamingRawPredictCallable() { + throw new UnsupportedOperationException( + "Not implemented: streamingRawPredictCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/PredictionServiceStub.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/PredictionServiceStub.java new file mode 100644 index 000000000000..2b4fb2a6c944 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/PredictionServiceStub.java @@ -0,0 +1,136 @@ +/* + * 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.PredictionServiceClient.ListLocationsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +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.CountTokensRequest; +import com.google.cloud.vertexai.api.CountTokensResponse; +import com.google.cloud.vertexai.api.DirectPredictRequest; +import com.google.cloud.vertexai.api.DirectPredictResponse; +import com.google.cloud.vertexai.api.DirectRawPredictRequest; +import com.google.cloud.vertexai.api.DirectRawPredictResponse; +import com.google.cloud.vertexai.api.ExplainRequest; +import com.google.cloud.vertexai.api.ExplainResponse; +import com.google.cloud.vertexai.api.GenerateContentRequest; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.PredictRequest; +import com.google.cloud.vertexai.api.PredictResponse; +import com.google.cloud.vertexai.api.RawPredictRequest; +import com.google.cloud.vertexai.api.StreamingPredictRequest; +import com.google.cloud.vertexai.api.StreamingPredictResponse; +import com.google.cloud.vertexai.api.StreamingRawPredictRequest; +import com.google.cloud.vertexai.api.StreamingRawPredictResponse; +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 javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the PredictionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class PredictionServiceStub implements BackgroundResource { + + public UnaryCallable predictCallable() { + throw new UnsupportedOperationException("Not implemented: predictCallable()"); + } + + public UnaryCallable rawPredictCallable() { + throw new UnsupportedOperationException("Not implemented: rawPredictCallable()"); + } + + public UnaryCallable directPredictCallable() { + throw new UnsupportedOperationException("Not implemented: directPredictCallable()"); + } + + public UnaryCallable + directRawPredictCallable() { + throw new UnsupportedOperationException("Not implemented: directRawPredictCallable()"); + } + + public BidiStreamingCallable + streamingPredictCallable() { + throw new UnsupportedOperationException("Not implemented: streamingPredictCallable()"); + } + + public ServerStreamingCallable + serverStreamingPredictCallable() { + throw new UnsupportedOperationException("Not implemented: serverStreamingPredictCallable()"); + } + + public BidiStreamingCallable + streamingRawPredictCallable() { + throw new UnsupportedOperationException("Not implemented: streamingRawPredictCallable()"); + } + + public UnaryCallable explainCallable() { + throw new UnsupportedOperationException("Not implemented: explainCallable()"); + } + + public UnaryCallable countTokensCallable() { + throw new UnsupportedOperationException("Not implemented: countTokensCallable()"); + } + + public ServerStreamingCallable + streamGenerateContentCallable() { + throw new UnsupportedOperationException("Not implemented: streamGenerateContentCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/PredictionServiceStubSettings.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/PredictionServiceStubSettings.java new file mode 100644 index 000000000000..e356dbaec69c --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/PredictionServiceStubSettings.java @@ -0,0 +1,745 @@ +/* + * 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.PredictionServiceClient.ListLocationsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +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.CountTokensRequest; +import com.google.cloud.vertexai.api.CountTokensResponse; +import com.google.cloud.vertexai.api.DirectPredictRequest; +import com.google.cloud.vertexai.api.DirectPredictResponse; +import com.google.cloud.vertexai.api.DirectRawPredictRequest; +import com.google.cloud.vertexai.api.DirectRawPredictResponse; +import com.google.cloud.vertexai.api.ExplainRequest; +import com.google.cloud.vertexai.api.ExplainResponse; +import com.google.cloud.vertexai.api.GenerateContentRequest; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.PredictRequest; +import com.google.cloud.vertexai.api.PredictResponse; +import com.google.cloud.vertexai.api.RawPredictRequest; +import com.google.cloud.vertexai.api.StreamingPredictRequest; +import com.google.cloud.vertexai.api.StreamingPredictResponse; +import com.google.cloud.vertexai.api.StreamingRawPredictRequest; +import com.google.cloud.vertexai.api.StreamingRawPredictResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link PredictionServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (aiplatform.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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: + * + *

{@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
+ * PredictionServiceStubSettings.Builder predictionServiceSettingsBuilder =
+ *     PredictionServiceStubSettings.newBuilder();
+ * predictionServiceSettingsBuilder
+ *     .predictSettings()
+ *     .setRetrySettings(
+ *         predictionServiceSettingsBuilder
+ *             .predictSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * PredictionServiceStubSettings predictionServiceSettings =
+ *     predictionServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class PredictionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings predictSettings; + private final UnaryCallSettings rawPredictSettings; + private final UnaryCallSettings + directPredictSettings; + private final UnaryCallSettings + directRawPredictSettings; + private final StreamingCallSettings + streamingPredictSettings; + private final ServerStreamingCallSettings + serverStreamingPredictSettings; + private final StreamingCallSettings + streamingRawPredictSettings; + private final UnaryCallSettings explainSettings; + private final UnaryCallSettings countTokensSettings; + private final ServerStreamingCallSettings + streamGenerateContentSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to predict. */ + public UnaryCallSettings predictSettings() { + return predictSettings; + } + + /** Returns the object with the settings used for calls to rawPredict. */ + public UnaryCallSettings rawPredictSettings() { + return rawPredictSettings; + } + + /** Returns the object with the settings used for calls to directPredict. */ + public UnaryCallSettings directPredictSettings() { + return directPredictSettings; + } + + /** Returns the object with the settings used for calls to directRawPredict. */ + public UnaryCallSettings + directRawPredictSettings() { + return directRawPredictSettings; + } + + /** Returns the object with the settings used for calls to streamingPredict. */ + public StreamingCallSettings + streamingPredictSettings() { + return streamingPredictSettings; + } + + /** Returns the object with the settings used for calls to serverStreamingPredict. */ + public ServerStreamingCallSettings + serverStreamingPredictSettings() { + return serverStreamingPredictSettings; + } + + /** Returns the object with the settings used for calls to streamingRawPredict. */ + public StreamingCallSettings + streamingRawPredictSettings() { + return streamingRawPredictSettings; + } + + /** Returns the object with the settings used for calls to explain. */ + public UnaryCallSettings explainSettings() { + return explainSettings; + } + + /** Returns the object with the settings used for calls to countTokens. */ + public UnaryCallSettings countTokensSettings() { + return countTokensSettings; + } + + /** Returns the object with the settings used for calls to streamGenerateContent. */ + public ServerStreamingCallSettings + streamGenerateContentSettings() { + return streamGenerateContentSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public PredictionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcPredictionServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonPredictionServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "aiplatform.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "aiplatform.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(PredictionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(PredictionServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return PredictionServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected PredictionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + predictSettings = settingsBuilder.predictSettings().build(); + rawPredictSettings = settingsBuilder.rawPredictSettings().build(); + directPredictSettings = settingsBuilder.directPredictSettings().build(); + directRawPredictSettings = settingsBuilder.directRawPredictSettings().build(); + streamingPredictSettings = settingsBuilder.streamingPredictSettings().build(); + serverStreamingPredictSettings = settingsBuilder.serverStreamingPredictSettings().build(); + streamingRawPredictSettings = settingsBuilder.streamingRawPredictSettings().build(); + explainSettings = settingsBuilder.explainSettings().build(); + countTokensSettings = settingsBuilder.countTokensSettings().build(); + streamGenerateContentSettings = settingsBuilder.streamGenerateContentSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for PredictionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder predictSettings; + private final UnaryCallSettings.Builder rawPredictSettings; + private final UnaryCallSettings.Builder + directPredictSettings; + private final UnaryCallSettings.Builder + directRawPredictSettings; + private final StreamingCallSettings.Builder + streamingPredictSettings; + private final ServerStreamingCallSettings.Builder< + StreamingPredictRequest, StreamingPredictResponse> + serverStreamingPredictSettings; + private final StreamingCallSettings.Builder< + StreamingRawPredictRequest, StreamingRawPredictResponse> + streamingRawPredictSettings; + private final UnaryCallSettings.Builder explainSettings; + private final UnaryCallSettings.Builder + countTokensSettings; + private final ServerStreamingCallSettings.Builder< + GenerateContentRequest, GenerateContentResponse> + streamGenerateContentSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_9_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_9_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + predictSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rawPredictSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + directPredictSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + directRawPredictSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + streamingPredictSettings = StreamingCallSettings.newBuilder(); + serverStreamingPredictSettings = ServerStreamingCallSettings.newBuilder(); + streamingRawPredictSettings = StreamingCallSettings.newBuilder(); + explainSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + countTokensSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + streamGenerateContentSettings = ServerStreamingCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + predictSettings, + rawPredictSettings, + directPredictSettings, + directRawPredictSettings, + explainSettings, + countTokensSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(PredictionServiceStubSettings settings) { + super(settings); + + predictSettings = settings.predictSettings.toBuilder(); + rawPredictSettings = settings.rawPredictSettings.toBuilder(); + directPredictSettings = settings.directPredictSettings.toBuilder(); + directRawPredictSettings = settings.directRawPredictSettings.toBuilder(); + streamingPredictSettings = settings.streamingPredictSettings.toBuilder(); + serverStreamingPredictSettings = settings.serverStreamingPredictSettings.toBuilder(); + streamingRawPredictSettings = settings.streamingRawPredictSettings.toBuilder(); + explainSettings = settings.explainSettings.toBuilder(); + countTokensSettings = settings.countTokensSettings.toBuilder(); + streamGenerateContentSettings = settings.streamGenerateContentSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + predictSettings, + rawPredictSettings, + directPredictSettings, + directRawPredictSettings, + explainSettings, + countTokensSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .predictSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_9_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_9_params")); + + builder + .rawPredictSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .directPredictSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .directRawPredictSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .serverStreamingPredictSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .explainSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_9_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_9_params")); + + builder + .countTokensSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .streamGenerateContentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to predict. */ + public UnaryCallSettings.Builder predictSettings() { + return predictSettings; + } + + /** Returns the builder for the settings used for calls to rawPredict. */ + public UnaryCallSettings.Builder rawPredictSettings() { + return rawPredictSettings; + } + + /** Returns the builder for the settings used for calls to directPredict. */ + public UnaryCallSettings.Builder + directPredictSettings() { + return directPredictSettings; + } + + /** Returns the builder for the settings used for calls to directRawPredict. */ + public UnaryCallSettings.Builder + directRawPredictSettings() { + return directRawPredictSettings; + } + + /** Returns the builder for the settings used for calls to streamingPredict. */ + public StreamingCallSettings.Builder + streamingPredictSettings() { + return streamingPredictSettings; + } + + /** Returns the builder for the settings used for calls to serverStreamingPredict. */ + public ServerStreamingCallSettings.Builder + serverStreamingPredictSettings() { + return serverStreamingPredictSettings; + } + + /** Returns the builder for the settings used for calls to streamingRawPredict. */ + public StreamingCallSettings.Builder + streamingRawPredictSettings() { + return streamingRawPredictSettings; + } + + /** Returns the builder for the settings used for calls to explain. */ + public UnaryCallSettings.Builder explainSettings() { + return explainSettings; + } + + /** Returns the builder for the settings used for calls to countTokens. */ + public UnaryCallSettings.Builder + countTokensSettings() { + return countTokensSettings; + } + + /** Returns the builder for the settings used for calls to streamGenerateContent. */ + public ServerStreamingCallSettings.Builder + streamGenerateContentSettings() { + return streamGenerateContentSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public PredictionServiceStubSettings build() throws IOException { + return new PredictionServiceStubSettings(this); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ChatSession.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ChatSession.java new file mode 100644 index 000000000000..5e62c216d0ba --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ChatSession.java @@ -0,0 +1,302 @@ +/* + * 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.generativeai.preview; + +import static com.google.cloud.vertexai.generativeai.preview.ResponseHandler.aggregateStreamIntoResponse; +import static com.google.cloud.vertexai.generativeai.preview.ResponseHandler.getContent; + +import com.google.cloud.vertexai.api.Content; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.GenerationConfig; +import com.google.cloud.vertexai.api.SafetySetting; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** Represents a conversation between the user and the model */ +public class ChatSession { + private final GenerativeModel model; + private List history = new ArrayList<>(); + private ResponseStream currentResponseStream = null; + private GenerateContentResponse currentResponse = null; + + public ChatSession(GenerativeModel model) { + if (model == null) { + throw new IllegalArgumentException("model should not be null"); + } + this.model = model; + } + + /** + * Sends a message to the model and returns a stream of responses. + * + * @param text the message to be sent. + * @return a stream of responses. + */ + public ResponseStream sendMessageStream(String text) throws IOException { + return sendMessageStream(text, null, null); + } + + /** + * Sends a message to the model and returns a stream of responses. + * + * @param text the message to be sent. + * @param generationConfig the generation config. + * @return a stream of responses. + */ + public ResponseStream sendMessageStream( + String text, GenerationConfig generationConfig) throws IOException { + return sendMessageStream(text, generationConfig, null); + } + + /** + * Sends a message to the model and returns a stream of responses. + * + * @param text the message to be sent. + * @param safetySettings the safety settings. + * @return a stream of responses. + */ + public ResponseStream sendMessageStream( + String text, List safetySettings) throws IOException { + return sendMessageStream(text, null, safetySettings); + } + + /** + * Sends a message to the model and returns a stream of responses. + * + * @param text the message to be sent. + * @param generationConfig the generation config. + * @param safetySettings the safety settings. + * @return a stream of responses. + */ + public ResponseStream sendMessageStream( + String text, GenerationConfig generationConfig, List safetySettings) + throws IOException { + checkLastResponseAndEditHistory(); + + history.add(ContentMaker.fromString(text)); + + ResponseStream respStream = + model.generateContentStream(history, generationConfig, safetySettings); + currentResponseStream = respStream; + currentResponse = null; + return respStream; + } + + /** + * Sends a message to the model and returns a stream of responses. + * + * @param content the content to be sent. + * @return a stream of responses. + */ + public ResponseStream sendMessageStream(Content content) + throws IOException, IllegalArgumentException { + return sendMessageStream(content, null, null); + } + + /** + * Sends a message to the model and returns a stream of responses. + * + * @param content the content to be sent. + * @param generationConfig the generation config. + * @return a stream of responses. + */ + public ResponseStream sendMessageStream( + Content content, GenerationConfig generationConfig) + throws IOException, IllegalArgumentException { + return sendMessageStream(content, generationConfig, null); + } + + /** + * Sends a message to the model and returns a stream of responses. + * + * @param content the content to be sent. + * @param safetySettings the safety settings. + * @return a stream of responses. + */ + public ResponseStream sendMessageStream( + Content content, List safetySettings) + throws IOException, IllegalArgumentException { + return sendMessageStream(content, null, safetySettings); + } + + /** + * Sends a message to the model and returns a stream of responses. + * + * @param content the content to be sent. + * @param generationConfig the generation config. + * @param safetySettings the safety settings. + * @return a stream of responses. + */ + public ResponseStream sendMessageStream( + Content content, GenerationConfig generationConfig, List safetySettings) + throws IOException, IllegalArgumentException { + checkLastResponseAndEditHistory(); + if (content.getPartsCount() != 1) { + throw new IllegalArgumentException("ChatSession only allow text content in one single Part."); + } + if (!content.getParts(0).hasText()) { + throw new IllegalArgumentException("ChatSession only allow text content."); + } + + history.add(content); + ResponseStream respStream = + model.generateContentStream(history, generationConfig, safetySettings); + currentResponseStream = respStream; + currentResponse = null; + return respStream; + } + + /** + * Sends a message to the model and returns a response. + * + * @param text the message to be sent. + * @return a response. + */ + public GenerateContentResponse sendMessage(String text) throws IOException { + return sendMessage(text, null, null); + } + + /** + * Sends a message to the model and returns a response. + * + * @param text the message to be sent. + * @param generationConfig the generation config. + * @return a response. + */ + public GenerateContentResponse sendMessage(String text, GenerationConfig generationConfig) + throws IOException { + return sendMessage(text, generationConfig, null); + } + + /** + * Sends a message to the model and returns a response. + * + * @param text the message to be sent. + * @param safetySettings the safety settings. + * @return a response. + */ + public GenerateContentResponse sendMessage(String text, List safetySettings) + throws IOException { + return sendMessage(text, null, safetySettings); + } + + /** + * Sends a message to the model and returns a response. + * + * @param text the message to be sent. + * @param generationConfig the generation config. + * @param safetySettings the safety settings. + * @return a response. + */ + public GenerateContentResponse sendMessage( + String text, GenerationConfig generationConfig, List safetySettings) + throws IOException { + + checkLastResponseAndEditHistory(); + history.add(ContentMaker.fromString(text)); + GenerateContentResponse response = + model.generateContent(history, generationConfig, safetySettings); + currentResponse = response; + currentResponseStream = null; + return response; + } + + /** + * Sends a message to the model and returns a response. + * + * @param content the content to be sent. + * @return a response. + */ + public GenerateContentResponse sendMessage(Content content) throws IOException { + return sendMessage(content, null, null); + } + + /** + * Sends a message to the model and returns a response. + * + * @param content the content to be sent. + * @param generationConfig the generation config. + * @return a response. + */ + public GenerateContentResponse sendMessage(Content content, GenerationConfig generationConfig) + throws IOException { + return sendMessage(content, generationConfig, null); + } + + /** + * Sends a message to the model and returns a response. + * + * @param content the content to be sent. + * @param safetySettings the safety settings. + * @return a response. + */ + public GenerateContentResponse sendMessage(Content content, List safetySettings) + throws IOException { + return sendMessage(content, null, safetySettings); + } + + /** + * Sends a message to the model and returns a response. + * + * @param content the content to be sent. + * @param generationConfig the generation config. + * @param safetySettings the safety settings. + * @return a response. + */ + public GenerateContentResponse sendMessage( + Content content, GenerationConfig generationConfig, List safetySettings) + throws IOException { + checkLastResponseAndEditHistory(); + history.add(content); + GenerateContentResponse response = + model.generateContent(history, generationConfig, safetySettings); + currentResponse = response; + currentResponseStream = null; + return response; + } + + /** + * Checks whether the last response is available and edit the history if necessary. + * + * @throws IllegalStateException if the response stream is not finished. + */ + private void checkLastResponseAndEditHistory() throws IllegalStateException { + if (currentResponseStream == null && currentResponse == null) { + return; + } else if (currentResponseStream != null && !currentResponseStream.isConsumed()) { + throw new IllegalStateException("Response stream is not consumed"); + } else if (currentResponseStream != null && currentResponseStream.isConsumed()) { + // TODO(zhenyiqi): also checks the finish reason, if it's not STOP, throw an error + history.add(getContent(aggregateStreamIntoResponse(currentResponseStream))); + } else if (currentResponseStream == null && currentResponse != null) { + // TODO(zhenyiqi): also checks the finish reason, if it's not STOP, throw an error + history.add(getContent(currentResponse)); + currentResponse = null; + } + } + + /** + * Returns the history of the conversation. + * + * @return the history of the conversation. + */ + public List getHistory() { + checkLastResponseAndEditHistory(); + return history; + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/Constants.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/Constants.java new file mode 100644 index 000000000000..0718db0fcda9 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/Constants.java @@ -0,0 +1,28 @@ +/* + * 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.generativeai.preview; + +import com.google.common.collect.ImmutableSet; + +/** A class that holds all constants for vertexai/generativeai. */ +public final class Constants { + // Constants for GenerativeModel class + public static final ImmutableSet GENERATIVE_MODEL_NAMES = + ImmutableSet.of("gemini-pro", "gemini-pro-vision", "gemini-ultra", "gemini-ultra-vision"); + + private Constants() {} +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ContentMaker.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ContentMaker.java new file mode 100644 index 000000000000..4f8c699bed07 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ContentMaker.java @@ -0,0 +1,114 @@ +/* + * 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.generativeai.preview; + +import com.google.cloud.vertexai.api.Content; +import com.google.cloud.vertexai.api.Part; + +/** Helper class to create content. */ +public class ContentMaker { + private static String role = "user"; + + /** + * Create a ContentMakerForRole for a given role. + * + * @param role Currently accepted role values are: "user", "model". No need to call forRole for + * the "user" role since it's the default role. + */ + public static ContentMakerForRole forRole(String role) { + return new ContentMakerForRole(role); + } + + private static Content fromStringWithRole(String role, String text) { + return Content.newBuilder().addParts(Part.newBuilder().setText(text)).setRole(role).build(); + } + + private static Content fromMultiModalDataWithRole(String role, Object... multiModalData) { + Content.Builder contentBuilder = Content.newBuilder().setRole(role); + for (Object partData : multiModalData) { + if (partData instanceof String) { + String textData = (String) partData; + contentBuilder.addParts(Part.newBuilder().setText(textData)); + } else if (partData instanceof Part) { + contentBuilder.addParts((Part) partData); + } else { + throw new IllegalArgumentException("Unsupported data type: " + partData.getClass()); + } + } + return contentBuilder.build(); + } + + /** + * Create a content from a string, assuming the role is "user". + * + *

The resulting content will contain one single {@link com.google.cloud.vertexai.api.Part} + * with its text field set. + * + *

To create a text content for "model", use `ContentMaker.forRole("model").fromString(text); + */ + public static Content fromString(String text) { + return fromStringWithRole(role, text); + } + + /** + * Create a content from an array of Objects, assuming the role is "user". + * + *

The resulting content can contain multiple {@link com.google.cloud.vertexai.api.Part}s. Each + * element in the array becomes one part. + * + *

To create a non-text modality content for any other + * + * @param multiModalData an array which contains the actual payload of each part. The element + * could be either a single String or a Part. When it's a single string, it's converted to a + * {@link com.google.cloud.vertexai.api.Part} that has the Text field set. + */ + public static Content fromMultiModalData(Object... multiModalData) { + return fromMultiModalDataWithRole(role, multiModalData); + } + + /** + * Helper class to create content for a given role. Instantiated by ContentMaker.forRole("role"). + */ + public static class ContentMakerForRole { + private String role; + + private ContentMakerForRole(String role) { + this.role = role; + } + + /** + * Create a content from a string. + * + * @param text a string which will be converted to a {@link com.google.cloud.vertexai.api.Part} + * with its text field set. + */ + public Content fromString(String text) { + return fromStringWithRole(role, text); + } + + /** + * Create a content from an array of Objects. + * + * @param multiModalData an array which contains the actual payload of each part. The element + * could be either a single String or a Part. When it's a single string, it's converted to a + * {@link com.google.cloud.vertexai.api.Part} that has the Text field set. + */ + public Content fromMultiModalData(Object... multiModalData) { + return fromMultiModalDataWithRole(role, multiModalData); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/GenerativeModel.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/GenerativeModel.java new file mode 100644 index 000000000000..918ef84831a6 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/GenerativeModel.java @@ -0,0 +1,763 @@ +/* + * 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.generativeai.preview; + +import com.google.cloud.vertexai.Transport; +import com.google.cloud.vertexai.VertexAI; +import com.google.cloud.vertexai.api.Content; +import com.google.cloud.vertexai.api.CountTokensRequest; +import com.google.cloud.vertexai.api.CountTokensResponse; +import com.google.cloud.vertexai.api.GenerateContentRequest; +import com.google.cloud.vertexai.api.GenerateContentRequest.Builder; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.GenerationConfig; +import com.google.cloud.vertexai.api.Part; +import com.google.cloud.vertexai.api.SafetySetting; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** This class holds a generative model that can complete what you provided. */ +public class GenerativeModel { + private final String modelName; + private final String resourceName; + private final VertexAI vertexAi; + private GenerationConfig generationConfig = null; + private List safetySettings = null; + private Transport transport; + + /** + * Construct a GenerativeModel instance. + * + * @param modelName the name of the generative model. See {@link Constants#GENERATIVE_MODEL_NAMES} + * for all the available names + * @param vertexAI a {@link com.google.cloud.vertexai.VertexAI} that contains the default configs + * for the generative model + */ + public GenerativeModel(String modelName, VertexAI vertexAi) { + this(modelName, null, null, vertexAi, null); + } + + /** + * Construct a GenerativeModel instance. + * + * @param modelName the name of the generative model. See {@link Constants#GENERATIVE_MODEL_NAMES} + * for all the available names + * @param vertexAI a {@link com.google.cloud.vertexai.VertexAI} that contains the default configs + * for the generative model + * @param transport the {@link Transport} layer for API calls in the generative model. It + * overrides the transport setting in {@link com.google.cloud.vertexai.VertexAI} + */ + public GenerativeModel(String modelName, VertexAI vertexAi, Transport transport) { + this(modelName, null, null, vertexAi, transport); + } + + /** + * Construct a GenerativeModel instance with default generation config. + * + * @param modelName the name of the generative model. See {@link Constants#GENERATIVE_MODEL_NAMES} + * for all the available names + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance that + * will be used by default for generating response + * @param vertexAI a {@link com.google.cloud.vertexai.VertexAI} that contains the default configs + * for the generative model + */ + public GenerativeModel(String modelName, GenerationConfig generationConfig, VertexAI vertexAi) { + this(modelName, generationConfig, null, vertexAi, null); + } + + /** + * Construct a GenerativeModel instance with default generation config. + * + * @param modelName the name of the generative model. See {@link Constants#GENERATIVE_MODEL_NAMES} + * for all the available names + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance that + * will be used by default for generating response + * @param vertexAI a {@link com.google.cloud.vertexai.VertexAI} that contains the default configs + * for the generative model + * @param transport the {@link Transport} layer for API calls in the generative model. It + * overrides the transport setting in {@link com.google.cloud.vertexai.VertexAI} + */ + public GenerativeModel( + String modelName, GenerationConfig generationConfig, VertexAI vertexAi, Transport transport) { + this(modelName, generationConfig, null, vertexAi, transport); + } + + /** + * Construct a GenerativeModel instance with default safety settings. + * + * @param modelName the name of the generative model. See {@link Constants#GENERATIVE_MODEL_NAMES} + * for all the available names + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} instances + * that will be used by default for generating response + * @param vertexAI a {@link com.google.cloud.vertexai.VertexAI} that contains the default configs + * for the generative model + */ + public GenerativeModel(String modelName, List safetySettings, VertexAI vertexAi) { + this(modelName, null, safetySettings, vertexAi, null); + } + + /** + * Construct a GenerativeModel instance with default safety settings. + * + * @param modelName the name of the generative model. See {@link Constants#GENERATIVE_MODEL_NAMES} + * for all the available names + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} instances + * that will be used by default for generating response + * @param vertexAI a {@link com.google.cloud.vertexai.VertexAI} that contains the default configs + * for the generative model + * @param transport the {@link Transport} layer for API calls in the generative model. It + * overrides the transport setting in {@link com.google.cloud.vertexai.VertexAI} + */ + public GenerativeModel( + String modelName, + List safetySettings, + VertexAI vertexAi, + Transport transport) { + this(modelName, null, safetySettings, vertexAi, transport); + } + + /** + * Construct a GenerativeModel instance with default generation config and safety settings. + * + * @param modelName the name of the generative model. See {@link Constants#GENERATIVE_MODEL_NAMES} + * for all the available names + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance that + * will be used by default for generating response + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} instances + * that will be used by default for generating response + * @param vertexAI a {@link com.google.cloud.vertexai.VertexAI} that contains the default configs + * for the generative model + */ + public GenerativeModel( + String modelName, + GenerationConfig generationConfig, + List safetySettings, + VertexAI vertexAi) { + this(modelName, generationConfig, safetySettings, vertexAi, null); + } + + /** + * Construct a GenerativeModel instance with default generation config and safety settings. + * + * @param modelName the name of the generative model. See {@link Constants#GENERATIVE_MODEL_NAMES} + * for all the available names + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance that + * will be used by default for generating response + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} instances + * that will be used by default for generating response + * @param vertexAI a {@link com.google.cloud.vertexai.VertexAI} that contains the default configs + * for the generative model + * @param transport the {@link Transport} layer for API calls in the generative model. It + * overrides the transport setting in {@link com.google.cloud.vertexai.VertexAI} + */ + public GenerativeModel( + String modelName, + GenerationConfig generationConfig, + List safetySettings, + VertexAI vertexAi, + Transport transport) { + validateModelName(modelName); + this.modelName = modelName; + this.resourceName = + String.format( + "projects/%s/locations/%s/publishers/google/models/%s", + vertexAi.getProjectId(), vertexAi.getLocation(), modelName); + if (generationConfig != null) { + this.generationConfig = generationConfig; + } + if (safetySettings != null) { + this.safetySettings = new ArrayList<>(); + for (SafetySetting safetySetting : safetySettings) { + this.safetySettings.add(safetySetting); + } + } + this.vertexAi = vertexAi; + if (transport != null) { + this.transport = transport; + } else { + this.transport = vertexAi.getTransport(); + } + } + + /** + * Count tokens in a text message. + * + * @param text a text message to count tokens + * @return a {@link com.google.cloud.vertexai.api.CountTokensResponse} instance that contains the + * total tokens and total billable characters of the given list of contents + * @throws IOException if an I/O error occurs while making the API call + */ + public CountTokensResponse countTokens(String text) throws IOException { + Content content = ContentMaker.fromString(text); + CountTokensRequest.Builder requestBuilder = + CountTokensRequest.newBuilder().addAllContents(Arrays.asList(content)); + return countTokensFromBuilder(requestBuilder); + } + + /** + * Count tokens in a list of contents. + * + * @param contents a list of {@link com.google.cloud.vertexai.api.Content} to count tokens + * @return a {@link com.google.cloud.vertexai.api.CountTokensResponse} instance that contains the + * total tokens and total billable characters of the given list of contents + * @throws IOException if an I/O error occurs while making the API call + */ + public CountTokensResponse countTokens(List contents) throws IOException { + CountTokensRequest.Builder requestBuilder = + CountTokensRequest.newBuilder().addAllContents(contents); + return countTokensFromBuilder(requestBuilder); + } + + /** + * Send CountTokensRequest given a request builder. + * + * @param requestBuilder a {@link com.google.cloud.vertexai.api.CountTokensRequest.Builder} that + * contains a list of contents + * @return a {@link com.google.cloud.vertexai.api.CountTokensResponse} instance that contains the + * total tokens and total billable characters of the given list of contents + * @throws IOException if an I/O error occurs while making the API call + */ + private CountTokensResponse countTokensFromBuilder(CountTokensRequest.Builder requestBuilder) + throws IOException { + CountTokensRequest request = + requestBuilder.setEndpoint(this.resourceName).setModel(this.resourceName).build(); + if (this.transport == Transport.REST) { + return vertexAi.getPredictionServiceRestClient().countTokens(request); + } else { + return vertexAi.getPredictionServiceClient().countTokens(request); + } + } + + /** + * Generate content from generative model given a text. + * + * @param text a text message to send to the generative model + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent(String text) throws IOException { + return generateContent(text, null, null); + } + + /** + * Generate content from generative model given a text and generation config. + * + * @param text a text message to send to the generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent(String text, GenerationConfig generationConfig) + throws IOException { + return generateContent(text, generationConfig, null); + } + + /** + * Generate content from generative model given a text and safety settings. + * + * @param text a text message to send to the generative model + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent(String text, List safetySettings) + throws IOException { + return generateContent(text, null, safetySettings); + } + + /** + * Generate content from generative model given a text, generation config, and safety settings. + * + * @param text a text message to send to the generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent( + String text, GenerationConfig generationConfig, List safetySettings) + throws IOException { + Part part = Part.newBuilder().setText(text).build(); + Content content = Content.newBuilder().addParts(part).setRole("user").build(); + List contents = Arrays.asList(content); + return generateContent(contents, generationConfig, safetySettings); + } + + /** + * Generate content from this model given a list of contents. + * + * @param contents a list of {@link com.google.cloud.vertexai.api.Content} to send to the + * generative model + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent(List contents) throws IOException { + return generateContent(contents, null, null); + } + + /** + * Generate content from this model given a list of contents and generation config. + * + * @param contents a list of {@link com.google.cloud.vertexai.api.Content} to send to the + * generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent( + List contents, GenerationConfig generationConfig) throws IOException { + return generateContent(contents, generationConfig, null); + } + + /** + * Generate content from this model given a list of contents and safety settings. + * + * @param contents a list of {@link com.google.cloud.vertexai.api.Content} to send to the + * generative model + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent( + List contents, List safetySettings) throws IOException { + return generateContent(contents, null, safetySettings); + } + + /** + * Generate content from generative model given a list of contents, generation config, and safety + * settings. + * + * @param contents a list of {@link com.google.cloud.vertexai.api.Content} to send to the + * generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent( + List contents, GenerationConfig generationConfig, List safetySettings) + throws IOException { + Builder requestBuilder = GenerateContentRequest.newBuilder().addAllContents(contents); + if (generationConfig != null) { + requestBuilder.setGenerationConfig(generationConfig); + } else if (this.generationConfig != null) { + requestBuilder.setGenerationConfig(this.generationConfig); + } + if (safetySettings != null) { + requestBuilder.addAllSafetySettings(safetySettings); + } else if (this.safetySettings != null) { + requestBuilder.addAllSafetySettings(this.safetySettings); + } + return ResponseHandler.aggregateStreamIntoResponse(generateContentStream(requestBuilder)); + } + + /** + * Generate content from this model given a single content. + * + * @param content a {@link com.google.cloud.vertexai.api.Content} to send to the generative model + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent(Content content) throws IOException { + return generateContent(content, null, null); + } + + /** + * Generate content from this model given a single content and generation config. + * + * @param content a {@link com.google.cloud.vertexai.api.Content} to send to the generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent(Content content, GenerationConfig generationConfig) + throws IOException { + return generateContent(content, generationConfig, null); + } + + /** + * Generate content from this model given a single content and safety settings. + * + * @param content a {@link com.google.cloud.vertexai.api.Content} to send to the generative model + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent( + Content content, List safetySettings) throws IOException { + return generateContent(content, null, safetySettings); + } + + /** + * Generate content from generative model given a single content, generation config, and safety + * settings. + * + * @param content a {@link com.google.cloud.vertexai.api.Content} to send to the generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance that contains + * response contents and other metadata + * @throws IOException if an I/O error occurs while making the API call + */ + public GenerateContentResponse generateContent( + Content content, GenerationConfig generationConfig, List safetySettings) + throws IOException { + return generateContent(Arrays.asList(content), generationConfig, safetySettings); + } + + /** + * Generate content with streaming support from generative model given a text. + * + * @param text a text message to send to the generative model + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream(String text) + throws IOException { + return generateContentStream(text, null, null); + } + + /** + * Generate content with streaming support from generative model given a text and generation + * config. + * + * @param text a text message to send to the generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream( + String text, GenerationConfig generationConfig) throws IOException { + return generateContentStream(text, generationConfig, null); + } + + /** + * Generate content with streaming support from generative model given a text and safety settings. + * + * @param text a text message to send to the generative model + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream( + String text, List safetySettings) throws IOException { + return generateContentStream(text, null, safetySettings); + } + + /** + * Generate content with streaming support from generative model given a text, generation config, + * and safety settings. + * + * @param text a text message to send to the generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream( + String text, GenerationConfig generationConfig, List safetySettings) + throws IOException { + Part part = Part.newBuilder().setText(text).build(); + Content content = Content.newBuilder().addParts(part).setRole("user").build(); + List contents = Arrays.asList(content); + return generateContentStream(contents, generationConfig, safetySettings); + } + + /** + * Generate content with streaming support from generative model given a single Content. + * + * @param content a {@link com.google.cloud.vertexai.api.Content} to send to the generative model. + * The role of the content is "user". + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream(Content content) + throws IOException { + return generateContentStream(content, null, null); + } + + /** + * Generate content with streaming support from generative model given a single Content and + * generation config. + * + * @param content a {@link com.google.cloud.vertexai.api.Content} to send to the generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream( + Content content, GenerationConfig generationConfig) throws IOException { + return generateContentStream(content, generationConfig, null); + } + + /** + * Generate content with streaming support from generative model given a single content and safety + * settings. + * + * @param content a {@link com.google.cloud.vertexai.api.Content} to send to the generative model + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream( + Content content, List safetySettings) throws IOException { + return generateContentStream(content, null, safetySettings); + } + + /** + * Generate content with streaming support from generative model given a single content, + * generation config, and safety settings. + * + * @param content a {@link com.google.cloud.vertexai.api.Content} to send to the generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream( + Content content, GenerationConfig generationConfig, List safetySettings) + throws IOException { + return generateContentStream(Arrays.asList(content), generationConfig, safetySettings); + } + + /** + * Generate content with streaming support from generative model given a list of contents. + * + * @param contents a list of {@link com.google.cloud.vertexai.api.Content} to send to the + * generative model + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream(List contents) + throws IOException { + return generateContentStream(contents, null, null); + } + + /** + * Generate content with streaming support from generative model given a list of contents and + * generation config. + * + * @param contents a list of {@link com.google.cloud.vertexai.api.Content} to send to the + * generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream( + List contents, GenerationConfig generationConfig) throws IOException { + return generateContentStream(contents, generationConfig, null); + } + + /** + * Generate content with streaming support from generative model given a list of contents and + * safety settings. + * + * @param contents a list of {@link com.google.cloud.vertexai.api.Content} to send to the + * generative model + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream( + List contents, List safetySettings) throws IOException { + return generateContentStream(contents, null, safetySettings); + } + + /** + * Generate content with streaming support from generative model given a list of contents, + * generation config, and safety settings. + * + * @param contents a list of {@link com.google.cloud.vertexai.api.Content} to send to the + * generative model + * @param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} instance for + * generating response. {@link #getGenerationConfig} will not be used if this is set + * @param safetySettings a list of {@link com.google.cloud.vertexai.api.SafetySetting} for + * generating response. {@link #getSafetySettings} will not be used if this is set + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + public ResponseStream generateContentStream( + List contents, GenerationConfig generationConfig, List safetySettings) + throws IOException { + Builder requestBuilder = GenerateContentRequest.newBuilder().addAllContents(contents); + if (generationConfig != null) { + requestBuilder.setGenerationConfig(generationConfig); + } else if (this.generationConfig != null) { + requestBuilder.setGenerationConfig(this.generationConfig); + } + if (safetySettings != null) { + requestBuilder.addAllSafetySettings(safetySettings); + } else if (this.safetySettings != null) { + requestBuilder.addAllSafetySettings(this.safetySettings); + } + return generateContentStream(requestBuilder); + } + + /** + * A base generateContentStream method that will be used internally. + * + * @param requestBuilder a {@link com.google.cloud.vertexai.api.GenerateContentRequest.Builder} + * instance + * @return a {@link ResponseStream} that contains a streaming of {@link + * com.google.cloud.vertexai.api.GenerateContentResponse} + * @throws IOException if an I/O error occurs while making the API call + */ + private ResponseStream generateContentStream(Builder requestBuilder) + throws IOException { + GenerateContentRequest request = + requestBuilder.setEndpoint(this.resourceName).setModel(this.resourceName).build(); + ResponseStream responseStream = null; + if (this.transport == Transport.REST) { + responseStream = + new ResponseStream( + new ResponseStreamIteratorWithHistory( + vertexAi + .getPredictionServiceRestClient() + .streamGenerateContentCallable() + .call(request) + .iterator())); + } else { + responseStream = + new ResponseStream( + new ResponseStreamIteratorWithHistory( + vertexAi + .getPredictionServiceClient() + .streamGenerateContentCallable() + .call(request) + .iterator())); + } + return responseStream; + } + + /** + * Sets the value for {@link #getGenerationConfig}, which will be used by default for generating + * response. + */ + public void setGenerationConfig(GenerationConfig generationConfig) { + this.generationConfig = generationConfig; + } + + /** + * Sets the value for {@link #getSafetySettings}, which will be used by default for generating + * response. + */ + public void setSafetySettings(List safetySettings) { + this.safetySettings = new ArrayList<>(); + for (SafetySetting safetySetting : safetySettings) { + this.safetySettings.add(safetySetting); + } + } + + /** + * Sets the value for {@link #getTransport}, which defines the layer for API calls in this + * generative model. + */ + public void setTransport(Transport transport) { + this.transport = transport; + } + + /** Returns the model name of this generative model. */ + public String getModelName() { + return this.modelName; + } + + /** Returns the {@link Transport} layer for API calls in this generative model. */ + public Transport getTransport() { + return this.transport; + } + + /** + * Returns the {@link com.google.cloud.vertexai.api.GenerationConfig} of this generative model. + */ + public GenerationConfig getGenerationConfig() { + return this.generationConfig; + } + + /** + * Returns a list of {@link com.google.cloud.vertexai.api.SafetySettings} of this generative + * model. + */ + public List getSafetySettings() { + if (this.safetySettings != null) { + return Collections.unmodifiableList(this.safetySettings); + } else { + return null; + } + } + + public ChatSession startChat() { + return new ChatSession(this); + } + + /** Checks if the model name is valid. */ + private static void validateModelName(String modelName) { + if (!Constants.GENERATIVE_MODEL_NAMES.contains(modelName)) { + throw new IllegalArgumentException( + String.format( + "Invalid model name: %s. Please choose from: %s", + modelName, Constants.GENERATIVE_MODEL_NAMES)); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/PartMaker.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/PartMaker.java new file mode 100644 index 000000000000..cf7ff202abcb --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/PartMaker.java @@ -0,0 +1,90 @@ +/* + * 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.generativeai.preview; + +import com.google.cloud.vertexai.api.Blob; +import com.google.cloud.vertexai.api.FileData; +import com.google.cloud.vertexai.api.Part; +import com.google.protobuf.ByteString; +import java.net.URI; +import java.net.URL; + +/** */ +public class PartMaker { + + private PartMaker() {} + + /** + * Make a {@link com.google.cloud.vertexai.api.Part} from mimeType and data (or link to the data). + * + * @param mimeType currently accepted values are "image/png", "image/jpeg", "video/mp4", + * "video/mpeg", "video/quicktime", "video/x-msvideo", "video/x-ms-wmv", "video/x-flv" + * @param partData the following types can be accepted. + *

    + *
  • a String representing the url of the data. Resulting Part will have fileData field + * set. + *
  • a URI object. Resulting Part will have fileData field set. + *
  • a URL object. Resulting Part will have fileData field set. + *
  • byte arrays that represents the actual data. Resulting Part will have inlineData + * field set. + *
  • com.google.protobuf.ByteString that represents the actual data. Resulting Part will + * have inlineData field set. + *
+ */ + public static Part fromMimeTypeAndData(String mimeType, Object partData) { + Part part; + if (partData instanceof byte[]) { + byte[] bytes = (byte[]) partData; + ByteString byteData = ByteString.copyFrom(bytes); + part = + Part.newBuilder() + .setInlineData(Blob.newBuilder().setMimeType(mimeType).setData(byteData)) + .build(); + } else if (partData instanceof String) { + String url = (String) partData; + part = + Part.newBuilder() + .setFileData(FileData.newBuilder().setMimeType(mimeType).setFileUri(url)) + .build(); + } else if (partData instanceof URL) { + URL url = (URL) partData; + part = + Part.newBuilder() + .setFileData( + FileData.newBuilder().setMimeType(mimeType).setFileUri(partData.toString())) + .build(); + + } else if (partData instanceof URI) { + URI uri = (URI) partData; + part = + Part.newBuilder() + .setFileData(FileData.newBuilder().setMimeType(mimeType).setFileUri(uri.toString())) + .build(); + } else if (partData instanceof ByteString) { + ByteString byteData = (ByteString) partData; + part = + Part.newBuilder() + .setInlineData(Blob.newBuilder().setMimeType(mimeType).setData(byteData)) + .build(); + } else { + throw new IllegalArgumentException( + "The second element of the input List can only be one of the following format:" + + " byte[], String, URL, URI, ByteString"); + } + return part; + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ResponseHandler.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ResponseHandler.java new file mode 100644 index 000000000000..420c0a9afc9a --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ResponseHandler.java @@ -0,0 +1,171 @@ +/* + * 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.generativeai.preview; + +import com.google.cloud.vertexai.api.Candidate; +import com.google.cloud.vertexai.api.Candidate.Builder; +import com.google.cloud.vertexai.api.Candidate.FinishReason; +import com.google.cloud.vertexai.api.Citation; +import com.google.cloud.vertexai.api.CitationMetadata; +import com.google.cloud.vertexai.api.Content; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.Part; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** Helper class to handle GenerateContentResponse. */ +public class ResponseHandler { + + /** + * Get the text message in a GenerateContentResponse. + * + * @param response a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance + * @return a String that aggregates all the text parts in the response + * @throws IllegalArgumentException if the response has 0 or more than 1 candidates + */ + public static String getText(GenerateContentResponse response) { + if (response.getCandidatesCount() != 1) { + throw new IllegalArgumentException( + String.format( + "This response should have exactly 1 candidate, but it has %s.", + response.getCandidatesCount())); + } + + String text = ""; + List parts = response.getCandidates(0).getContent().getPartsList(); + for (Part part : parts) { + text += part.getText(); + } + + return text; + } + + /** + * Get the content in a GenerateContentResponse. + * + * @param response a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance + * @return the {@link com.google.cloud.vertexai.api.Content} in the response + * @throws IllegalArgumentException if the response has 0 or more than 1 candidates + */ + public static Content getContent(GenerateContentResponse response) { + if (response.getCandidatesCount() != 1) { + throw new IllegalArgumentException( + String.format( + "This response should have exactly 1 candidate, but it has %s.", + response.getCandidatesCount())); + } + + return response.getCandidates(0).getContent(); + } + + /** + * Get the finish reason in a GenerateContentResponse. + * + * @param response a {@link com.google.cloud.vertexai.api.GenerateContentResponse} instance + * @return the {@link com.google.cloud.vertexai.api.FinishReason} in the response + * @throws IllegalArgumentException if the response has 0 or more than 1 candidates + */ + public static FinishReason getFinishReason(GenerateContentResponse response) { + if (response.getCandidatesCount() != 1) { + throw new IllegalArgumentException( + String.format( + "This response should have exactly 1 candidate, but it has %s.", + response.getCandidatesCount())); + } + return response.getCandidates(0).getFinishReason(); + } + + /** Aggregate a stream of responses into a single GenerateContentResponse. */ + static GenerateContentResponse aggregateStreamIntoResponse( + ResponseStream responseStream) { + GenerateContentResponse res = GenerateContentResponse.getDefaultInstance(); + Map candidates = new HashMap<>(); + Map> aggregatedContentParts = new HashMap<>(); + Map> aggregatedCitationMetadata = new HashMap<>(); + + for (GenerateContentResponse response : responseStream) { + res = response; + for (Candidate candidate : response.getCandidatesList()) { + // Keep track of candidates by index + int index = candidate.getIndex(); + candidates.put(index, candidate); + + // Aggregates parts + if (candidate.hasContent()) { + List parts = candidate.getContent().getPartsList(); + List aggregatedParts = + aggregatedContentParts.containsKey(index) + ? aggregatedContentParts.get(index) + : new ArrayList<>(); + if (aggregatedParts.size() == 0 || parts.size() == 0) { + aggregatedParts.addAll(parts); + } else { + Part aggregatedTailPart = aggregatedParts.get(aggregatedParts.size() - 1); + Part currentResponseHeadPart = parts.get(0); + if (!aggregatedTailPart.hasText() || !currentResponseHeadPart.hasText()) { + aggregatedParts.addAll(parts); + } else { + aggregatedParts.remove(aggregatedParts.size() - 1); + aggregatedParts.add( + Part.newBuilder() + .setText(aggregatedTailPart.getText() + currentResponseHeadPart.getText()) + .build()); + aggregatedParts.addAll(parts.subList(1, parts.size())); + } + } + aggregatedContentParts.put(index, aggregatedParts); + } + + // Aggregates citations + if (candidate.hasCitationMetadata()) { + List citations = candidate.getCitationMetadata().getCitationsList(); + List aggregatedCitations = + aggregatedCitationMetadata.containsKey(index) + ? aggregatedCitationMetadata.get(index) + : new ArrayList<>(); + aggregatedCitations.addAll(citations); + aggregatedCitationMetadata.put(index, aggregatedCitations); + } + } + } + + // Update candidates with aggregated data + List aggregatedCandidates = new ArrayList<>(); + candidates.forEach( + (index, candidate) -> { + Builder candidateBuilder = candidate.toBuilder(); + if (aggregatedContentParts.containsKey(index)) { + candidateBuilder.setContent( + Content.newBuilder() + .setRole("model") + .addAllParts(aggregatedContentParts.get(index))); + } + if (aggregatedCitationMetadata.containsKey(index)) { + candidateBuilder.setCitationMetadata( + CitationMetadata.newBuilder() + .addAllCitations(aggregatedCitationMetadata.get(index))); + } + aggregatedCandidates.add(candidateBuilder.build()); + }); + + res = res.toBuilder().clearCandidates().addAllCandidates(aggregatedCandidates).build(); + + return res; + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ResponseStream.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ResponseStream.java new file mode 100644 index 000000000000..301e7fa369f8 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ResponseStream.java @@ -0,0 +1,53 @@ +/* + * 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.generativeai.preview; + +import com.google.cloud.vertexai.api.GenerateContentResponse; +import java.util.Iterator; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +/** */ +public class ResponseStream implements Iterable { + + private ResponseStreamIteratorWithHistory iteratorWithHistory; + private boolean consumingStarted = false; + + public ResponseStream(ResponseStreamIteratorWithHistory iteratorWithHistory) { + this.iteratorWithHistory = iteratorWithHistory; + } + + @Override + public Iterator iterator() throws IllegalStateException { + if (!consumingStarted) { + consumingStarted = true; + return iteratorWithHistory; + } else if (iteratorWithHistory.isConsumed()) { + return iteratorWithHistory.getHistory().iterator(); + } else { + throw new IllegalStateException("The stream is being consumed but hasn't finished."); + } + } + + public Stream stream() { + return StreamSupport.stream(this.spliterator(), false); + } + + public boolean isConsumed() { + return iteratorWithHistory.isConsumed(); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ResponseStreamIteratorWithHistory.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ResponseStreamIteratorWithHistory.java new file mode 100644 index 000000000000..2fbebe7a7a77 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/preview/ResponseStreamIteratorWithHistory.java @@ -0,0 +1,59 @@ +/* + * 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.generativeai.preview; + +import com.google.cloud.vertexai.api.GenerateContentResponse; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** */ +public class ResponseStreamIteratorWithHistory + implements Iterator { + Iterator serverStreamIterator = null; + List history = new ArrayList<>(); + private boolean consumed = false; + + public ResponseStreamIteratorWithHistory(Iterator serverStreamIterator) { + this.serverStreamIterator = serverStreamIterator; + } + + @Override + public boolean hasNext() { + boolean hasNextResponse = serverStreamIterator.hasNext(); + consumed = !hasNextResponse; + return hasNextResponse; + } + + @Override + public GenerateContentResponse next() { + GenerateContentResponse nextItem = (GenerateContentResponse) serverStreamIterator.next(); + // TODO: any interruption from the SDK side should go here (for example, if we decide to raise + // an error when the response contains prompt_feedback only, or when we found the repsonse + // triggered higher safety rating) + history.add(nextItem); + return nextItem; + } + + public List getHistory() { + return history; + } + + public boolean isConsumed() { + return consumed; + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.api/reflect-config.json b/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.api/reflect-config.json new file mode 100644 index 000000000000..151803f13059 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.api/reflect-config.json @@ -0,0 +1,3755 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpBody", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpBody$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.AcceleratorType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Attribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Attribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.AutomaticResources", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.AutomaticResources$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.AutoscalingMetricSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.AutoscalingMetricSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.AvroSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.AvroSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.BatchDedicatedResources", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.BatchDedicatedResources$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.BigQueryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.BigQueryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.BigQuerySource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.BigQuerySource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Blob", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Blob$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.BlurBaselineConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.BlurBaselineConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.BoolArray", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.BoolArray$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Candidate", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Candidate$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Candidate$FinishReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Citation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Citation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CitationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CitationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ContainerRegistryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ContainerRegistryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Content", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Content$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CountTokensRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CountTokensRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CountTokensResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CountTokensResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CreateEndpointOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CreateEndpointOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CreateEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CreateEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CsvDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CsvDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CsvSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.CsvSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DedicatedResources", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DedicatedResources$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeleteEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeleteEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeleteOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeleteOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeployModelOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeployModelOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeployModelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeployModelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeployModelResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeployModelResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeployedModel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DeployedModel$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DirectPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DirectPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DirectPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DirectPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DirectRawPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DirectRawPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DirectRawPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DirectRawPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DiskSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DiskSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DoubleArray", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.DoubleArray$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.EncryptionSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.EncryptionSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Endpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Endpoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Examples", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Examples$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Examples$ExampleGcsSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Examples$ExampleGcsSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Examples$ExampleGcsSource$DataFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExamplesOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExamplesOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExamplesOverride$DataFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplainRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplainRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplainResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplainResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplainResponse$ConcurrentExplanation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplainResponse$ConcurrentExplanation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Explanation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Explanation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata$FeatureValueDomain", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata$FeatureValueDomain$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata$Visualization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata$Visualization$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata$Visualization$ColorMap", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata$Visualization$OverlayType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata$Visualization$Polarity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$InputMetadata$Visualization$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$OutputMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadata$OutputMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadataOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadataOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadataOverride$InputMetadataOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationMetadataOverride$InputMetadataOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationParameters", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationParameters$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationSpecOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ExplanationSpecOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FeatureNoiseSigma", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FeatureNoiseSigma$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FeatureNoiseSigma$NoiseSigmaForFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FeatureNoiseSigma$NoiseSigmaForFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FileData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FileData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FunctionCall", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FunctionCall$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FunctionDeclaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FunctionDeclaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FunctionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.FunctionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GcsDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GcsDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GcsSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GcsSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerateContentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerateContentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerateContentResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerateContentResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerateContentResponse$PromptFeedback", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerateContentResponse$PromptFeedback$BlockedReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerateContentResponse$PromptFeedback$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerateContentResponse$UsageMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerateContentResponse$UsageMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerationConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerationConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenericOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenericOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GetEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GetEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.HarmCategory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Int64Array", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Int64Array$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.IntegratedGradientsAttribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.IntegratedGradientsAttribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ListEndpointsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ListEndpointsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ListEndpointsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ListEndpointsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.MachineSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.MachineSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ModelExplanation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ModelExplanation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.MutateDeployedModelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.MutateDeployedModelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.MutateDeployedModelResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.MutateDeployedModelResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Neighbor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Neighbor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.NfsMount", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.NfsMount$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Part", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Part$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.PersistentDiskSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.PersistentDiskSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.PredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.PredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.PredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.PredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Presets", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Presets$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Presets$Modality", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Presets$Query", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.PrivateEndpoints", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.PrivateEndpoints$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.RawPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.RawPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ResourcesConsumed", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ResourcesConsumed$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.SafetyRating", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.SafetyRating$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.SafetyRating$HarmProbability", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.SafetySetting", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.SafetySetting$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.SafetySetting$HarmBlockThreshold", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.SampledShapleyAttribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.SampledShapleyAttribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Schema", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Schema$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.SmoothGradConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.SmoothGradConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.StreamingPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.StreamingPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.StreamingPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.StreamingPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.StreamingRawPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.StreamingRawPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.StreamingRawPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.StreamingRawPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.StringArray", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.StringArray$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.TFRecordDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.TFRecordDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Tensor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Tensor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Tensor$DataType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Tool", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Tool$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.UndeployModelOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.UndeployModelOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.UndeployModelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.UndeployModelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.UndeployModelResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.UndeployModelResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.UpdateEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.UpdateEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.VideoMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.VideoMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.XraiAttribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.XraiAttribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.NullValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.v1/reflect-config.json b/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.v1/reflect-config.json new file mode 100644 index 000000000000..9338f3e579dc --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.v1/reflect-config.json @@ -0,0 +1,3431 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpBody", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpBody$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.AcceleratorType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Attribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Attribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.AutomaticResources", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.AutomaticResources$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.AutoscalingMetricSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.AutoscalingMetricSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.AvroSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.AvroSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.BatchDedicatedResources", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.BatchDedicatedResources$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.BigQueryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.BigQueryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.BigQuerySource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.BigQuerySource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Blob", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Blob$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.BlurBaselineConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.BlurBaselineConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.BoolArray", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.BoolArray$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ContainerRegistryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ContainerRegistryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Content", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Content$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CountTokensRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CountTokensRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CountTokensResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CountTokensResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CreateEndpointOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CreateEndpointOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CreateEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CreateEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CsvDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CsvDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CsvSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.CsvSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DedicatedResources", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DedicatedResources$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeleteEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeleteEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeleteOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeleteOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeployModelOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeployModelOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeployModelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeployModelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeployModelResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeployModelResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeployedModel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DeployedModel$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DirectPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DirectPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DirectPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DirectPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DirectRawPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DirectRawPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DirectRawPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DirectRawPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DiskSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DiskSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DoubleArray", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.DoubleArray$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.EncryptionSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.EncryptionSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Endpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Endpoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Examples", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Examples$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Examples$ExampleGcsSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Examples$ExampleGcsSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Examples$ExampleGcsSource$DataFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExamplesOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExamplesOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExamplesOverride$DataFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExamplesRestrictionsNamespace", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExamplesRestrictionsNamespace$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplainRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplainRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplainResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplainResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Explanation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Explanation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata$FeatureValueDomain", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata$FeatureValueDomain$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata$Visualization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata$Visualization$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata$Visualization$ColorMap", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata$Visualization$OverlayType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata$Visualization$Polarity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$InputMetadata$Visualization$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$OutputMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadata$OutputMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadataOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadataOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadataOverride$InputMetadataOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationMetadataOverride$InputMetadataOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationParameters", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationParameters$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationSpecOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ExplanationSpecOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.FeatureNoiseSigma", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.FeatureNoiseSigma$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.FeatureNoiseSigma$NoiseSigmaForFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.FeatureNoiseSigma$NoiseSigmaForFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.FileData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.FileData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.FunctionCall", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.FunctionCall$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.FunctionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.FunctionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.GcsDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.GcsDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.GcsSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.GcsSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.GenericOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.GenericOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.GetEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.GetEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Int64Array", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Int64Array$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.IntegratedGradientsAttribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.IntegratedGradientsAttribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ListEndpointsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ListEndpointsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ListEndpointsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ListEndpointsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.MachineSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.MachineSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ModelExplanation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ModelExplanation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.MutateDeployedModelOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.MutateDeployedModelOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.MutateDeployedModelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.MutateDeployedModelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.MutateDeployedModelResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.MutateDeployedModelResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Neighbor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Neighbor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.NfsMount", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.NfsMount$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Part", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Part$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.PersistentDiskSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.PersistentDiskSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.PredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.PredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.PredictRequestResponseLoggingConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.PredictRequestResponseLoggingConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.PredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.PredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Presets", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Presets$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Presets$Modality", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Presets$Query", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.PrivateEndpoints", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.PrivateEndpoints$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.RawPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.RawPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ResourcesConsumed", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.ResourcesConsumed$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.SampledShapleyAttribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.SampledShapleyAttribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.SmoothGradConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.SmoothGradConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.StreamingPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.StreamingPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.StreamingPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.StreamingPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.StreamingRawPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.StreamingRawPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.StreamingRawPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.StreamingRawPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.StringArray", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.StringArray$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.TFRecordDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.TFRecordDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Tensor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Tensor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.Tensor$DataType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.UndeployModelOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.UndeployModelOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.UndeployModelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.UndeployModelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.UndeployModelResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.UndeployModelResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.UpdateEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.UpdateEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.VideoMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.VideoMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.XraiAttribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1.XraiAttribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.NullValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.v1beta1/reflect-config.json b/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.v1beta1/reflect-config.json new file mode 100644 index 000000000000..00769cd39082 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.v1beta1/reflect-config.json @@ -0,0 +1,3755 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpBody", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpBody$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.AcceleratorType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Attribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Attribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.AutomaticResources", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.AutomaticResources$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.AutoscalingMetricSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.AutoscalingMetricSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.AvroSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.AvroSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.BatchDedicatedResources", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.BatchDedicatedResources$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.BigQueryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.BigQueryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.BigQuerySource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.BigQuerySource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Blob", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Blob$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.BlurBaselineConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.BlurBaselineConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.BoolArray", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.BoolArray$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Candidate", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Candidate$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Candidate$FinishReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Citation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Citation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CitationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CitationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ContainerRegistryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ContainerRegistryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Content", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Content$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CountTokensRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CountTokensRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CountTokensResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CountTokensResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CreateEndpointOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CreateEndpointOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CreateEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CreateEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CsvDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CsvDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CsvSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.CsvSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DedicatedResources", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DedicatedResources$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeleteEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeleteEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeleteOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeleteOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeployModelOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeployModelOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeployModelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeployModelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeployModelResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeployModelResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeployedModel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DeployedModel$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DirectPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DirectPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DirectPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DirectPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DirectRawPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DirectRawPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DirectRawPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DirectRawPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DiskSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DiskSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DoubleArray", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.DoubleArray$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.EncryptionSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.EncryptionSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Endpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Endpoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Examples", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Examples$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Examples$ExampleGcsSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Examples$ExampleGcsSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Examples$ExampleGcsSource$DataFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExamplesOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExamplesOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExamplesOverride$DataFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplainRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplainRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplainResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplainResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplainResponse$ConcurrentExplanation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplainResponse$ConcurrentExplanation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Explanation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Explanation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata$Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata$FeatureValueDomain", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata$FeatureValueDomain$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata$Visualization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata$Visualization$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata$Visualization$ColorMap", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata$Visualization$OverlayType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata$Visualization$Polarity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$InputMetadata$Visualization$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$OutputMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadata$OutputMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadataOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadataOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadataOverride$InputMetadataOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationMetadataOverride$InputMetadataOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationParameters", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationParameters$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationSpecOverride", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ExplanationSpecOverride$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FeatureNoiseSigma", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FeatureNoiseSigma$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FeatureNoiseSigma$NoiseSigmaForFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FeatureNoiseSigma$NoiseSigmaForFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FileData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FileData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FunctionCall", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FunctionCall$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FunctionDeclaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FunctionDeclaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FunctionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.FunctionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GcsDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GcsDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GcsSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GcsSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerateContentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerateContentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerateContentResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerateContentResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerateContentResponse$PromptFeedback", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerateContentResponse$PromptFeedback$BlockedReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerateContentResponse$PromptFeedback$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerateContentResponse$UsageMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerateContentResponse$UsageMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerationConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenerationConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenericOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GenericOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GetEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.GetEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.HarmCategory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Int64Array", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Int64Array$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ListEndpointsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ListEndpointsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ListEndpointsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ListEndpointsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.MachineSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.MachineSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ModelExplanation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ModelExplanation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.MutateDeployedModelOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.MutateDeployedModelOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.MutateDeployedModelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.MutateDeployedModelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.MutateDeployedModelResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.MutateDeployedModelResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Neighbor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Neighbor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.NfsMount", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.NfsMount$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Part", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Part$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.PersistentDiskSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.PersistentDiskSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.PredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.PredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.PredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.PredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Presets", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Presets$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Presets$Modality", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Presets$Query", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.PrivateEndpoints", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.PrivateEndpoints$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.RawPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.RawPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ResourcesConsumed", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.ResourcesConsumed$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.SafetyRating", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.SafetyRating$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.SafetyRating$HarmProbability", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.SafetySetting", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.SafetySetting$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.SafetySetting$HarmBlockThreshold", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.SampledShapleyAttribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.SampledShapleyAttribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Schema", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Schema$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.SmoothGradConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.SmoothGradConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.StreamingPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.StreamingPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.StreamingPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.StreamingPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.StreamingRawPredictRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.StreamingRawPredictRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.StreamingRawPredictResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.StreamingRawPredictResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.StringArray", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.StringArray$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.TFRecordDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.TFRecordDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Tensor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Tensor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Tensor$DataType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Tool", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Tool$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.UndeployModelOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.UndeployModelOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.UndeployModelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.UndeployModelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.UndeployModelResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.UndeployModelResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.UpdateEndpointRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.UpdateEndpointRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.VideoMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.VideoMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.XraiAttribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.v1beta1.XraiAttribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.NullValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/VertexAITest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/VertexAITest.java new file mode 100644 index 000000000000..67d3883fcdbf --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/VertexAITest.java @@ -0,0 +1,49 @@ +/* + * 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; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.auth.oauth2.GoogleCredentials; +import java.io.IOException; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public final class VertexAITest { + private static final String TEST_PROJECT = "test_project"; + private static final String TEST_LOCATION = "test_location"; + private VertexAI vertexAi; + @Rule public final MockitoRule mocksRule = MockitoJUnit.rule(); + @Mock private GoogleCredentials mockGoogleCredentials; + + @Before + public void doBeforeEachTest() throws Exception { + vertexAi = new VertexAI(TEST_PROJECT, TEST_LOCATION, mockGoogleCredentials); + } + + @Test + public void testInstantiateVertexAI_shouldContainRightFields() throws IOException { + assertThat(vertexAi.getProjectId()).isEqualTo("test_project"); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientHttpJsonTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..98b9768f77f2 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientHttpJsonTest.java @@ -0,0 +1,1404 @@ +/* + * 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 static com.google.cloud.vertexai.api.EndpointServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.vertexai.api.EndpointServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +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.HttpJsonEndpointServiceStub; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +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.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class EndpointServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static EndpointServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonEndpointServiceStub.getMethodDescriptors(), + EndpointServiceSettings.getDefaultEndpoint()); + EndpointServiceSettings settings = + EndpointServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + EndpointServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EndpointServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createEndpointTest() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Endpoint endpoint = Endpoint.newBuilder().build(); + + Endpoint actualResponse = client.createEndpointAsync(parent, endpoint).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createEndpointExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Endpoint endpoint = Endpoint.newBuilder().build(); + client.createEndpointAsync(parent, endpoint).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createEndpointTest2() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Endpoint endpoint = Endpoint.newBuilder().build(); + + Endpoint actualResponse = client.createEndpointAsync(parent, endpoint).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createEndpointExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Endpoint endpoint = Endpoint.newBuilder().build(); + client.createEndpointAsync(parent, endpoint).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createEndpointTest3() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Endpoint endpoint = Endpoint.newBuilder().build(); + String endpointId = "endpointId-1837754992"; + + Endpoint actualResponse = client.createEndpointAsync(parent, endpoint, endpointId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createEndpointExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Endpoint endpoint = Endpoint.newBuilder().build(); + String endpointId = "endpointId-1837754992"; + client.createEndpointAsync(parent, endpoint, endpointId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createEndpointTest4() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Endpoint endpoint = Endpoint.newBuilder().build(); + String endpointId = "endpointId-1837754992"; + + Endpoint actualResponse = client.createEndpointAsync(parent, endpoint, endpointId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createEndpointExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Endpoint endpoint = Endpoint.newBuilder().build(); + String endpointId = "endpointId-1837754992"; + client.createEndpointAsync(parent, endpoint, endpointId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getEndpointTest() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + EndpointName name = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + + Endpoint actualResponse = client.getEndpoint(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEndpointExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EndpointName name = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + client.getEndpoint(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEndpointTest2() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-6164/locations/location-6164/endpoints/endpoint-6164"; + + Endpoint actualResponse = client.getEndpoint(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEndpointExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6164/locations/location-6164/endpoints/endpoint-6164"; + client.getEndpoint(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEndpointsTest() throws Exception { + Endpoint responsesElement = Endpoint.newBuilder().build(); + ListEndpointsResponse expectedResponse = + ListEndpointsResponse.newBuilder() + .setNextPageToken("") + .addAllEndpoints(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListEndpointsPagedResponse pagedListResponse = client.listEndpoints(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEndpointsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listEndpointsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listEndpoints(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEndpointsTest2() throws Exception { + Endpoint responsesElement = Endpoint.newBuilder().build(); + ListEndpointsResponse expectedResponse = + ListEndpointsResponse.newBuilder() + .setNextPageToken("") + .addAllEndpoints(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListEndpointsPagedResponse pagedListResponse = client.listEndpoints(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEndpointsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listEndpointsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listEndpoints(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateEndpointTest() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + Endpoint endpoint = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Endpoint actualResponse = client.updateEndpoint(endpoint, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateEndpointExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Endpoint endpoint = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateEndpoint(endpoint, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteEndpointTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + EndpointName name = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + + client.deleteEndpointAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteEndpointExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EndpointName name = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + client.deleteEndpointAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteEndpointTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-6164/locations/location-6164/endpoints/endpoint-6164"; + + client.deleteEndpointAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteEndpointExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-6164/locations/location-6164/endpoints/endpoint-6164"; + client.deleteEndpointAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deployModelTest() throws Exception { + DeployModelResponse expectedResponse = + DeployModelResponse.newBuilder() + .setDeployedModel(DeployedModel.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + Map trafficSplit = new HashMap<>(); + + DeployModelResponse actualResponse = + client.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deployModelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + Map trafficSplit = new HashMap<>(); + client.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deployModelTest2() throws Exception { + DeployModelResponse expectedResponse = + DeployModelResponse.newBuilder() + .setDeployedModel(DeployedModel.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + Map trafficSplit = new HashMap<>(); + + DeployModelResponse actualResponse = + client.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deployModelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + Map trafficSplit = new HashMap<>(); + client.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void undeployModelTest() throws Exception { + UndeployModelResponse expectedResponse = UndeployModelResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + String deployedModelId = "deployedModelId-1817547906"; + Map trafficSplit = new HashMap<>(); + + UndeployModelResponse actualResponse = + client.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void undeployModelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + String deployedModelId = "deployedModelId-1817547906"; + Map trafficSplit = new HashMap<>(); + client.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void undeployModelTest2() throws Exception { + UndeployModelResponse expectedResponse = UndeployModelResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + String deployedModelId = "deployedModelId-1817547906"; + Map trafficSplit = new HashMap<>(); + + UndeployModelResponse actualResponse = + client.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void undeployModelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + String deployedModelId = "deployedModelId-1817547906"; + Map trafficSplit = new HashMap<>(); + client.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void mutateDeployedModelTest() throws Exception { + MutateDeployedModelResponse expectedResponse = + MutateDeployedModelResponse.newBuilder() + .setDeployedModel(DeployedModel.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("mutateDeployedModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + MutateDeployedModelResponse actualResponse = + client.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void mutateDeployedModelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void mutateDeployedModelTest2() throws Exception { + MutateDeployedModelResponse expectedResponse = + MutateDeployedModelResponse.newBuilder() + .setDeployedModel(DeployedModel.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("mutateDeployedModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + MutateDeployedModelResponse actualResponse = + client.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void mutateDeployedModelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientTest.java new file mode 100644 index 000000000000..6d2d43514b83 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientTest.java @@ -0,0 +1,1298 @@ +/* + * 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 static com.google.cloud.vertexai.api.EndpointServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.vertexai.api.EndpointServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +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.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class EndpointServiceClientTest { + private static MockEndpointService mockEndpointService; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private EndpointServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockEndpointService = new MockEndpointService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockEndpointService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + EndpointServiceSettings settings = + EndpointServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EndpointServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createEndpointTest() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Endpoint endpoint = Endpoint.newBuilder().build(); + + Endpoint actualResponse = client.createEndpointAsync(parent, endpoint).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEndpointRequest actualRequest = ((CreateEndpointRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createEndpointExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Endpoint endpoint = Endpoint.newBuilder().build(); + client.createEndpointAsync(parent, endpoint).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createEndpointTest2() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Endpoint endpoint = Endpoint.newBuilder().build(); + + Endpoint actualResponse = client.createEndpointAsync(parent, endpoint).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEndpointRequest actualRequest = ((CreateEndpointRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createEndpointExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + String parent = "parent-995424086"; + Endpoint endpoint = Endpoint.newBuilder().build(); + client.createEndpointAsync(parent, endpoint).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createEndpointTest3() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Endpoint endpoint = Endpoint.newBuilder().build(); + String endpointId = "endpointId-1837754992"; + + Endpoint actualResponse = client.createEndpointAsync(parent, endpoint, endpointId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEndpointRequest actualRequest = ((CreateEndpointRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(endpointId, actualRequest.getEndpointId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createEndpointExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Endpoint endpoint = Endpoint.newBuilder().build(); + String endpointId = "endpointId-1837754992"; + client.createEndpointAsync(parent, endpoint, endpointId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createEndpointTest4() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Endpoint endpoint = Endpoint.newBuilder().build(); + String endpointId = "endpointId-1837754992"; + + Endpoint actualResponse = client.createEndpointAsync(parent, endpoint, endpointId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEndpointRequest actualRequest = ((CreateEndpointRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(endpointId, actualRequest.getEndpointId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createEndpointExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + String parent = "parent-995424086"; + Endpoint endpoint = Endpoint.newBuilder().build(); + String endpointId = "endpointId-1837754992"; + client.createEndpointAsync(parent, endpoint, endpointId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getEndpointTest() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + mockEndpointService.addResponse(expectedResponse); + + EndpointName name = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + + Endpoint actualResponse = client.getEndpoint(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEndpointRequest actualRequest = ((GetEndpointRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEndpointExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + EndpointName name = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + client.getEndpoint(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEndpointTest2() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + mockEndpointService.addResponse(expectedResponse); + + String name = "name3373707"; + + Endpoint actualResponse = client.getEndpoint(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEndpointRequest actualRequest = ((GetEndpointRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEndpointExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + String name = "name3373707"; + client.getEndpoint(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEndpointsTest() throws Exception { + Endpoint responsesElement = Endpoint.newBuilder().build(); + ListEndpointsResponse expectedResponse = + ListEndpointsResponse.newBuilder() + .setNextPageToken("") + .addAllEndpoints(Arrays.asList(responsesElement)) + .build(); + mockEndpointService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListEndpointsPagedResponse pagedListResponse = client.listEndpoints(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEndpointsList().get(0), resources.get(0)); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEndpointsRequest actualRequest = ((ListEndpointsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEndpointsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listEndpoints(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEndpointsTest2() throws Exception { + Endpoint responsesElement = Endpoint.newBuilder().build(); + ListEndpointsResponse expectedResponse = + ListEndpointsResponse.newBuilder() + .setNextPageToken("") + .addAllEndpoints(Arrays.asList(responsesElement)) + .build(); + mockEndpointService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListEndpointsPagedResponse pagedListResponse = client.listEndpoints(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEndpointsList().get(0), resources.get(0)); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEndpointsRequest actualRequest = ((ListEndpointsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEndpointsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listEndpoints(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateEndpointTest() throws Exception { + Endpoint expectedResponse = + Endpoint.newBuilder() + .setName( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllDeployedModels(new ArrayList()) + .putAllTrafficSplit(new HashMap()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEncryptionSpec(EncryptionSpec.newBuilder().build()) + .setNetwork("network1843485230") + .setEnablePrivateServiceConnect(true) + .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") + .setPredictRequestResponseLoggingConfig( + PredictRequestResponseLoggingConfig.newBuilder().build()) + .build(); + mockEndpointService.addResponse(expectedResponse); + + Endpoint endpoint = Endpoint.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Endpoint actualResponse = client.updateEndpoint(endpoint, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateEndpointRequest actualRequest = ((UpdateEndpointRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateEndpointExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + Endpoint endpoint = Endpoint.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateEndpoint(endpoint, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteEndpointTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + EndpointName name = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + + client.deleteEndpointAsync(name).get(); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteEndpointRequest actualRequest = ((DeleteEndpointRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteEndpointExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + EndpointName name = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + client.deleteEndpointAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteEndpointTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteEndpointTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteEndpointAsync(name).get(); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteEndpointRequest actualRequest = ((DeleteEndpointRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteEndpointExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + String name = "name3373707"; + client.deleteEndpointAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deployModelTest() throws Exception { + DeployModelResponse expectedResponse = + DeployModelResponse.newBuilder() + .setDeployedModel(DeployedModel.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + Map trafficSplit = new HashMap<>(); + + DeployModelResponse actualResponse = + client.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeployModelRequest actualRequest = ((DeployModelRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint.toString(), actualRequest.getEndpoint()); + Assert.assertEquals(deployedModel, actualRequest.getDeployedModel()); + Assert.assertEquals(trafficSplit, actualRequest.getTrafficSplitMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deployModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + Map trafficSplit = new HashMap<>(); + client.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deployModelTest2() throws Exception { + DeployModelResponse expectedResponse = + DeployModelResponse.newBuilder() + .setDeployedModel(DeployedModel.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deployModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + String endpoint = "endpoint1741102485"; + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + Map trafficSplit = new HashMap<>(); + + DeployModelResponse actualResponse = + client.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeployModelRequest actualRequest = ((DeployModelRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(deployedModel, actualRequest.getDeployedModel()); + Assert.assertEquals(trafficSplit, actualRequest.getTrafficSplitMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deployModelExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + String endpoint = "endpoint1741102485"; + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + Map trafficSplit = new HashMap<>(); + client.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void undeployModelTest() throws Exception { + UndeployModelResponse expectedResponse = UndeployModelResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + String deployedModelId = "deployedModelId-1817547906"; + Map trafficSplit = new HashMap<>(); + + UndeployModelResponse actualResponse = + client.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeployModelRequest actualRequest = ((UndeployModelRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint.toString(), actualRequest.getEndpoint()); + Assert.assertEquals(deployedModelId, actualRequest.getDeployedModelId()); + Assert.assertEquals(trafficSplit, actualRequest.getTrafficSplitMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeployModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + String deployedModelId = "deployedModelId-1817547906"; + Map trafficSplit = new HashMap<>(); + client.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void undeployModelTest2() throws Exception { + UndeployModelResponse expectedResponse = UndeployModelResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeployModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + String endpoint = "endpoint1741102485"; + String deployedModelId = "deployedModelId-1817547906"; + Map trafficSplit = new HashMap<>(); + + UndeployModelResponse actualResponse = + client.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeployModelRequest actualRequest = ((UndeployModelRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(deployedModelId, actualRequest.getDeployedModelId()); + Assert.assertEquals(trafficSplit, actualRequest.getTrafficSplitMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeployModelExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + String endpoint = "endpoint1741102485"; + String deployedModelId = "deployedModelId-1817547906"; + Map trafficSplit = new HashMap<>(); + client.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void mutateDeployedModelTest() throws Exception { + MutateDeployedModelResponse expectedResponse = + MutateDeployedModelResponse.newBuilder() + .setDeployedModel(DeployedModel.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("mutateDeployedModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + MutateDeployedModelResponse actualResponse = + client.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MutateDeployedModelRequest actualRequest = ((MutateDeployedModelRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint.toString(), actualRequest.getEndpoint()); + Assert.assertEquals(deployedModel, actualRequest.getDeployedModel()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void mutateDeployedModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void mutateDeployedModelTest2() throws Exception { + MutateDeployedModelResponse expectedResponse = + MutateDeployedModelResponse.newBuilder() + .setDeployedModel(DeployedModel.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("mutateDeployedModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEndpointService.addResponse(resultOperation); + + String endpoint = "endpoint1741102485"; + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + MutateDeployedModelResponse actualResponse = + client.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEndpointService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MutateDeployedModelRequest actualRequest = ((MutateDeployedModelRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(deployedModel, actualRequest.getDeployedModel()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void mutateDeployedModelExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEndpointService.addException(exception); + + try { + String endpoint = "endpoint1741102485"; + DeployedModel deployedModel = DeployedModel.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockEndpointService.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockEndpointService.java new file mode 100644 index 000000000000..7981a536db77 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockEndpointService.java @@ -0,0 +1,59 @@ +/* + * 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.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockEndpointService implements MockGrpcService { + private final MockEndpointServiceImpl serviceImpl; + + public MockEndpointService() { + serviceImpl = new MockEndpointServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockEndpointServiceImpl.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockEndpointServiceImpl.java new file mode 100644 index 000000000000..aacc8f266ce7 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockEndpointServiceImpl.java @@ -0,0 +1,227 @@ +/* + * 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.BetaApi; +import com.google.cloud.vertexai.api.EndpointServiceGrpc.EndpointServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockEndpointServiceImpl extends EndpointServiceImplBase { + private List requests; + private Queue responses; + + public MockEndpointServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createEndpoint( + CreateEndpointRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateEndpoint, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getEndpoint(GetEndpointRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Endpoint) { + requests.add(request); + responseObserver.onNext(((Endpoint) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetEndpoint, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Endpoint.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listEndpoints( + ListEndpointsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListEndpointsResponse) { + requests.add(request); + responseObserver.onNext(((ListEndpointsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListEndpoints, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListEndpointsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateEndpoint( + UpdateEndpointRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Endpoint) { + requests.add(request); + responseObserver.onNext(((Endpoint) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateEndpoint, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Endpoint.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteEndpoint( + DeleteEndpointRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteEndpoint, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deployModel(DeployModelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeployModel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void undeployModel( + UndeployModelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UndeployModel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void mutateDeployedModel( + MutateDeployedModelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method MutateDeployedModel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockIAMPolicy.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockIAMPolicy.java new file mode 100644 index 000000000000..42f778ce535c --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * 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.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockIAMPolicyImpl.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..4e18054bb86a --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * 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.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +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.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockLocations.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockLocations.java new file mode 100644 index 000000000000..a0785ec85bcf --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockLocations.java @@ -0,0 +1,59 @@ +/* + * 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.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockLocationsImpl.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockLocationsImpl.java new file mode 100644 index 000000000000..c2afa6b3417d --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * 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.BetaApi; +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.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockPredictionService.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockPredictionService.java new file mode 100644 index 000000000000..566b278670a8 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockPredictionService.java @@ -0,0 +1,59 @@ +/* + * 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.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockPredictionService implements MockGrpcService { + private final MockPredictionServiceImpl serviceImpl; + + public MockPredictionService() { + serviceImpl = new MockPredictionServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockPredictionServiceImpl.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockPredictionServiceImpl.java new file mode 100644 index 000000000000..d79cb50bcf5a --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/MockPredictionServiceImpl.java @@ -0,0 +1,300 @@ +/* + * 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.HttpBody; +import com.google.api.core.BetaApi; +import com.google.cloud.vertexai.api.PredictionServiceGrpc.PredictionServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockPredictionServiceImpl extends PredictionServiceImplBase { + private List requests; + private Queue responses; + + public MockPredictionServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void predict(PredictRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PredictResponse) { + requests.add(request); + responseObserver.onNext(((PredictResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Predict, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PredictResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rawPredict(RawPredictRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof HttpBody) { + requests.add(request); + responseObserver.onNext(((HttpBody) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RawPredict, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + HttpBody.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void directPredict( + DirectPredictRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DirectPredictResponse) { + requests.add(request); + responseObserver.onNext(((DirectPredictResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DirectPredict, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DirectPredictResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void directRawPredict( + DirectRawPredictRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DirectRawPredictResponse) { + requests.add(request); + responseObserver.onNext(((DirectRawPredictResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DirectRawPredict, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DirectRawPredictResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver streamingPredict( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(StreamingPredictRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamingPredictResponse) { + responseObserver.onNext(((StreamingPredictResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StreamingPredict, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamingPredictResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public void serverStreamingPredict( + StreamingPredictRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamingPredictResponse) { + requests.add(request); + responseObserver.onNext(((StreamingPredictResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ServerStreamingPredict, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamingPredictResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver streamingRawPredict( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(StreamingRawPredictRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamingRawPredictResponse) { + responseObserver.onNext(((StreamingRawPredictResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StreamingRawPredict, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamingRawPredictResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public void explain(ExplainRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ExplainResponse) { + requests.add(request); + responseObserver.onNext(((ExplainResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Explain, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ExplainResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void countTokens( + CountTokensRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CountTokensResponse) { + requests.add(request); + responseObserver.onNext(((CountTokensResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CountTokens, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CountTokensResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void streamGenerateContent( + GenerateContentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateContentResponse) { + requests.add(request); + responseObserver.onNext(((GenerateContentResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StreamGenerateContent, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateContentResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/PredictionServiceClientHttpJsonTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/PredictionServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..a9fc0294fd18 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/PredictionServiceClientHttpJsonTest.java @@ -0,0 +1,954 @@ +/* + * 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 static com.google.cloud.vertexai.api.PredictionServiceClient.ListLocationsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +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.HttpJsonPredictionServiceStub; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +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.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Value; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class PredictionServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static PredictionServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonPredictionServiceStub.getMethodDescriptors(), + PredictionServiceSettings.getDefaultEndpoint()); + PredictionServiceSettings settings = + PredictionServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + PredictionServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PredictionServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void predictTest() throws Exception { + PredictResponse expectedResponse = + PredictResponse.newBuilder() + .addAllPredictions(new ArrayList()) + .setDeployedModelId("deployedModelId-1817547906") + .setModel("model104069929") + .setModelVersionId("modelVersionId-2006125846") + .setModelDisplayName("modelDisplayName1578770308") + .setMetadata(Value.newBuilder().setBoolValue(true).build()) + .build(); + mockService.addResponse(expectedResponse); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + + PredictResponse actualResponse = client.predict(endpoint, instances, parameters); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void predictExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + client.predict(endpoint, instances, parameters); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void predictTest2() throws Exception { + PredictResponse expectedResponse = + PredictResponse.newBuilder() + .addAllPredictions(new ArrayList()) + .setDeployedModelId("deployedModelId-1817547906") + .setModel("model104069929") + .setModelVersionId("modelVersionId-2006125846") + .setModelDisplayName("modelDisplayName1578770308") + .setMetadata(Value.newBuilder().setBoolValue(true).build()) + .build(); + mockService.addResponse(expectedResponse); + + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + + PredictResponse actualResponse = client.predict(endpoint, instances, parameters); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void predictExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + client.predict(endpoint, instances, parameters); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rawPredictTest() throws Exception { + HttpBody expectedResponse = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + HttpBody httpBody = HttpBody.newBuilder().build(); + + HttpBody actualResponse = client.rawPredict(endpoint, httpBody); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void rawPredictExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + HttpBody httpBody = HttpBody.newBuilder().build(); + client.rawPredict(endpoint, httpBody); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rawPredictTest2() throws Exception { + HttpBody expectedResponse = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + HttpBody httpBody = HttpBody.newBuilder().build(); + + HttpBody actualResponse = client.rawPredict(endpoint, httpBody); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void rawPredictExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + HttpBody httpBody = HttpBody.newBuilder().build(); + client.rawPredict(endpoint, httpBody); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void directPredictTest() throws Exception { + DirectPredictResponse expectedResponse = + DirectPredictResponse.newBuilder() + .addAllOutputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + DirectPredictRequest request = + DirectPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + + DirectPredictResponse actualResponse = client.directPredict(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void directPredictExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DirectPredictRequest request = + DirectPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + client.directPredict(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void directRawPredictTest() throws Exception { + DirectRawPredictResponse expectedResponse = + DirectRawPredictResponse.newBuilder().setOutput(ByteString.EMPTY).build(); + mockService.addResponse(expectedResponse); + + DirectRawPredictRequest request = + DirectRawPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setMethodName("methodName-723163380") + .setInput(ByteString.EMPTY) + .build(); + + DirectRawPredictResponse actualResponse = client.directRawPredict(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void directRawPredictExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DirectRawPredictRequest request = + DirectRawPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setMethodName("methodName-723163380") + .setInput(ByteString.EMPTY) + .build(); + client.directRawPredict(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void streamingPredictUnsupportedMethodTest() throws Exception { + // The streamingPredict() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void serverStreamingPredictTest() throws Exception {} + + @Test + public void serverStreamingPredictExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void streamingRawPredictUnsupportedMethodTest() throws Exception { + // The streamingRawPredict() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void explainTest() throws Exception { + ExplainResponse expectedResponse = + ExplainResponse.newBuilder() + .addAllExplanations(new ArrayList()) + .putAllConcurrentExplanations( + new HashMap()) + .setDeployedModelId("deployedModelId-1817547906") + .addAllPredictions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + + ExplainResponse actualResponse = + client.explain(endpoint, instances, parameters, deployedModelId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void explainExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + client.explain(endpoint, instances, parameters, deployedModelId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void explainTest2() throws Exception { + ExplainResponse expectedResponse = + ExplainResponse.newBuilder() + .addAllExplanations(new ArrayList()) + .putAllConcurrentExplanations( + new HashMap()) + .setDeployedModelId("deployedModelId-1817547906") + .addAllPredictions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + + ExplainResponse actualResponse = + client.explain(endpoint, instances, parameters, deployedModelId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void explainExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + client.explain(endpoint, instances, parameters, deployedModelId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void countTokensTest() throws Exception { + CountTokensResponse expectedResponse = + CountTokensResponse.newBuilder() + .setTotalTokens(730673909) + .setTotalBillableCharacters(1242495501) + .build(); + mockService.addResponse(expectedResponse); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + + CountTokensResponse actualResponse = client.countTokens(endpoint, instances); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void countTokensExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + client.countTokens(endpoint, instances); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void countTokensTest2() throws Exception { + CountTokensResponse expectedResponse = + CountTokensResponse.newBuilder() + .setTotalTokens(730673909) + .setTotalBillableCharacters(1242495501) + .build(); + mockService.addResponse(expectedResponse); + + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + List instances = new ArrayList<>(); + + CountTokensResponse actualResponse = client.countTokens(endpoint, instances); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void countTokensExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String endpoint = "projects/project-6526/locations/location-6526/endpoints/endpoint-6526"; + List instances = new ArrayList<>(); + client.countTokens(endpoint, instances); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void streamGenerateContentTest() throws Exception {} + + @Test + public void streamGenerateContentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/PredictionServiceClientTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/PredictionServiceClientTest.java new file mode 100644 index 000000000000..87386999148d --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/PredictionServiceClientTest.java @@ -0,0 +1,1109 @@ +/* + * 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 static com.google.cloud.vertexai.api.PredictionServiceClient.ListLocationsPagedResponse; + +import com.google.api.HttpBody; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +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.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Value; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class PredictionServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockPredictionService mockPredictionService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private PredictionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockPredictionService = new MockPredictionService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockPredictionService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + PredictionServiceSettings settings = + PredictionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = PredictionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void predictTest() throws Exception { + PredictResponse expectedResponse = + PredictResponse.newBuilder() + .addAllPredictions(new ArrayList()) + .setDeployedModelId("deployedModelId-1817547906") + .setModel("model104069929") + .setModelVersionId("modelVersionId-2006125846") + .setModelDisplayName("modelDisplayName1578770308") + .setMetadata(Value.newBuilder().setBoolValue(true).build()) + .build(); + mockPredictionService.addResponse(expectedResponse); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + + PredictResponse actualResponse = client.predict(endpoint, instances, parameters); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PredictRequest actualRequest = ((PredictRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint.toString(), actualRequest.getEndpoint()); + Assert.assertEquals(instances, actualRequest.getInstancesList()); + Assert.assertEquals(parameters, actualRequest.getParameters()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void predictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + client.predict(endpoint, instances, parameters); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void predictTest2() throws Exception { + PredictResponse expectedResponse = + PredictResponse.newBuilder() + .addAllPredictions(new ArrayList()) + .setDeployedModelId("deployedModelId-1817547906") + .setModel("model104069929") + .setModelVersionId("modelVersionId-2006125846") + .setModelDisplayName("modelDisplayName1578770308") + .setMetadata(Value.newBuilder().setBoolValue(true).build()) + .build(); + mockPredictionService.addResponse(expectedResponse); + + String endpoint = "endpoint1741102485"; + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + + PredictResponse actualResponse = client.predict(endpoint, instances, parameters); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PredictRequest actualRequest = ((PredictRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(instances, actualRequest.getInstancesList()); + Assert.assertEquals(parameters, actualRequest.getParameters()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void predictExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + String endpoint = "endpoint1741102485"; + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + client.predict(endpoint, instances, parameters); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rawPredictTest() throws Exception { + HttpBody expectedResponse = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + mockPredictionService.addResponse(expectedResponse); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + HttpBody httpBody = HttpBody.newBuilder().build(); + + HttpBody actualResponse = client.rawPredict(endpoint, httpBody); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RawPredictRequest actualRequest = ((RawPredictRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint.toString(), actualRequest.getEndpoint()); + Assert.assertEquals(httpBody, actualRequest.getHttpBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rawPredictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + HttpBody httpBody = HttpBody.newBuilder().build(); + client.rawPredict(endpoint, httpBody); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rawPredictTest2() throws Exception { + HttpBody expectedResponse = + HttpBody.newBuilder() + .setContentType("contentType-389131437") + .setData(ByteString.EMPTY) + .addAllExtensions(new ArrayList()) + .build(); + mockPredictionService.addResponse(expectedResponse); + + String endpoint = "endpoint1741102485"; + HttpBody httpBody = HttpBody.newBuilder().build(); + + HttpBody actualResponse = client.rawPredict(endpoint, httpBody); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RawPredictRequest actualRequest = ((RawPredictRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(httpBody, actualRequest.getHttpBody()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rawPredictExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + String endpoint = "endpoint1741102485"; + HttpBody httpBody = HttpBody.newBuilder().build(); + client.rawPredict(endpoint, httpBody); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void directPredictTest() throws Exception { + DirectPredictResponse expectedResponse = + DirectPredictResponse.newBuilder() + .addAllOutputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + mockPredictionService.addResponse(expectedResponse); + + DirectPredictRequest request = + DirectPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + + DirectPredictResponse actualResponse = client.directPredict(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DirectPredictRequest actualRequest = ((DirectPredictRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getEndpoint(), actualRequest.getEndpoint()); + Assert.assertEquals(request.getInputsList(), actualRequest.getInputsList()); + Assert.assertEquals(request.getParameters(), actualRequest.getParameters()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void directPredictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + DirectPredictRequest request = + DirectPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + client.directPredict(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void directRawPredictTest() throws Exception { + DirectRawPredictResponse expectedResponse = + DirectRawPredictResponse.newBuilder().setOutput(ByteString.EMPTY).build(); + mockPredictionService.addResponse(expectedResponse); + + DirectRawPredictRequest request = + DirectRawPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setMethodName("methodName-723163380") + .setInput(ByteString.EMPTY) + .build(); + + DirectRawPredictResponse actualResponse = client.directRawPredict(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DirectRawPredictRequest actualRequest = ((DirectRawPredictRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getEndpoint(), actualRequest.getEndpoint()); + Assert.assertEquals(request.getMethodName(), actualRequest.getMethodName()); + Assert.assertEquals(request.getInput(), actualRequest.getInput()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void directRawPredictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + DirectRawPredictRequest request = + DirectRawPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setMethodName("methodName-723163380") + .setInput(ByteString.EMPTY) + .build(); + client.directRawPredict(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void streamingPredictTest() throws Exception { + StreamingPredictResponse expectedResponse = + StreamingPredictResponse.newBuilder() + .addAllOutputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + mockPredictionService.addResponse(expectedResponse); + StreamingPredictRequest request = + StreamingPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingPredictCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void streamingPredictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + StreamingPredictRequest request = + StreamingPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingPredictCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void serverStreamingPredictTest() throws Exception { + StreamingPredictResponse expectedResponse = + StreamingPredictResponse.newBuilder() + .addAllOutputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + mockPredictionService.addResponse(expectedResponse); + StreamingPredictRequest request = + StreamingPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.serverStreamingPredictCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void serverStreamingPredictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + StreamingPredictRequest request = + StreamingPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.serverStreamingPredictCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void streamingRawPredictTest() throws Exception { + StreamingRawPredictResponse expectedResponse = + StreamingRawPredictResponse.newBuilder().setOutput(ByteString.EMPTY).build(); + mockPredictionService.addResponse(expectedResponse); + StreamingRawPredictRequest request = + StreamingRawPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setMethodName("methodName-723163380") + .setInput(ByteString.EMPTY) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingRawPredictCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void streamingRawPredictExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + StreamingRawPredictRequest request = + StreamingRawPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setMethodName("methodName-723163380") + .setInput(ByteString.EMPTY) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingRawPredictCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void explainTest() throws Exception { + ExplainResponse expectedResponse = + ExplainResponse.newBuilder() + .addAllExplanations(new ArrayList()) + .putAllConcurrentExplanations( + new HashMap()) + .setDeployedModelId("deployedModelId-1817547906") + .addAllPredictions(new ArrayList()) + .build(); + mockPredictionService.addResponse(expectedResponse); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + + ExplainResponse actualResponse = + client.explain(endpoint, instances, parameters, deployedModelId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExplainRequest actualRequest = ((ExplainRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint.toString(), actualRequest.getEndpoint()); + Assert.assertEquals(instances, actualRequest.getInstancesList()); + Assert.assertEquals(parameters, actualRequest.getParameters()); + Assert.assertEquals(deployedModelId, actualRequest.getDeployedModelId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void explainExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + client.explain(endpoint, instances, parameters, deployedModelId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void explainTest2() throws Exception { + ExplainResponse expectedResponse = + ExplainResponse.newBuilder() + .addAllExplanations(new ArrayList()) + .putAllConcurrentExplanations( + new HashMap()) + .setDeployedModelId("deployedModelId-1817547906") + .addAllPredictions(new ArrayList()) + .build(); + mockPredictionService.addResponse(expectedResponse); + + String endpoint = "endpoint1741102485"; + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + + ExplainResponse actualResponse = + client.explain(endpoint, instances, parameters, deployedModelId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExplainRequest actualRequest = ((ExplainRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(instances, actualRequest.getInstancesList()); + Assert.assertEquals(parameters, actualRequest.getParameters()); + Assert.assertEquals(deployedModelId, actualRequest.getDeployedModelId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void explainExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + String endpoint = "endpoint1741102485"; + List instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + client.explain(endpoint, instances, parameters, deployedModelId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void countTokensTest() throws Exception { + CountTokensResponse expectedResponse = + CountTokensResponse.newBuilder() + .setTotalTokens(730673909) + .setTotalBillableCharacters(1242495501) + .build(); + mockPredictionService.addResponse(expectedResponse); + + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + + CountTokensResponse actualResponse = client.countTokens(endpoint, instances); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CountTokensRequest actualRequest = ((CountTokensRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint.toString(), actualRequest.getEndpoint()); + Assert.assertEquals(instances, actualRequest.getInstancesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void countTokensExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + EndpointName endpoint = + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + List instances = new ArrayList<>(); + client.countTokens(endpoint, instances); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void countTokensTest2() throws Exception { + CountTokensResponse expectedResponse = + CountTokensResponse.newBuilder() + .setTotalTokens(730673909) + .setTotalBillableCharacters(1242495501) + .build(); + mockPredictionService.addResponse(expectedResponse); + + String endpoint = "endpoint1741102485"; + List instances = new ArrayList<>(); + + CountTokensResponse actualResponse = client.countTokens(endpoint, instances); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPredictionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CountTokensRequest actualRequest = ((CountTokensRequest) actualRequests.get(0)); + + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(instances, actualRequest.getInstancesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void countTokensExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + + try { + String endpoint = "endpoint1741102485"; + List instances = new ArrayList<>(); + client.countTokens(endpoint, instances); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void streamGenerateContentTest() throws Exception { + GenerateContentResponse expectedResponse = + GenerateContentResponse.newBuilder() + .addAllCandidates(new ArrayList()) + .setPromptFeedback(GenerateContentResponse.PromptFeedback.newBuilder().build()) + .setUsageMetadata(GenerateContentResponse.UsageMetadata.newBuilder().build()) + .build(); + mockPredictionService.addResponse(expectedResponse); + GenerateContentRequest request = + GenerateContentRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setModel("model104069929") + .addAllContents(new ArrayList()) + .addAllTools(new ArrayList()) + .addAllSafetySettings(new ArrayList()) + .setGenerationConfig(GenerationConfig.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamGenerateContentCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void streamGenerateContentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPredictionService.addException(exception); + GenerateContentRequest request = + GenerateContentRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setModel("model104069929") + .addAllContents(new ArrayList()) + .addAllTools(new ArrayList()) + .addAllSafetySettings(new ArrayList()) + .setGenerationConfig(GenerationConfig.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamGenerateContentCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/ChatSessionTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/ChatSessionTest.java new file mode 100644 index 000000000000..20b5cbfcf8d7 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/ChatSessionTest.java @@ -0,0 +1,194 @@ +/* + * 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.generativeai.preview; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; +import static org.mockito.Mockito.when; + +import com.google.cloud.vertexai.api.Candidate; +import com.google.cloud.vertexai.api.Candidate.FinishReason; +import com.google.cloud.vertexai.api.Content; +import com.google.cloud.vertexai.api.FileData; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.Part; +import java.io.IOException; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public final class ChatSessionTest { + private static final String PROJECT = "test_project"; + private static final String LOCATION = "test_location"; + + private static final String SAMPLE_MESSAGE1 = "how are you?"; + private static final String RESPONSE_STREAM_CHUNK1_TEXT = "I do not have any feelings"; + private static final String RESPONSE_STREAM_CHUNK2_TEXT = "But I'm happy to help you!"; + private static final String FULL_RESPONSE_TEXT = + RESPONSE_STREAM_CHUNK1_TEXT + RESPONSE_STREAM_CHUNK2_TEXT; + private static final GenerateContentResponse RESPONSE_STREAM_CHUNK1_RESPONSE = + GenerateContentResponse.newBuilder() + .addCandidates( + Candidate.newBuilder() + .setContent( + Content.newBuilder() + .addParts(Part.newBuilder().setText(RESPONSE_STREAM_CHUNK1_TEXT)))) + .build(); + private static final GenerateContentResponse RESPONSE_STREAM_CHUNK2_RESPONSE = + GenerateContentResponse.newBuilder() + .addCandidates( + Candidate.newBuilder() + .setFinishReason(FinishReason.STOP) + .setContent( + Content.newBuilder() + .addParts(Part.newBuilder().setText(RESPONSE_STREAM_CHUNK2_TEXT)))) + .build(); + private static final GenerateContentResponse RESPONSE_FROM_UNARY_CALL = + GenerateContentResponse.newBuilder() + .addCandidates( + Candidate.newBuilder() + .setContent( + Content.newBuilder().addParts(Part.newBuilder().setText(FULL_RESPONSE_TEXT)))) + .build(); + + @Rule public final MockitoRule mocksRule = MockitoJUnit.rule(); + + @Mock private GenerativeModel mockGenerativeModel; + @Mock private Iterator mockServerStreamIterator; + private ChatSession chat; + + @Before + public void doBeforeEachTest() { + chat = new ChatSession(mockGenerativeModel); + } + + @Test + public void sendMessageStreamWithText_historyContainsTwoTurns() throws IOException { + // (Arrange) Set up the responseStream + ResponseStream responseStream = + new ResponseStream(new ResponseStreamIteratorWithHistory(mockServerStreamIterator)); + when(mockServerStreamIterator.hasNext()).thenReturn(true, true, false); + when(mockServerStreamIterator.next()) + .thenReturn(RESPONSE_STREAM_CHUNK1_RESPONSE, RESPONSE_STREAM_CHUNK2_RESPONSE); + + // (Arrange) Set up the return value of the generateContentStream + when(mockGenerativeModel.generateContentStream( + Arrays.asList(ContentMaker.fromString(SAMPLE_MESSAGE1)), null, null)) + .thenReturn(responseStream); + + // (Act) send request, consume response and get history + ResponseStream returnedResponseStream = + chat.sendMessageStream(SAMPLE_MESSAGE1); + // User needs to consume the response stream; + returnedResponseStream.stream().forEach(element -> {}); + + List history = chat.getHistory(); + // (Assert) 1. The request message is in the first content of history. 2. The streamed output is + // combined into the second content of history. + assertThat(history.get(0).getParts(0).getText()).isEqualTo(SAMPLE_MESSAGE1); + assertThat(history.get(1).getParts(0).getText()).isEqualTo(FULL_RESPONSE_TEXT); + } + + @Test + public void sendMessageStreamWithText_throwsIllegalStateExceptionIfResponseNotConsumed() + throws IOException { + // (Arrange) Set up the responseStream + ResponseStream responseStream = + new ResponseStream(new ResponseStreamIteratorWithHistory(mockServerStreamIterator)); + + // (Arrange) Set up the return value of the generateContentStream + when(mockGenerativeModel.generateContentStream( + Arrays.asList(ContentMaker.fromString(SAMPLE_MESSAGE1)), null, null)) + .thenReturn(responseStream); + + // (Act & Assert) Send request, consume response and get history, but not consume the response + // Assert IllegalStateException will be thrown. + ResponseStream returnedResponseStream = + chat.sendMessageStream(SAMPLE_MESSAGE1); + + IllegalStateException thrown = + assertThrows(IllegalStateException.class, () -> chat.getHistory()); + assertThat(thrown).hasMessageThat().isEqualTo("Response stream is not consumed"); + } + + @Test + public void sendMessageStreamWithContent_throwsIllegalArgumentExceptionForMultipleParts() + throws IOException { + // (Arrange) Prepare a Content that contains multiple parts + Content content = + Content.newBuilder() + .addParts(Part.newBuilder().setText(SAMPLE_MESSAGE1)) + .addParts(Part.newBuilder().setText(SAMPLE_MESSAGE1)) + .build(); + + // (Act & Assert) Send request that contains multiple parts. Assert IllegalArgumentException is + // thrown. + IllegalArgumentException thrown = + assertThrows(IllegalArgumentException.class, () -> chat.sendMessageStream(content)); + assertThat(thrown) + .hasMessageThat() + .isEqualTo("ChatSession only allow text content in one single Part."); + } + + @Test + public void sendMessageStreamWithContent_throwsIllegalArgumentExceptionForMultiModal() + throws IOException { + // (Arrange) Prepare a Content that contains a single image in FileData + Content content = + Content.newBuilder() + .addParts( + Part.newBuilder() + .setFileData( + FileData.newBuilder() + .setMimeType("image/png") + .setFileUri("gs://image.png"))) + .build(); + + // (Act & Assert) Send request that contain other modality. Assert IllegalArgumentException is + // thrown. + IllegalArgumentException thrown = + assertThrows(IllegalArgumentException.class, () -> chat.sendMessageStream(content)); + assertThat(thrown).hasMessageThat().isEqualTo("ChatSession only allow text content."); + } + + @Test + public void sendMessageWithText_historyContainsTwoTurns() throws IOException { + + // (Arrange) Set up the return value of the generateContent + when(mockGenerativeModel.generateContent( + Arrays.asList(ContentMaker.fromString(SAMPLE_MESSAGE1)), null, null)) + .thenReturn(RESPONSE_FROM_UNARY_CALL); + + // (Act) Send text message via sendMessage and get the history. + GenerateContentResponse response = chat.sendMessage(SAMPLE_MESSAGE1); + List history = chat.getHistory(); + + // (Assert) Assert that 1) the first content contains the user request text, and 2) the second + // content in history contains the response. + assertThat(history.get(0).getParts(0).getText()).isEqualTo(SAMPLE_MESSAGE1); + assertThat(history.get(1).getParts(0).getText()).isEqualTo(FULL_RESPONSE_TEXT); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/ContentMakerTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/ContentMakerTest.java new file mode 100644 index 000000000000..9a6710711eb5 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/ContentMakerTest.java @@ -0,0 +1,111 @@ +/* + * 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.generativeai.preview; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.vertexai.api.Content; +import com.google.protobuf.ByteString; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public final class ContentMakerTest { + @Test + public void fromString_returnsContentWithText() { + String stringInput = "string input"; + Content content = ContentMaker.fromString(stringInput); + + assertThat(content.getRole()).isEqualTo("user"); + assertThat(content.getParts(0).getText()).isEqualTo(stringInput); + } + + @Test + public void forRole_returnsContentWithArbitraryRoleSet() { + // Although in our docstring, we said only three roles are acceptable, we make sure the code + // can evolve with arbitrary roles (the backend API doesn't reject any role, nor is it forbidden + // as model input. But the model wasn't trained/evaluated this way). + String role = "arbitrary_role"; + String stringInput = "string input"; + + Content content = ContentMaker.forRole(role).fromString(stringInput); + assertThat(content.getRole()).isEqualTo(role); + assertThat(content.getParts(0).getText()).isEqualTo(stringInput); + + // Make sure when we use the ContentMaker without `forRole` again, the default role becomes + // "user". + Content anotherContent = ContentMaker.fromString(stringInput); + assertThat(anotherContent.getRole()).isEqualTo("user"); + assertThat(anotherContent.getParts(0).getText()).isEqualTo(stringInput); + } + + @Test + public void fromMultiModalData_returnsContentWithMultiModalityParts() + throws MalformedURLException, URISyntaxException { + String stringInput = "string input"; + + String mimeTypeForBytes = "application/octet-stream"; + byte[] bytesInput = new byte[] {1, 2, 3}; + + String mimeTypeForURLinString = "image/jpeg"; + String fileUrlInString = "https://example.com/image.jpg"; + + String mimeTypeForURL = "image/png"; + URL fileUrl = new URL("https://example.com/image.png"); + + String mimeTypeForURI = "image/gif"; + URI fileUri = new URI("https://example.com/image.gif"); + + String mimeTypeForByteString = "image/gif"; + ByteString byteString = ByteString.copyFrom(bytesInput); + + Content content = + ContentMaker.fromMultiModalData( + stringInput, + PartMaker.fromMimeTypeAndData(mimeTypeForBytes, bytesInput), + PartMaker.fromMimeTypeAndData(mimeTypeForURLinString, fileUrlInString), + PartMaker.fromMimeTypeAndData(mimeTypeForURL, fileUrl), + PartMaker.fromMimeTypeAndData(mimeTypeForURI, fileUri), + PartMaker.fromMimeTypeAndData(mimeTypeForByteString, byteString)); + + assertThat(content.getRole()).isEqualTo("user"); + + assertThat(content.getParts(0).getText()).isEqualTo(stringInput); + + assertThat(content.getParts(1).getInlineData().getMimeType()) + .isEqualTo("application/octet-stream"); + assertThat(content.getParts(1).getInlineData().getData()) + .isEqualTo(ByteString.copyFrom(bytesInput)); + + assertThat(content.getParts(2).getFileData().getMimeType()).isEqualTo("image/jpeg"); + assertThat(content.getParts(2).getFileData().getFileUri()).isEqualTo(fileUrlInString); + + assertThat(content.getParts(3).getFileData().getMimeType()).isEqualTo("image/png"); + assertThat(content.getParts(3).getFileData().getFileUri()).isEqualTo(fileUrl.toString()); + + assertThat(content.getParts(4).getFileData().getMimeType()).isEqualTo("image/gif"); + assertThat(content.getParts(4).getFileData().getFileUri()).isEqualTo(fileUri.toString()); + + assertThat(content.getParts(5).getInlineData().getMimeType()).isEqualTo("image/gif"); + assertThat(content.getParts(5).getInlineData().getData()).isEqualTo(byteString); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/GenerativeModelTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/GenerativeModelTest.java new file mode 100644 index 000000000000..349acd0720db --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/GenerativeModelTest.java @@ -0,0 +1,533 @@ +/* + * 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.generativeai.preview; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.cloud.vertexai.VertexAI; +import com.google.cloud.vertexai.api.Content; +import com.google.cloud.vertexai.api.CountTokensRequest; +import com.google.cloud.vertexai.api.CountTokensResponse; +import com.google.cloud.vertexai.api.GenerateContentRequest; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.GenerationConfig; +import com.google.cloud.vertexai.api.HarmCategory; +import com.google.cloud.vertexai.api.Part; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.SafetySetting; +import com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold; +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public final class GenerativeModelTest { + private static final String PROJECT = "test_project"; + private static final String LOCATION = "test_location"; + private static final String MODEL_NAME = "gemini-pro"; + private static final String INVALID_MODEL_NAME = "invalid name"; + private static final GenerationConfig GENERATION_CONFIG = + GenerationConfig.newBuilder().setCandidateCount(1).build(); + private static final GenerationConfig DEFAULT_GENERATION_CONFIG = + GenerationConfig.newBuilder().setCandidateCount(2).build(); + private static final SafetySetting SAFETY_SETTING = + SafetySetting.newBuilder() + .setCategory(HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT) + .setThreshold(HarmBlockThreshold.BLOCK_LOW_AND_ABOVE) + .build(); + private static final SafetySetting DEFAULT_SAFETY_SETTING = + SafetySetting.newBuilder() + .setCategory(HarmCategory.HARM_CATEGORY_HATE_SPEECH) + .setThreshold(HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE) + .build(); + + private static final String TEXT = "What is your name?"; + + private VertexAI vertexAi; + private GenerativeModel model; + private List safetySettings = Arrays.asList(SAFETY_SETTING); + private List defaultSafetySettings = Arrays.asList(DEFAULT_SAFETY_SETTING); + + @Rule public final MockitoRule mocksRule = MockitoJUnit.rule(); + + @Mock private GoogleCredentials mockGoogleCredentials; + + @Mock private PredictionServiceClient mockPredictionServiceClient; + + @Mock + private ServerStreamingCallable + mockServerStreamCallable; + + @Mock private UnaryCallable mockUnaryCallable; + + @Mock private ServerStream mockServerStream; + @Mock private Iterator mockServerStreamIterator; + + @Before + public void doBeforeEachTest() { + vertexAi = new VertexAI(PROJECT, LOCATION, mockGoogleCredentials); + } + + @Test + public void testInstantiateGenerativeModel() { + model = new GenerativeModel(MODEL_NAME, vertexAi); + assertThat(model.getModelName()).isEqualTo(MODEL_NAME); + assertThat(model.getGenerationConfig()).isNull(); + assertThat(model.getSafetySettings()).isNull(); + } + + @Test + public void testInstantiateGenerativeModelWithGenerationConfig() { + model = new GenerativeModel(MODEL_NAME, GENERATION_CONFIG, vertexAi); + assertThat(model.getModelName()).isEqualTo(MODEL_NAME); + assertThat(model.getGenerationConfig()).isEqualTo(GENERATION_CONFIG); + assertThat(model.getSafetySettings()).isNull(); + } + + @Test + public void testInstantiateGenerativeModelwithSafetySettings() { + model = new GenerativeModel(MODEL_NAME, safetySettings, vertexAi); + assertThat(model.getModelName()).isEqualTo(MODEL_NAME); + assertThat(model.getGenerationConfig()).isNull(); + assertThat(model.getSafetySettings()).isEqualTo(safetySettings); + } + + @Test + public void testInstantiateGenerativeModelwithGenerationConfigAndSafetySettings() { + model = new GenerativeModel(MODEL_NAME, GENERATION_CONFIG, safetySettings, vertexAi); + assertThat(model.getModelName()).isEqualTo(MODEL_NAME); + assertThat(model.getGenerationConfig()).isEqualTo(GENERATION_CONFIG); + assertThat(model.getSafetySettings()).isEqualTo(safetySettings); + } + + @Test + public void testInstantiateGenerativeModelWithInvalidName() { + IllegalArgumentException thrown = + assertThrows( + IllegalArgumentException.class, + () -> new GenerativeModel(INVALID_MODEL_NAME, vertexAi)); + assertThat(thrown) + .hasMessageThat() + .isEqualTo( + String.format( + "Invalid model name: %s. Please choose from: %s", + INVALID_MODEL_NAME, Constants.GENERATIVE_MODEL_NAMES)); + } + + @Test + public void testSetGenerationConfig() { + model = new GenerativeModel(MODEL_NAME, vertexAi); + model.setGenerationConfig(GENERATION_CONFIG); + assertThat(model.getGenerationConfig()).isEqualTo(GENERATION_CONFIG); + } + + @Test + public void testSetSafetySettings() { + model = new GenerativeModel(MODEL_NAME, vertexAi); + model.setSafetySettings(safetySettings); + assertThat(model.getSafetySettings()).isEqualTo(safetySettings); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testCountTokenswithText() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + CountTokensResponse unused = model.countTokens(TEXT); + + ArgumentCaptor request = ArgumentCaptor.forClass(CountTokensRequest.class); + verify(mockPredictionServiceClient).countTokens(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()).isEqualTo(TEXT); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testCountTokenswithContents() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + Content content = ContentMaker.fromString(TEXT); + CountTokensResponse unused = model.countTokens(Arrays.asList(content)); + + ArgumentCaptor request = ArgumentCaptor.forClass(CountTokensRequest.class); + verify(mockPredictionServiceClient).countTokens(request.capture()); + assertThat(request.getValue().getContents(0)).isEqualTo(content); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentwithText() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + GenerateContentResponse unused = model.generateContent(TEXT); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()).isEqualTo(TEXT); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentwithContent() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + Content content = + Content.newBuilder().setRole("user").addParts(Part.newBuilder().setText(TEXT)).build(); + GenerateContentResponse unused = model.generateContent(content); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()).isEqualTo(TEXT); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentwithContents() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + Content content = + Content.newBuilder().setRole("user").addParts(Part.newBuilder().setText(TEXT)).build(); + GenerateContentResponse unused = model.generateContent(Arrays.asList(content)); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()).isEqualTo(TEXT); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentwithGenerationConfig() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + GenerateContentResponse unused = model.generateContent(TEXT, GENERATION_CONFIG); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()).isEqualTo(TEXT); + assertThat(request.getValue().getGenerationConfig()).isEqualTo(GENERATION_CONFIG); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentwithDefaultGenerationConfig() throws Exception { + model = new GenerativeModel(MODEL_NAME, DEFAULT_GENERATION_CONFIG, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + GenerateContentResponse unused = model.generateContent(TEXT); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()).isEqualTo(TEXT); + assertThat(request.getValue().getGenerationConfig()).isEqualTo(DEFAULT_GENERATION_CONFIG); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentwithSafetySettings() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + GenerateContentResponse unused = model.generateContent(TEXT, safetySettings); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()).isEqualTo(TEXT); + assertThat(request.getValue().getSafetySettings(0)).isEqualTo(SAFETY_SETTING); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentwithDefaultSafetySettings() throws Exception { + model = new GenerativeModel(MODEL_NAME, defaultSafetySettings, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + GenerateContentResponse unused = model.generateContent(TEXT); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()).isEqualTo(TEXT); + assertThat(request.getValue().getSafetySettings(0)).isEqualTo(DEFAULT_SAFETY_SETTING); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentStreamwithText() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + ResponseStream unused = model.generateContentStream(TEXT); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()) + .isEqualTo("What is your name?"); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentStreamwithContent() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + Content content = + Content.newBuilder().setRole("user").addParts(Part.newBuilder().setText(TEXT)).build(); + ResponseStream unused = model.generateContentStream(content); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()) + .isEqualTo("What is your name?"); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentStreamwithContents() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + Content content = + Content.newBuilder().setRole("user").addParts(Part.newBuilder().setText(TEXT)).build(); + ResponseStream unused = model.generateContentStream(Arrays.asList(content)); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getContents(0).getParts(0).getText()) + .isEqualTo("What is your name?"); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentStreamwithGenerationConfig() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + ResponseStream unused = model.generateContentStream(TEXT, GENERATION_CONFIG); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getGenerationConfig()).isEqualTo(GENERATION_CONFIG); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentStreamwithDefaultGenerationConfig() throws Exception { + model = new GenerativeModel(MODEL_NAME, DEFAULT_GENERATION_CONFIG, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + ResponseStream unused = model.generateContentStream(TEXT); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getGenerationConfig()).isEqualTo(DEFAULT_GENERATION_CONFIG); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentStreamwithSafetySettings() throws Exception { + model = new GenerativeModel(MODEL_NAME, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + ResponseStream unused = model.generateContentStream(TEXT, safetySettings); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getSafetySettings(0)).isEqualTo(SAFETY_SETTING); + } + + @Ignore("need to make the test compatible with Mockito 4.x") + @Test + public void testGenerateContentStreamwithDefaultSafetySettings() throws Exception { + model = new GenerativeModel(MODEL_NAME, defaultSafetySettings, vertexAi); + + Field field = VertexAI.class.getDeclaredField("predictionServiceClient"); + field.setAccessible(true); + field.set(vertexAi, mockPredictionServiceClient); + + when(mockPredictionServiceClient.streamGenerateContentCallable()) + .thenReturn(mockServerStreamCallable); + when(mockServerStreamCallable.call(any(GenerateContentRequest.class))) + .thenReturn(mockServerStream); + when(mockServerStream.iterator()).thenReturn(mockServerStreamIterator); + + ResponseStream unused = model.generateContentStream(TEXT); + + ArgumentCaptor request = + ArgumentCaptor.forClass(GenerateContentRequest.class); + verify(mockServerStreamCallable).call(request.capture()); + assertThat(request.getValue().getSafetySettings(0)).isEqualTo(DEFAULT_SAFETY_SETTING); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/PartMakerTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/PartMakerTest.java new file mode 100644 index 000000000000..890a0ce7bd44 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/PartMakerTest.java @@ -0,0 +1,88 @@ +/* + * 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.generativeai.preview; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.vertexai.api.Part; +import com.google.protobuf.ByteString; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public final class PartMakerTest { + @Test + public void fromMimeTypeAndData_dataInByteArray() { + String mimeTypeForBytes = "application/octet-stream"; + byte[] bytesInput = new byte[] {1, 2, 3}; + + Part part = PartMaker.fromMimeTypeAndData(mimeTypeForBytes, bytesInput); + + assertThat(part.getInlineData().getMimeType()).isEqualTo("application/octet-stream"); + assertThat(part.getInlineData().getData()).isEqualTo(ByteString.copyFrom(bytesInput)); + } + + @Test + public void fromMimeTypeAndData_dataInByteString() { + String mimeTypeForByteString = "image/gif"; + byte[] bytesInput = new byte[] {1, 2, 3}; + ByteString byteString = ByteString.copyFrom(bytesInput); + + Part part = PartMaker.fromMimeTypeAndData(mimeTypeForByteString, byteString); + + assertThat(part.getInlineData().getMimeType()).isEqualTo("image/gif"); + assertThat(part.getInlineData().getData()).isEqualTo(byteString); + } + + @Test + public void fromMimeTypeAndData_dataInString() { + String mimeTypeForURLinString = "image/jpeg"; + String fileUrlInString = "https://example.com/image.jpg"; + + Part part = PartMaker.fromMimeTypeAndData(mimeTypeForURLinString, fileUrlInString); + + assertThat(part.getFileData().getMimeType()).isEqualTo("image/jpeg"); + assertThat(part.getFileData().getFileUri()).isEqualTo(fileUrlInString); + } + + @Test + public void fromMimeTypeAndData_dataInURI() throws URISyntaxException { + + String mimeTypeForURI = "image/png"; + URI fileUri = new URI("https://example.com/image.png"); + Part part = PartMaker.fromMimeTypeAndData(mimeTypeForURI, fileUri); + + assertThat(part.getFileData().getMimeType()).isEqualTo("image/png"); + assertThat(part.getFileData().getFileUri()).isEqualTo(fileUri.toString()); + } + + @Test + public void fromMimeTypeAndData_dataInURL() throws MalformedURLException { + String mimeTypeForUrl = "image/gif"; + URL fileUrl = new URL("https://example.com/image.gif"); + + Part part = PartMaker.fromMimeTypeAndData(mimeTypeForUrl, fileUrl); + + assertThat(part.getFileData().getMimeType()).isEqualTo("image/gif"); + assertThat(part.getFileData().getFileUri()).isEqualTo(fileUrl.toString()); + } +} diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/ResponseHandlerTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/ResponseHandlerTest.java new file mode 100644 index 000000000000..c6e465f54854 --- /dev/null +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/preview/ResponseHandlerTest.java @@ -0,0 +1,134 @@ +/* + * 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.generativeai.preview; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; +import static org.mockito.Mockito.when; + +import com.google.cloud.vertexai.api.Candidate; +import com.google.cloud.vertexai.api.Candidate.FinishReason; +import com.google.cloud.vertexai.api.Citation; +import com.google.cloud.vertexai.api.CitationMetadata; +import com.google.cloud.vertexai.api.Content; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.Part; +import java.util.Arrays; +import java.util.Iterator; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public final class ResponseHandlerTest { + private static final String TEXT_1 = "test "; + private static final String TEXT_2 = "response."; + private static final Content CONTENT = + Content.newBuilder() + .setRole("model") + .addParts(Part.newBuilder().setText(TEXT_1)) + .addParts(Part.newBuilder().setText(TEXT_2)) + .build(); + private static final Citation CITATION_1 = + Citation.newBuilder().setUri("gs://citation1").setStartIndex(1).setEndIndex(2).build(); + private static final Citation CITATION_2 = + Citation.newBuilder().setUri("gs://citation2").setStartIndex(10).setEndIndex(11).build(); + private static final Candidate CANDIDATE_1 = + Candidate.newBuilder() + .setContent(CONTENT) + .setCitationMetadata(CitationMetadata.newBuilder().addCitations(CITATION_1)) + .build(); + private static final Candidate CANDIDATE_2 = + Candidate.newBuilder() + .setContent(CONTENT) + .setCitationMetadata(CitationMetadata.newBuilder().addCitations(CITATION_2)) + .build(); + private static final GenerateContentResponse RESPONSE_1 = + GenerateContentResponse.newBuilder().addCandidates(CANDIDATE_1).build(); + private static final GenerateContentResponse RESPONSE_2 = + GenerateContentResponse.newBuilder().addCandidates(CANDIDATE_2).build(); + private static final GenerateContentResponse INVALID_RESPONSE = + GenerateContentResponse.newBuilder() + .addCandidates(CANDIDATE_1) + .addCandidates(CANDIDATE_2) + .build(); + + @Rule public final MockitoRule mocksRule = MockitoJUnit.rule(); + + @Mock private Iterator mockServerStreamIterator; + + @Test + public void testGetTextFromResponse() { + String text = ResponseHandler.getText(RESPONSE_1); + assertThat(text).isEqualTo(TEXT_1 + TEXT_2); + } + + @Test + public void testGetTextFromInvalidResponse() { + IllegalArgumentException thrown = + assertThrows( + IllegalArgumentException.class, () -> ResponseHandler.getText(INVALID_RESPONSE)); + assertThat(thrown) + .hasMessageThat() + .isEqualTo( + String.format( + "This response should have exactly 1 candidate, but it has %s.", + INVALID_RESPONSE.getCandidatesCount())); + } + + @Test + public void testGetContentFromResponse() { + Content content = ResponseHandler.getContent(RESPONSE_1); + assertThat(content).isEqualTo(CONTENT); + } + + @Test + public void testGetContentFromInvalidResponse() { + IllegalArgumentException thrown = + assertThrows( + IllegalArgumentException.class, () -> ResponseHandler.getContent(INVALID_RESPONSE)); + assertThat(thrown) + .hasMessageThat() + .isEqualTo( + String.format( + "This response should have exactly 1 candidate, but it has %s.", + INVALID_RESPONSE.getCandidatesCount())); + } + + @Test + public void getFinishReason_unspecified() { + FinishReason finishReason = ResponseHandler.getFinishReason(RESPONSE_1); + assertThat(finishReason).isEqualTo(FinishReason.FINISH_REASON_UNSPECIFIED); + } + + @Test + public void testAggregateStreamIntoResponse() { + ResponseStream responseStream = + new ResponseStream(new ResponseStreamIteratorWithHistory(mockServerStreamIterator)); + when(mockServerStreamIterator.hasNext()).thenReturn(true, true, false); + when(mockServerStreamIterator.next()).thenReturn(RESPONSE_1, RESPONSE_2); + + GenerateContentResponse response = ResponseHandler.aggregateStreamIntoResponse(responseStream); + assertThat(ResponseHandler.getText(response)).isEqualTo(TEXT_1 + TEXT_2 + TEXT_1 + TEXT_2); + assertThat(response.getCandidates(0).getCitationMetadata().getCitationsList()) + .isEqualTo(Arrays.asList(CITATION_1, CITATION_2)); + } +} diff --git a/java-vertexai/grpc-google-cloud-vertexai-v1beta1/pom.xml b/java-vertexai/grpc-google-cloud-vertexai-v1beta1/pom.xml new file mode 100644 index 000000000000..397f8bb24704 --- /dev/null +++ b/java-vertexai/grpc-google-cloud-vertexai-v1beta1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-vertexai-v1beta1 + 0.1.0-SNAPSHOT + grpc-google-cloud-vertexai-v1beta1 + GRPC library for google-cloud-vertexai + + com.google.cloud + google-cloud-vertexai-parent + 0.1.0-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-vertexai-v1beta1 + + + com.google.guava + guava + + + diff --git a/java-vertexai/grpc-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointServiceGrpc.java b/java-vertexai/grpc-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointServiceGrpc.java new file mode 100644 index 000000000000..4fb4f0eac81e --- /dev/null +++ b/java-vertexai/grpc-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointServiceGrpc.java @@ -0,0 +1,1192 @@ +/* + * 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 static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * A service for managing Vertex AI's Endpoints.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/vertexai/v1beta1/endpoint_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class EndpointServiceGrpc { + + private EndpointServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.aiplatform.v1beta1.EndpointService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.CreateEndpointRequest, com.google.longrunning.Operation> + getCreateEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateEndpoint", + requestType = com.google.cloud.vertexai.api.CreateEndpointRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.CreateEndpointRequest, com.google.longrunning.Operation> + getCreateEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.CreateEndpointRequest, com.google.longrunning.Operation> + getCreateEndpointMethod; + if ((getCreateEndpointMethod = EndpointServiceGrpc.getCreateEndpointMethod) == null) { + synchronized (EndpointServiceGrpc.class) { + if ((getCreateEndpointMethod = EndpointServiceGrpc.getCreateEndpointMethod) == null) { + EndpointServiceGrpc.getCreateEndpointMethod = + getCreateEndpointMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateEndpoint")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.CreateEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new EndpointServiceMethodDescriptorSupplier("CreateEndpoint")) + .build(); + } + } + } + return getCreateEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.GetEndpointRequest, com.google.cloud.vertexai.api.Endpoint> + getGetEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEndpoint", + requestType = com.google.cloud.vertexai.api.GetEndpointRequest.class, + responseType = com.google.cloud.vertexai.api.Endpoint.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.GetEndpointRequest, com.google.cloud.vertexai.api.Endpoint> + getGetEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.GetEndpointRequest, + com.google.cloud.vertexai.api.Endpoint> + getGetEndpointMethod; + if ((getGetEndpointMethod = EndpointServiceGrpc.getGetEndpointMethod) == null) { + synchronized (EndpointServiceGrpc.class) { + if ((getGetEndpointMethod = EndpointServiceGrpc.getGetEndpointMethod) == null) { + EndpointServiceGrpc.getGetEndpointMethod = + getGetEndpointMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEndpoint")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.GetEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.Endpoint.getDefaultInstance())) + .setSchemaDescriptor( + new EndpointServiceMethodDescriptorSupplier("GetEndpoint")) + .build(); + } + } + } + return getGetEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.ListEndpointsRequest, + com.google.cloud.vertexai.api.ListEndpointsResponse> + getListEndpointsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEndpoints", + requestType = com.google.cloud.vertexai.api.ListEndpointsRequest.class, + responseType = com.google.cloud.vertexai.api.ListEndpointsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.ListEndpointsRequest, + com.google.cloud.vertexai.api.ListEndpointsResponse> + getListEndpointsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.ListEndpointsRequest, + com.google.cloud.vertexai.api.ListEndpointsResponse> + getListEndpointsMethod; + if ((getListEndpointsMethod = EndpointServiceGrpc.getListEndpointsMethod) == null) { + synchronized (EndpointServiceGrpc.class) { + if ((getListEndpointsMethod = EndpointServiceGrpc.getListEndpointsMethod) == null) { + EndpointServiceGrpc.getListEndpointsMethod = + getListEndpointsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListEndpoints")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.ListEndpointsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.ListEndpointsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new EndpointServiceMethodDescriptorSupplier("ListEndpoints")) + .build(); + } + } + } + return getListEndpointsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.UpdateEndpointRequest, + com.google.cloud.vertexai.api.Endpoint> + getUpdateEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateEndpoint", + requestType = com.google.cloud.vertexai.api.UpdateEndpointRequest.class, + responseType = com.google.cloud.vertexai.api.Endpoint.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.UpdateEndpointRequest, + com.google.cloud.vertexai.api.Endpoint> + getUpdateEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.UpdateEndpointRequest, + com.google.cloud.vertexai.api.Endpoint> + getUpdateEndpointMethod; + if ((getUpdateEndpointMethod = EndpointServiceGrpc.getUpdateEndpointMethod) == null) { + synchronized (EndpointServiceGrpc.class) { + if ((getUpdateEndpointMethod = EndpointServiceGrpc.getUpdateEndpointMethod) == null) { + EndpointServiceGrpc.getUpdateEndpointMethod = + getUpdateEndpointMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateEndpoint")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.UpdateEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.Endpoint.getDefaultInstance())) + .setSchemaDescriptor( + new EndpointServiceMethodDescriptorSupplier("UpdateEndpoint")) + .build(); + } + } + } + return getUpdateEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DeleteEndpointRequest, com.google.longrunning.Operation> + getDeleteEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteEndpoint", + requestType = com.google.cloud.vertexai.api.DeleteEndpointRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DeleteEndpointRequest, com.google.longrunning.Operation> + getDeleteEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DeleteEndpointRequest, com.google.longrunning.Operation> + getDeleteEndpointMethod; + if ((getDeleteEndpointMethod = EndpointServiceGrpc.getDeleteEndpointMethod) == null) { + synchronized (EndpointServiceGrpc.class) { + if ((getDeleteEndpointMethod = EndpointServiceGrpc.getDeleteEndpointMethod) == null) { + EndpointServiceGrpc.getDeleteEndpointMethod = + getDeleteEndpointMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteEndpoint")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.DeleteEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new EndpointServiceMethodDescriptorSupplier("DeleteEndpoint")) + .build(); + } + } + } + return getDeleteEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DeployModelRequest, com.google.longrunning.Operation> + getDeployModelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeployModel", + requestType = com.google.cloud.vertexai.api.DeployModelRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DeployModelRequest, com.google.longrunning.Operation> + getDeployModelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DeployModelRequest, com.google.longrunning.Operation> + getDeployModelMethod; + if ((getDeployModelMethod = EndpointServiceGrpc.getDeployModelMethod) == null) { + synchronized (EndpointServiceGrpc.class) { + if ((getDeployModelMethod = EndpointServiceGrpc.getDeployModelMethod) == null) { + EndpointServiceGrpc.getDeployModelMethod = + getDeployModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeployModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.DeployModelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new EndpointServiceMethodDescriptorSupplier("DeployModel")) + .build(); + } + } + } + return getDeployModelMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.UndeployModelRequest, com.google.longrunning.Operation> + getUndeployModelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeployModel", + requestType = com.google.cloud.vertexai.api.UndeployModelRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.UndeployModelRequest, com.google.longrunning.Operation> + getUndeployModelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.UndeployModelRequest, com.google.longrunning.Operation> + getUndeployModelMethod; + if ((getUndeployModelMethod = EndpointServiceGrpc.getUndeployModelMethod) == null) { + synchronized (EndpointServiceGrpc.class) { + if ((getUndeployModelMethod = EndpointServiceGrpc.getUndeployModelMethod) == null) { + EndpointServiceGrpc.getUndeployModelMethod = + getUndeployModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UndeployModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.UndeployModelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new EndpointServiceMethodDescriptorSupplier("UndeployModel")) + .build(); + } + } + } + return getUndeployModelMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.MutateDeployedModelRequest, + com.google.longrunning.Operation> + getMutateDeployedModelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MutateDeployedModel", + requestType = com.google.cloud.vertexai.api.MutateDeployedModelRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.MutateDeployedModelRequest, + com.google.longrunning.Operation> + getMutateDeployedModelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.MutateDeployedModelRequest, + com.google.longrunning.Operation> + getMutateDeployedModelMethod; + if ((getMutateDeployedModelMethod = EndpointServiceGrpc.getMutateDeployedModelMethod) == null) { + synchronized (EndpointServiceGrpc.class) { + if ((getMutateDeployedModelMethod = EndpointServiceGrpc.getMutateDeployedModelMethod) + == null) { + EndpointServiceGrpc.getMutateDeployedModelMethod = + getMutateDeployedModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "MutateDeployedModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.MutateDeployedModelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new EndpointServiceMethodDescriptorSupplier("MutateDeployedModel")) + .build(); + } + } + } + return getMutateDeployedModelMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static EndpointServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EndpointServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EndpointServiceStub(channel, callOptions); + } + }; + return EndpointServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static EndpointServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EndpointServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EndpointServiceBlockingStub(channel, callOptions); + } + }; + return EndpointServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static EndpointServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EndpointServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EndpointServiceFutureStub(channel, callOptions); + } + }; + return EndpointServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * A service for managing Vertex AI's Endpoints.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Creates an Endpoint.
+     * 
+ */ + default void createEndpoint( + com.google.cloud.vertexai.api.CreateEndpointRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets an Endpoint.
+     * 
+ */ + default void getEndpoint( + com.google.cloud.vertexai.api.GetEndpointRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Endpoints in a Location.
+     * 
+ */ + default void listEndpoints( + com.google.cloud.vertexai.api.ListEndpointsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListEndpointsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an Endpoint.
+     * 
+ */ + default void updateEndpoint( + com.google.cloud.vertexai.api.UpdateEndpointRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an Endpoint.
+     * 
+ */ + default void deleteEndpoint( + com.google.cloud.vertexai.api.DeleteEndpointRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Deploys a Model into this Endpoint, creating a DeployedModel within it.
+     * 
+ */ + default void deployModel( + com.google.cloud.vertexai.api.DeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeployModelMethod(), responseObserver); + } + + /** + * + * + *
+     * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and
+     * freeing all resources it's using.
+     * 
+ */ + default void undeployModel( + com.google.cloud.vertexai.api.UndeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeployModelMethod(), responseObserver); + } + + /** + * + * + *
+     * 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).
+     * 
+ */ + default void mutateDeployedModel( + com.google.cloud.vertexai.api.MutateDeployedModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getMutateDeployedModelMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service EndpointService. + * + *
+   * A service for managing Vertex AI's Endpoints.
+   * 
+ */ + public abstract static class EndpointServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return EndpointServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service EndpointService. + * + *
+   * A service for managing Vertex AI's Endpoints.
+   * 
+ */ + public static final class EndpointServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private EndpointServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EndpointServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EndpointServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates an Endpoint.
+     * 
+ */ + public void createEndpoint( + com.google.cloud.vertexai.api.CreateEndpointRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets an Endpoint.
+     * 
+ */ + public void getEndpoint( + com.google.cloud.vertexai.api.GetEndpointRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Endpoints in a Location.
+     * 
+ */ + public void listEndpoints( + com.google.cloud.vertexai.api.ListEndpointsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListEndpointsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an Endpoint.
+     * 
+ */ + public void updateEndpoint( + com.google.cloud.vertexai.api.UpdateEndpointRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an Endpoint.
+     * 
+ */ + public void deleteEndpoint( + com.google.cloud.vertexai.api.DeleteEndpointRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deploys a Model into this Endpoint, creating a DeployedModel within it.
+     * 
+ */ + public void deployModel( + com.google.cloud.vertexai.api.DeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeployModelMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and
+     * freeing all resources it's using.
+     * 
+ */ + public void undeployModel( + com.google.cloud.vertexai.api.UndeployModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUndeployModelMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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).
+     * 
+ */ + public void mutateDeployedModel( + com.google.cloud.vertexai.api.MutateDeployedModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getMutateDeployedModelMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service EndpointService. + * + *
+   * A service for managing Vertex AI's Endpoints.
+   * 
+ */ + public static final class EndpointServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private EndpointServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EndpointServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EndpointServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates an Endpoint.
+     * 
+ */ + public com.google.longrunning.Operation createEndpoint( + com.google.cloud.vertexai.api.CreateEndpointRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets an Endpoint.
+     * 
+ */ + public com.google.cloud.vertexai.api.Endpoint getEndpoint( + com.google.cloud.vertexai.api.GetEndpointRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Endpoints in a Location.
+     * 
+ */ + public com.google.cloud.vertexai.api.ListEndpointsResponse listEndpoints( + com.google.cloud.vertexai.api.ListEndpointsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListEndpointsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an Endpoint.
+     * 
+ */ + public com.google.cloud.vertexai.api.Endpoint updateEndpoint( + com.google.cloud.vertexai.api.UpdateEndpointRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an Endpoint.
+     * 
+ */ + public com.google.longrunning.Operation deleteEndpoint( + com.google.cloud.vertexai.api.DeleteEndpointRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deploys a Model into this Endpoint, creating a DeployedModel within it.
+     * 
+ */ + public com.google.longrunning.Operation deployModel( + com.google.cloud.vertexai.api.DeployModelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeployModelMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and
+     * freeing all resources it's using.
+     * 
+ */ + public com.google.longrunning.Operation undeployModel( + com.google.cloud.vertexai.api.UndeployModelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeployModelMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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).
+     * 
+ */ + public com.google.longrunning.Operation mutateDeployedModel( + com.google.cloud.vertexai.api.MutateDeployedModelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getMutateDeployedModelMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service EndpointService. + * + *
+   * A service for managing Vertex AI's Endpoints.
+   * 
+ */ + public static final class EndpointServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private EndpointServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EndpointServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EndpointServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates an Endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createEndpoint(com.google.cloud.vertexai.api.CreateEndpointRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets an Endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.vertexai.api.Endpoint> + getEndpoint(com.google.cloud.vertexai.api.GetEndpointRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Endpoints in a Location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.vertexai.api.ListEndpointsResponse> + listEndpoints(com.google.cloud.vertexai.api.ListEndpointsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListEndpointsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an Endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.vertexai.api.Endpoint> + updateEndpoint(com.google.cloud.vertexai.api.UpdateEndpointRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an Endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteEndpoint(com.google.cloud.vertexai.api.DeleteEndpointRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deploys a Model into this Endpoint, creating a DeployedModel within it.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deployModel(com.google.cloud.vertexai.api.DeployModelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeployModelMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and
+     * freeing all resources it's using.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + undeployModel(com.google.cloud.vertexai.api.UndeployModelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUndeployModelMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + mutateDeployedModel(com.google.cloud.vertexai.api.MutateDeployedModelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getMutateDeployedModelMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_ENDPOINT = 0; + private static final int METHODID_GET_ENDPOINT = 1; + private static final int METHODID_LIST_ENDPOINTS = 2; + private static final int METHODID_UPDATE_ENDPOINT = 3; + private static final int METHODID_DELETE_ENDPOINT = 4; + private static final int METHODID_DEPLOY_MODEL = 5; + private static final int METHODID_UNDEPLOY_MODEL = 6; + private static final int METHODID_MUTATE_DEPLOYED_MODEL = 7; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_ENDPOINT: + serviceImpl.createEndpoint( + (com.google.cloud.vertexai.api.CreateEndpointRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ENDPOINT: + serviceImpl.getEndpoint( + (com.google.cloud.vertexai.api.GetEndpointRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_ENDPOINTS: + serviceImpl.listEndpoints( + (com.google.cloud.vertexai.api.ListEndpointsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_ENDPOINT: + serviceImpl.updateEndpoint( + (com.google.cloud.vertexai.api.UpdateEndpointRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_ENDPOINT: + serviceImpl.deleteEndpoint( + (com.google.cloud.vertexai.api.DeleteEndpointRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DEPLOY_MODEL: + serviceImpl.deployModel( + (com.google.cloud.vertexai.api.DeployModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDEPLOY_MODEL: + serviceImpl.undeployModel( + (com.google.cloud.vertexai.api.UndeployModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_MUTATE_DEPLOYED_MODEL: + serviceImpl.mutateDeployedModel( + (com.google.cloud.vertexai.api.MutateDeployedModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateEndpointMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.CreateEndpointRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_ENDPOINT))) + .addMethod( + getGetEndpointMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.GetEndpointRequest, + com.google.cloud.vertexai.api.Endpoint>(service, METHODID_GET_ENDPOINT))) + .addMethod( + getListEndpointsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.ListEndpointsRequest, + com.google.cloud.vertexai.api.ListEndpointsResponse>( + service, METHODID_LIST_ENDPOINTS))) + .addMethod( + getUpdateEndpointMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.UpdateEndpointRequest, + com.google.cloud.vertexai.api.Endpoint>(service, METHODID_UPDATE_ENDPOINT))) + .addMethod( + getDeleteEndpointMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.DeleteEndpointRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_ENDPOINT))) + .addMethod( + getDeployModelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.DeployModelRequest, + com.google.longrunning.Operation>(service, METHODID_DEPLOY_MODEL))) + .addMethod( + getUndeployModelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.UndeployModelRequest, + com.google.longrunning.Operation>(service, METHODID_UNDEPLOY_MODEL))) + .addMethod( + getMutateDeployedModelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.MutateDeployedModelRequest, + com.google.longrunning.Operation>(service, METHODID_MUTATE_DEPLOYED_MODEL))) + .build(); + } + + private abstract static class EndpointServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + EndpointServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("EndpointService"); + } + } + + private static final class EndpointServiceFileDescriptorSupplier + extends EndpointServiceBaseDescriptorSupplier { + EndpointServiceFileDescriptorSupplier() {} + } + + private static final class EndpointServiceMethodDescriptorSupplier + extends EndpointServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + EndpointServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (EndpointServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new EndpointServiceFileDescriptorSupplier()) + .addMethod(getCreateEndpointMethod()) + .addMethod(getGetEndpointMethod()) + .addMethod(getListEndpointsMethod()) + .addMethod(getUpdateEndpointMethod()) + .addMethod(getDeleteEndpointMethod()) + .addMethod(getDeployModelMethod()) + .addMethod(getUndeployModelMethod()) + .addMethod(getMutateDeployedModelMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-vertexai/grpc-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictionServiceGrpc.java b/java-vertexai/grpc-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictionServiceGrpc.java new file mode 100644 index 000000000000..70a28047d4fa --- /dev/null +++ b/java-vertexai/grpc-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictionServiceGrpc.java @@ -0,0 +1,1439 @@ +/* + * 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 static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * A service for online predictions and explanations.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/vertexai/v1beta1/prediction_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class PredictionServiceGrpc { + + private PredictionServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.aiplatform.v1beta1.PredictionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.PredictRequest, + com.google.cloud.vertexai.api.PredictResponse> + getPredictMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Predict", + requestType = com.google.cloud.vertexai.api.PredictRequest.class, + responseType = com.google.cloud.vertexai.api.PredictResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.PredictRequest, + com.google.cloud.vertexai.api.PredictResponse> + getPredictMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.PredictRequest, + com.google.cloud.vertexai.api.PredictResponse> + getPredictMethod; + if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) { + PredictionServiceGrpc.getPredictMethod = + getPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Predict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.PredictRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.PredictResponse.getDefaultInstance())) + .setSchemaDescriptor(new PredictionServiceMethodDescriptorSupplier("Predict")) + .build(); + } + } + } + return getPredictMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.RawPredictRequest, com.google.api.HttpBody> + getRawPredictMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RawPredict", + requestType = com.google.cloud.vertexai.api.RawPredictRequest.class, + responseType = com.google.api.HttpBody.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.RawPredictRequest, com.google.api.HttpBody> + getRawPredictMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.RawPredictRequest, com.google.api.HttpBody> + getRawPredictMethod; + if ((getRawPredictMethod = PredictionServiceGrpc.getRawPredictMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getRawPredictMethod = PredictionServiceGrpc.getRawPredictMethod) == null) { + PredictionServiceGrpc.getRawPredictMethod = + getRawPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RawPredict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.RawPredictRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.HttpBody.getDefaultInstance())) + .setSchemaDescriptor( + new PredictionServiceMethodDescriptorSupplier("RawPredict")) + .build(); + } + } + } + return getRawPredictMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DirectPredictRequest, + com.google.cloud.vertexai.api.DirectPredictResponse> + getDirectPredictMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DirectPredict", + requestType = com.google.cloud.vertexai.api.DirectPredictRequest.class, + responseType = com.google.cloud.vertexai.api.DirectPredictResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DirectPredictRequest, + com.google.cloud.vertexai.api.DirectPredictResponse> + getDirectPredictMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DirectPredictRequest, + com.google.cloud.vertexai.api.DirectPredictResponse> + getDirectPredictMethod; + if ((getDirectPredictMethod = PredictionServiceGrpc.getDirectPredictMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getDirectPredictMethod = PredictionServiceGrpc.getDirectPredictMethod) == null) { + PredictionServiceGrpc.getDirectPredictMethod = + getDirectPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DirectPredict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.DirectPredictRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.DirectPredictResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PredictionServiceMethodDescriptorSupplier("DirectPredict")) + .build(); + } + } + } + return getDirectPredictMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DirectRawPredictRequest, + com.google.cloud.vertexai.api.DirectRawPredictResponse> + getDirectRawPredictMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DirectRawPredict", + requestType = com.google.cloud.vertexai.api.DirectRawPredictRequest.class, + responseType = com.google.cloud.vertexai.api.DirectRawPredictResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DirectRawPredictRequest, + com.google.cloud.vertexai.api.DirectRawPredictResponse> + getDirectRawPredictMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.DirectRawPredictRequest, + com.google.cloud.vertexai.api.DirectRawPredictResponse> + getDirectRawPredictMethod; + if ((getDirectRawPredictMethod = PredictionServiceGrpc.getDirectRawPredictMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getDirectRawPredictMethod = PredictionServiceGrpc.getDirectRawPredictMethod) == null) { + PredictionServiceGrpc.getDirectRawPredictMethod = + getDirectRawPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DirectRawPredict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.DirectRawPredictRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.DirectRawPredictResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PredictionServiceMethodDescriptorSupplier("DirectRawPredict")) + .build(); + } + } + } + return getDirectRawPredictMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.StreamingPredictRequest, + com.google.cloud.vertexai.api.StreamingPredictResponse> + getStreamingPredictMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamingPredict", + requestType = com.google.cloud.vertexai.api.StreamingPredictRequest.class, + responseType = com.google.cloud.vertexai.api.StreamingPredictResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.StreamingPredictRequest, + com.google.cloud.vertexai.api.StreamingPredictResponse> + getStreamingPredictMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.StreamingPredictRequest, + com.google.cloud.vertexai.api.StreamingPredictResponse> + getStreamingPredictMethod; + if ((getStreamingPredictMethod = PredictionServiceGrpc.getStreamingPredictMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getStreamingPredictMethod = PredictionServiceGrpc.getStreamingPredictMethod) == null) { + PredictionServiceGrpc.getStreamingPredictMethod = + getStreamingPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingPredict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.StreamingPredictRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.StreamingPredictResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PredictionServiceMethodDescriptorSupplier("StreamingPredict")) + .build(); + } + } + } + return getStreamingPredictMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.StreamingPredictRequest, + com.google.cloud.vertexai.api.StreamingPredictResponse> + getServerStreamingPredictMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ServerStreamingPredict", + requestType = com.google.cloud.vertexai.api.StreamingPredictRequest.class, + responseType = com.google.cloud.vertexai.api.StreamingPredictResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.StreamingPredictRequest, + com.google.cloud.vertexai.api.StreamingPredictResponse> + getServerStreamingPredictMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.StreamingPredictRequest, + com.google.cloud.vertexai.api.StreamingPredictResponse> + getServerStreamingPredictMethod; + if ((getServerStreamingPredictMethod = PredictionServiceGrpc.getServerStreamingPredictMethod) + == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getServerStreamingPredictMethod = + PredictionServiceGrpc.getServerStreamingPredictMethod) + == null) { + PredictionServiceGrpc.getServerStreamingPredictMethod = + getServerStreamingPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ServerStreamingPredict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.StreamingPredictRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.StreamingPredictResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PredictionServiceMethodDescriptorSupplier("ServerStreamingPredict")) + .build(); + } + } + } + return getServerStreamingPredictMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.StreamingRawPredictRequest, + com.google.cloud.vertexai.api.StreamingRawPredictResponse> + getStreamingRawPredictMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamingRawPredict", + requestType = com.google.cloud.vertexai.api.StreamingRawPredictRequest.class, + responseType = com.google.cloud.vertexai.api.StreamingRawPredictResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.StreamingRawPredictRequest, + com.google.cloud.vertexai.api.StreamingRawPredictResponse> + getStreamingRawPredictMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.StreamingRawPredictRequest, + com.google.cloud.vertexai.api.StreamingRawPredictResponse> + getStreamingRawPredictMethod; + if ((getStreamingRawPredictMethod = PredictionServiceGrpc.getStreamingRawPredictMethod) + == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getStreamingRawPredictMethod = PredictionServiceGrpc.getStreamingRawPredictMethod) + == null) { + PredictionServiceGrpc.getStreamingRawPredictMethod = + getStreamingRawPredictMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "StreamingRawPredict")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.StreamingRawPredictRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.StreamingRawPredictResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PredictionServiceMethodDescriptorSupplier("StreamingRawPredict")) + .build(); + } + } + } + return getStreamingRawPredictMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.ExplainRequest, + com.google.cloud.vertexai.api.ExplainResponse> + getExplainMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Explain", + requestType = com.google.cloud.vertexai.api.ExplainRequest.class, + responseType = com.google.cloud.vertexai.api.ExplainResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.ExplainRequest, + com.google.cloud.vertexai.api.ExplainResponse> + getExplainMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.ExplainRequest, + com.google.cloud.vertexai.api.ExplainResponse> + getExplainMethod; + if ((getExplainMethod = PredictionServiceGrpc.getExplainMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getExplainMethod = PredictionServiceGrpc.getExplainMethod) == null) { + PredictionServiceGrpc.getExplainMethod = + getExplainMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Explain")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.ExplainRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.ExplainResponse.getDefaultInstance())) + .setSchemaDescriptor(new PredictionServiceMethodDescriptorSupplier("Explain")) + .build(); + } + } + } + return getExplainMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.CountTokensRequest, + com.google.cloud.vertexai.api.CountTokensResponse> + getCountTokensMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CountTokens", + requestType = com.google.cloud.vertexai.api.CountTokensRequest.class, + responseType = com.google.cloud.vertexai.api.CountTokensResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.CountTokensRequest, + com.google.cloud.vertexai.api.CountTokensResponse> + getCountTokensMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.CountTokensRequest, + com.google.cloud.vertexai.api.CountTokensResponse> + getCountTokensMethod; + if ((getCountTokensMethod = PredictionServiceGrpc.getCountTokensMethod) == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getCountTokensMethod = PredictionServiceGrpc.getCountTokensMethod) == null) { + PredictionServiceGrpc.getCountTokensMethod = + getCountTokensMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CountTokens")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.CountTokensRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.CountTokensResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PredictionServiceMethodDescriptorSupplier("CountTokens")) + .build(); + } + } + } + return getCountTokensMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.GenerateContentRequest, + com.google.cloud.vertexai.api.GenerateContentResponse> + getStreamGenerateContentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamGenerateContent", + requestType = com.google.cloud.vertexai.api.GenerateContentRequest.class, + responseType = com.google.cloud.vertexai.api.GenerateContentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.GenerateContentRequest, + com.google.cloud.vertexai.api.GenerateContentResponse> + getStreamGenerateContentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.vertexai.api.GenerateContentRequest, + com.google.cloud.vertexai.api.GenerateContentResponse> + getStreamGenerateContentMethod; + if ((getStreamGenerateContentMethod = PredictionServiceGrpc.getStreamGenerateContentMethod) + == null) { + synchronized (PredictionServiceGrpc.class) { + if ((getStreamGenerateContentMethod = PredictionServiceGrpc.getStreamGenerateContentMethod) + == null) { + PredictionServiceGrpc.getStreamGenerateContentMethod = + getStreamGenerateContentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "StreamGenerateContent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.GenerateContentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.vertexai.api.GenerateContentResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PredictionServiceMethodDescriptorSupplier("StreamGenerateContent")) + .build(); + } + } + } + return getStreamGenerateContentMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PredictionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceStub(channel, callOptions); + } + }; + return PredictionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PredictionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceBlockingStub(channel, callOptions); + } + }; + return PredictionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PredictionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PredictionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceFutureStub(channel, callOptions); + } + }; + return PredictionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * A service for online predictions and explanations.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Perform an online prediction.
+     * 
+ */ + default void predict( + com.google.cloud.vertexai.api.PredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPredictMethod(), responseObserver); + } + + /** + * + * + *
+     * Perform an online prediction with an arbitrary HTTP payload.
+     * The response includes the following HTTP headers:
+     * * `X-Vertex-AI-Endpoint-Id`: ID of the
+     * [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] that served this
+     * prediction.
+     * * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's
+     * [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] that served
+     * this prediction.
+     * 
+ */ + default void rawPredict( + com.google.cloud.vertexai.api.RawPredictRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRawPredictMethod(), responseObserver); + } + + /** + * + * + *
+     * Perform an unary online prediction request for Vertex first-party products
+     * and frameworks.
+     * 
+ */ + default void directPredict( + com.google.cloud.vertexai.api.DirectPredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDirectPredictMethod(), responseObserver); + } + + /** + * + * + *
+     * Perform an online prediction request through gRPC.
+     * 
+ */ + default void directRawPredict( + com.google.cloud.vertexai.api.DirectRawPredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDirectRawPredictMethod(), responseObserver); + } + + /** + * + * + *
+     * Perform a streaming online prediction request for Vertex first-party
+     * products and frameworks.
+     * 
+ */ + default io.grpc.stub.StreamObserver + streamingPredict( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getStreamingPredictMethod(), responseObserver); + } + + /** + * + * + *
+     * Perform a server-side streaming online prediction request for Vertex
+     * LLM streaming.
+     * 
+ */ + default void serverStreamingPredict( + com.google.cloud.vertexai.api.StreamingPredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getServerStreamingPredictMethod(), responseObserver); + } + + /** + * + * + *
+     * Perform a streaming online prediction request through gRPC.
+     * 
+ */ + default io.grpc.stub.StreamObserver + streamingRawPredict( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getStreamingRawPredictMethod(), responseObserver); + } + + /** + * + * + *
+     * Perform an online explanation.
+     * 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.
+     * 
+ */ + default void explain( + com.google.cloud.vertexai.api.ExplainRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExplainMethod(), responseObserver); + } + + /** + * + * + *
+     * Perform a token counting.
+     * 
+ */ + default void countTokens( + com.google.cloud.vertexai.api.CountTokensRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCountTokensMethod(), responseObserver); + } + + /** + * + * + *
+     * Generate content with multimodal inputs with streaming support.
+     * 
+ */ + default void streamGenerateContent( + com.google.cloud.vertexai.api.GenerateContentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStreamGenerateContentMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service PredictionService. + * + *
+   * A service for online predictions and explanations.
+   * 
+ */ + public abstract static class PredictionServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return PredictionServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service PredictionService. + * + *
+   * A service for online predictions and explanations.
+   * 
+ */ + public static final class PredictionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private PredictionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Perform an online prediction.
+     * 
+ */ + public void predict( + com.google.cloud.vertexai.api.PredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPredictMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Perform an online prediction with an arbitrary HTTP payload.
+     * The response includes the following HTTP headers:
+     * * `X-Vertex-AI-Endpoint-Id`: ID of the
+     * [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] that served this
+     * prediction.
+     * * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's
+     * [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] that served
+     * this prediction.
+     * 
+ */ + public void rawPredict( + com.google.cloud.vertexai.api.RawPredictRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRawPredictMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Perform an unary online prediction request for Vertex first-party products
+     * and frameworks.
+     * 
+ */ + public void directPredict( + com.google.cloud.vertexai.api.DirectPredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDirectPredictMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Perform an online prediction request through gRPC.
+     * 
+ */ + public void directRawPredict( + com.google.cloud.vertexai.api.DirectRawPredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDirectRawPredictMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Perform a streaming online prediction request for Vertex first-party
+     * products and frameworks.
+     * 
+ */ + public io.grpc.stub.StreamObserver + streamingPredict( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getStreamingPredictMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * Perform a server-side streaming online prediction request for Vertex
+     * LLM streaming.
+     * 
+ */ + public void serverStreamingPredict( + com.google.cloud.vertexai.api.StreamingPredictRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getServerStreamingPredictMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Perform a streaming online prediction request through gRPC.
+     * 
+ */ + public io.grpc.stub.StreamObserver + streamingRawPredict( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getStreamingRawPredictMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * Perform an online explanation.
+     * 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.
+     * 
+ */ + public void explain( + com.google.cloud.vertexai.api.ExplainRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExplainMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Perform a token counting.
+     * 
+ */ + public void countTokens( + com.google.cloud.vertexai.api.CountTokensRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCountTokensMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Generate content with multimodal inputs with streaming support.
+     * 
+ */ + public void streamGenerateContent( + com.google.cloud.vertexai.api.GenerateContentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getStreamGenerateContentMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service PredictionService. + * + *
+   * A service for online predictions and explanations.
+   * 
+ */ + public static final class PredictionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PredictionServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Perform an online prediction.
+     * 
+ */ + public com.google.cloud.vertexai.api.PredictResponse predict( + com.google.cloud.vertexai.api.PredictRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPredictMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Perform an online prediction with an arbitrary HTTP payload.
+     * The response includes the following HTTP headers:
+     * * `X-Vertex-AI-Endpoint-Id`: ID of the
+     * [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] that served this
+     * prediction.
+     * * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's
+     * [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] that served
+     * this prediction.
+     * 
+ */ + public com.google.api.HttpBody rawPredict( + com.google.cloud.vertexai.api.RawPredictRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRawPredictMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Perform an unary online prediction request for Vertex first-party products
+     * and frameworks.
+     * 
+ */ + public com.google.cloud.vertexai.api.DirectPredictResponse directPredict( + com.google.cloud.vertexai.api.DirectPredictRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDirectPredictMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Perform an online prediction request through gRPC.
+     * 
+ */ + public com.google.cloud.vertexai.api.DirectRawPredictResponse directRawPredict( + com.google.cloud.vertexai.api.DirectRawPredictRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDirectRawPredictMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Perform a server-side streaming online prediction request for Vertex
+     * LLM streaming.
+     * 
+ */ + public java.util.Iterator + serverStreamingPredict(com.google.cloud.vertexai.api.StreamingPredictRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getServerStreamingPredictMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Perform an online explanation.
+     * 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.
+     * 
+ */ + public com.google.cloud.vertexai.api.ExplainResponse explain( + com.google.cloud.vertexai.api.ExplainRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getExplainMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Perform a token counting.
+     * 
+ */ + public com.google.cloud.vertexai.api.CountTokensResponse countTokens( + com.google.cloud.vertexai.api.CountTokensRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCountTokensMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generate content with multimodal inputs with streaming support.
+     * 
+ */ + public java.util.Iterator + streamGenerateContent(com.google.cloud.vertexai.api.GenerateContentRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getStreamGenerateContentMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service PredictionService. + * + *
+   * A service for online predictions and explanations.
+   * 
+ */ + public static final class PredictionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PredictionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PredictionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PredictionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Perform an online prediction.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.vertexai.api.PredictResponse> + predict(com.google.cloud.vertexai.api.PredictRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPredictMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Perform an online prediction with an arbitrary HTTP payload.
+     * The response includes the following HTTP headers:
+     * * `X-Vertex-AI-Endpoint-Id`: ID of the
+     * [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] that served this
+     * prediction.
+     * * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's
+     * [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] that served
+     * this prediction.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture rawPredict( + com.google.cloud.vertexai.api.RawPredictRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRawPredictMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Perform an unary online prediction request for Vertex first-party products
+     * and frameworks.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.vertexai.api.DirectPredictResponse> + directPredict(com.google.cloud.vertexai.api.DirectPredictRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDirectPredictMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Perform an online prediction request through gRPC.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.vertexai.api.DirectRawPredictResponse> + directRawPredict(com.google.cloud.vertexai.api.DirectRawPredictRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDirectRawPredictMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Perform an online explanation.
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.vertexai.api.ExplainResponse> + explain(com.google.cloud.vertexai.api.ExplainRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getExplainMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Perform a token counting.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.vertexai.api.CountTokensResponse> + countTokens(com.google.cloud.vertexai.api.CountTokensRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCountTokensMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_PREDICT = 0; + private static final int METHODID_RAW_PREDICT = 1; + private static final int METHODID_DIRECT_PREDICT = 2; + private static final int METHODID_DIRECT_RAW_PREDICT = 3; + private static final int METHODID_SERVER_STREAMING_PREDICT = 4; + private static final int METHODID_EXPLAIN = 5; + private static final int METHODID_COUNT_TOKENS = 6; + private static final int METHODID_STREAM_GENERATE_CONTENT = 7; + private static final int METHODID_STREAMING_PREDICT = 8; + private static final int METHODID_STREAMING_RAW_PREDICT = 9; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_PREDICT: + serviceImpl.predict( + (com.google.cloud.vertexai.api.PredictRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_RAW_PREDICT: + serviceImpl.rawPredict( + (com.google.cloud.vertexai.api.RawPredictRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DIRECT_PREDICT: + serviceImpl.directPredict( + (com.google.cloud.vertexai.api.DirectPredictRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DIRECT_RAW_PREDICT: + serviceImpl.directRawPredict( + (com.google.cloud.vertexai.api.DirectRawPredictRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SERVER_STREAMING_PREDICT: + serviceImpl.serverStreamingPredict( + (com.google.cloud.vertexai.api.StreamingPredictRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_EXPLAIN: + serviceImpl.explain( + (com.google.cloud.vertexai.api.ExplainRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_COUNT_TOKENS: + serviceImpl.countTokens( + (com.google.cloud.vertexai.api.CountTokensRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_STREAM_GENERATE_CONTENT: + serviceImpl.streamGenerateContent( + (com.google.cloud.vertexai.api.GenerateContentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_STREAMING_PREDICT: + return (io.grpc.stub.StreamObserver) + serviceImpl.streamingPredict( + (io.grpc.stub.StreamObserver< + com.google.cloud.vertexai.api.StreamingPredictResponse>) + responseObserver); + case METHODID_STREAMING_RAW_PREDICT: + return (io.grpc.stub.StreamObserver) + serviceImpl.streamingRawPredict( + (io.grpc.stub.StreamObserver< + com.google.cloud.vertexai.api.StreamingRawPredictResponse>) + responseObserver); + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getPredictMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.PredictRequest, + com.google.cloud.vertexai.api.PredictResponse>(service, METHODID_PREDICT))) + .addMethod( + getRawPredictMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.RawPredictRequest, com.google.api.HttpBody>( + service, METHODID_RAW_PREDICT))) + .addMethod( + getDirectPredictMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.DirectPredictRequest, + com.google.cloud.vertexai.api.DirectPredictResponse>( + service, METHODID_DIRECT_PREDICT))) + .addMethod( + getDirectRawPredictMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.DirectRawPredictRequest, + com.google.cloud.vertexai.api.DirectRawPredictResponse>( + service, METHODID_DIRECT_RAW_PREDICT))) + .addMethod( + getStreamingPredictMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.cloud.vertexai.api.StreamingPredictRequest, + com.google.cloud.vertexai.api.StreamingPredictResponse>( + service, METHODID_STREAMING_PREDICT))) + .addMethod( + getServerStreamingPredictMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.cloud.vertexai.api.StreamingPredictRequest, + com.google.cloud.vertexai.api.StreamingPredictResponse>( + service, METHODID_SERVER_STREAMING_PREDICT))) + .addMethod( + getStreamingRawPredictMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.cloud.vertexai.api.StreamingRawPredictRequest, + com.google.cloud.vertexai.api.StreamingRawPredictResponse>( + service, METHODID_STREAMING_RAW_PREDICT))) + .addMethod( + getExplainMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.ExplainRequest, + com.google.cloud.vertexai.api.ExplainResponse>(service, METHODID_EXPLAIN))) + .addMethod( + getCountTokensMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.vertexai.api.CountTokensRequest, + com.google.cloud.vertexai.api.CountTokensResponse>( + service, METHODID_COUNT_TOKENS))) + .addMethod( + getStreamGenerateContentMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.cloud.vertexai.api.GenerateContentRequest, + com.google.cloud.vertexai.api.GenerateContentResponse>( + service, METHODID_STREAM_GENERATE_CONTENT))) + .build(); + } + + private abstract static class PredictionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PredictionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PredictionService"); + } + } + + private static final class PredictionServiceFileDescriptorSupplier + extends PredictionServiceBaseDescriptorSupplier { + PredictionServiceFileDescriptorSupplier() {} + } + + private static final class PredictionServiceMethodDescriptorSupplier + extends PredictionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + PredictionServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (PredictionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PredictionServiceFileDescriptorSupplier()) + .addMethod(getPredictMethod()) + .addMethod(getRawPredictMethod()) + .addMethod(getDirectPredictMethod()) + .addMethod(getDirectRawPredictMethod()) + .addMethod(getStreamingPredictMethod()) + .addMethod(getServerStreamingPredictMethod()) + .addMethod(getStreamingRawPredictMethod()) + .addMethod(getExplainMethod()) + .addMethod(getCountTokensMethod()) + .addMethod(getStreamGenerateContentMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-vertexai/pom.xml b/java-vertexai/pom.xml new file mode 100644 index 000000000000..49dbe961e959 --- /dev/null +++ b/java-vertexai/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.google.cloud + google-cloud-vertexai-parent + pom + 0.1.0-SNAPSHOT + Google VertexAI API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.26.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-vertexai-parent + + + + + + com.google.cloud + google-cloud-vertexai + 0.1.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-vertexai-v1beta1 + 0.1.0-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-vertexai-v1beta1 + 0.1.0-SNAPSHOT + + + + + + google-cloud-vertexai + grpc-google-cloud-vertexai-v1beta1 + proto-google-cloud-vertexai-v1beta1 + google-cloud-vertexai-bom + + diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/clirr-ignored-differences.xml b/java-vertexai/proto-google-cloud-vertexai-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..d53a1fa3b4f7 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/vertexai/api/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/vertexai/api/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/vertexai/api/*OrBuilder + boolean has*(*) + + diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/pom.xml b/java-vertexai/proto-google-cloud-vertexai-v1beta1/pom.xml new file mode 100644 index 000000000000..e61d966e4e55 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-vertexai-v1beta1 + 0.1.0-SNAPSHOT + proto-google-cloud-vertexai-v1beta1 + Proto library for google-cloud-vertexai + + com.google.cloud + google-cloud-vertexai-parent + 0.1.0-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AcceleratorType.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AcceleratorType.java new file mode 100644 index 000000000000..8e8d1595b5a7 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AcceleratorType.java @@ -0,0 +1,418 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/accelerator_type.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Represents a hardware accelerator type.
+ * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.AcceleratorType} + */ +public enum AcceleratorType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified accelerator type, which means no accelerator.
+   * 
+ * + * ACCELERATOR_TYPE_UNSPECIFIED = 0; + */ + ACCELERATOR_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Nvidia Tesla K80 GPU.
+   * 
+ * + * NVIDIA_TESLA_K80 = 1; + */ + NVIDIA_TESLA_K80(1), + /** + * + * + *
+   * Nvidia Tesla P100 GPU.
+   * 
+ * + * NVIDIA_TESLA_P100 = 2; + */ + NVIDIA_TESLA_P100(2), + /** + * + * + *
+   * Nvidia Tesla V100 GPU.
+   * 
+ * + * NVIDIA_TESLA_V100 = 3; + */ + NVIDIA_TESLA_V100(3), + /** + * + * + *
+   * Nvidia Tesla P4 GPU.
+   * 
+ * + * NVIDIA_TESLA_P4 = 4; + */ + NVIDIA_TESLA_P4(4), + /** + * + * + *
+   * Nvidia Tesla T4 GPU.
+   * 
+ * + * NVIDIA_TESLA_T4 = 5; + */ + NVIDIA_TESLA_T4(5), + /** + * + * + *
+   * Nvidia Tesla A100 GPU.
+   * 
+ * + * NVIDIA_TESLA_A100 = 8; + */ + NVIDIA_TESLA_A100(8), + /** + * + * + *
+   * Nvidia A100 80GB GPU.
+   * 
+ * + * NVIDIA_A100_80GB = 9; + */ + NVIDIA_A100_80GB(9), + /** + * + * + *
+   * Nvidia L4 GPU.
+   * 
+ * + * NVIDIA_L4 = 11; + */ + NVIDIA_L4(11), + /** + * + * + *
+   * Nvidia H100 80Gb GPU.
+   * 
+ * + * NVIDIA_H100_80GB = 13; + */ + NVIDIA_H100_80GB(13), + /** + * + * + *
+   * TPU v2.
+   * 
+ * + * TPU_V2 = 6; + */ + TPU_V2(6), + /** + * + * + *
+   * TPU v3.
+   * 
+ * + * TPU_V3 = 7; + */ + TPU_V3(7), + /** + * + * + *
+   * TPU v4.
+   * 
+ * + * TPU_V4_POD = 10; + */ + TPU_V4_POD(10), + /** + * + * + *
+   * TPU v5.
+   * 
+ * + * TPU_V5_LITEPOD = 12; + */ + TPU_V5_LITEPOD(12), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified accelerator type, which means no accelerator.
+   * 
+ * + * ACCELERATOR_TYPE_UNSPECIFIED = 0; + */ + public static final int ACCELERATOR_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Nvidia Tesla K80 GPU.
+   * 
+ * + * NVIDIA_TESLA_K80 = 1; + */ + public static final int NVIDIA_TESLA_K80_VALUE = 1; + /** + * + * + *
+   * Nvidia Tesla P100 GPU.
+   * 
+ * + * NVIDIA_TESLA_P100 = 2; + */ + public static final int NVIDIA_TESLA_P100_VALUE = 2; + /** + * + * + *
+   * Nvidia Tesla V100 GPU.
+   * 
+ * + * NVIDIA_TESLA_V100 = 3; + */ + public static final int NVIDIA_TESLA_V100_VALUE = 3; + /** + * + * + *
+   * Nvidia Tesla P4 GPU.
+   * 
+ * + * NVIDIA_TESLA_P4 = 4; + */ + public static final int NVIDIA_TESLA_P4_VALUE = 4; + /** + * + * + *
+   * Nvidia Tesla T4 GPU.
+   * 
+ * + * NVIDIA_TESLA_T4 = 5; + */ + public static final int NVIDIA_TESLA_T4_VALUE = 5; + /** + * + * + *
+   * Nvidia Tesla A100 GPU.
+   * 
+ * + * NVIDIA_TESLA_A100 = 8; + */ + public static final int NVIDIA_TESLA_A100_VALUE = 8; + /** + * + * + *
+   * Nvidia A100 80GB GPU.
+   * 
+ * + * NVIDIA_A100_80GB = 9; + */ + public static final int NVIDIA_A100_80GB_VALUE = 9; + /** + * + * + *
+   * Nvidia L4 GPU.
+   * 
+ * + * NVIDIA_L4 = 11; + */ + public static final int NVIDIA_L4_VALUE = 11; + /** + * + * + *
+   * Nvidia H100 80Gb GPU.
+   * 
+ * + * NVIDIA_H100_80GB = 13; + */ + public static final int NVIDIA_H100_80GB_VALUE = 13; + /** + * + * + *
+   * TPU v2.
+   * 
+ * + * TPU_V2 = 6; + */ + public static final int TPU_V2_VALUE = 6; + /** + * + * + *
+   * TPU v3.
+   * 
+ * + * TPU_V3 = 7; + */ + public static final int TPU_V3_VALUE = 7; + /** + * + * + *
+   * TPU v4.
+   * 
+ * + * TPU_V4_POD = 10; + */ + public static final int TPU_V4_POD_VALUE = 10; + /** + * + * + *
+   * TPU v5.
+   * 
+ * + * TPU_V5_LITEPOD = 12; + */ + public static final int TPU_V5_LITEPOD_VALUE = 12; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AcceleratorType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static AcceleratorType forNumber(int value) { + switch (value) { + case 0: + return ACCELERATOR_TYPE_UNSPECIFIED; + case 1: + return NVIDIA_TESLA_K80; + case 2: + return NVIDIA_TESLA_P100; + case 3: + return NVIDIA_TESLA_V100; + case 4: + return NVIDIA_TESLA_P4; + case 5: + return NVIDIA_TESLA_T4; + case 8: + return NVIDIA_TESLA_A100; + case 9: + return NVIDIA_A100_80GB; + case 11: + return NVIDIA_L4; + case 13: + return NVIDIA_H100_80GB; + case 6: + return TPU_V2; + case 7: + return TPU_V3; + case 10: + return TPU_V4_POD; + case 12: + return TPU_V5_LITEPOD; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AcceleratorType findValueByNumber(int number) { + return AcceleratorType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.AcceleratorTypeProto.getDescriptor().getEnumTypes().get(0); + } + + private static final AcceleratorType[] VALUES = values(); + + public static AcceleratorType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private AcceleratorType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.AcceleratorType) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AcceleratorTypeProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AcceleratorTypeProto.java new file mode 100644 index 000000000000..56d233894a3b --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AcceleratorTypeProto.java @@ -0,0 +1,61 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/accelerator_type.proto + +package com.google.cloud.vertexai.api; + +public final class AcceleratorTypeProto { + private AcceleratorTypeProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/vertexai/v1beta1/accelera" + + "tor_type.proto\022\035google.cloud.vertexai.v1" + + "beta1*\257\002\n\017AcceleratorType\022 \n\034ACCELERATOR" + + "_TYPE_UNSPECIFIED\020\000\022\024\n\020NVIDIA_TESLA_K80\020" + + "\001\022\025\n\021NVIDIA_TESLA_P100\020\002\022\025\n\021NVIDIA_TESLA" + + "_V100\020\003\022\023\n\017NVIDIA_TESLA_P4\020\004\022\023\n\017NVIDIA_T" + + "ESLA_T4\020\005\022\025\n\021NVIDIA_TESLA_A100\020\010\022\024\n\020NVID" + + "IA_A100_80GB\020\t\022\r\n\tNVIDIA_L4\020\013\022\024\n\020NVIDIA_" + + "H100_80GB\020\r\022\n\n\006TPU_V2\020\006\022\n\n\006TPU_V3\020\007\022\016\n\nT" + + "PU_V4_POD\020\n\022\022\n\016TPU_V5_LITEPOD\020\014B\331\001\n\035com." + + "google.cloud.vertexai.apiB\024AcceleratorTy" + + "peProtoP\001Z=cloud.google.com/go/vertexai/" + + "apiv1beta1/vertexaipb;vertexaipb\252\002\035Googl" + + "e.Cloud.VertexAI.V1Beta1\312\002\035Google\\Cloud\\" + + "VertexAI\\V1beta1\352\002 Google::Cloud::Vertex" + + "AI::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Attribution.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Attribution.java new file mode 100644 index 000000000000..1ac92525991c --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Attribution.java @@ -0,0 +1,2288 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Attribution that explains a particular prediction output.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Attribution} + */ +public final class Attribution extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Attribution) + AttributionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Attribution.newBuilder() to construct. + private Attribution(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Attribution() { + outputIndex_ = emptyIntList(); + outputDisplayName_ = ""; + outputName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Attribution(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Attribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Attribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Attribution.class, + com.google.cloud.vertexai.api.Attribution.Builder.class); + } + + public static final int BASELINE_OUTPUT_VALUE_FIELD_NUMBER = 1; + private double baselineOutputValue_ = 0D; + /** + * + * + *
+   * Output only. Model predicted output if the input instance is constructed
+   * from the baselines of all the features defined in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The field name of the output is determined by the key in
+   * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+   *
+   * If the Model's predicted output has multiple dimensions (rank > 1), this is
+   * the value in the output located by
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+   *
+   * If there are multiple baselines, their output values are averaged.
+   * 
+ * + * double baseline_output_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The baselineOutputValue. + */ + @java.lang.Override + public double getBaselineOutputValue() { + return baselineOutputValue_; + } + + public static final int INSTANCE_OUTPUT_VALUE_FIELD_NUMBER = 2; + private double instanceOutputValue_ = 0D; + /** + * + * + *
+   * Output only. Model predicted output on the corresponding [explanation
+   * instance][ExplainRequest.instances]. The field name of the output is
+   * determined by the key in
+   * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+   *
+   * If the Model predicted output has multiple dimensions, this is the value in
+   * the output located by
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+   * 
+ * + * double instance_output_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The instanceOutputValue. + */ + @java.lang.Override + public double getInstanceOutputValue() { + return instanceOutputValue_; + } + + public static final int FEATURE_ATTRIBUTIONS_FIELD_NUMBER = 3; + private com.google.protobuf.Value featureAttributions_; + /** + * + * + *
+   * Output only. Attributions of each explained feature. Features are extracted
+   * from the [prediction
+   * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * according to [explanation metadata for
+   * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   *
+   * The value is a struct, whose keys are the name of the feature. The values
+   * are how much the feature in the
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * contributed to the predicted result.
+   *
+   * The format of the value is determined by the feature's input format:
+   *
+   *   * If the feature is a scalar value, the attribution value is a
+   *     [floating number][google.protobuf.Value.number_value].
+   *
+   *   * If the feature is an array of scalar values, the attribution value is
+   *     an [array][google.protobuf.Value.list_value].
+   *
+   *   * If the feature is a struct, the attribution value is a
+   *     [struct][google.protobuf.Value.struct_value]. The keys in the
+   *     attribution value struct are the same as the keys in the feature
+   *     struct. The formats of the values in the attribution struct are
+   *     determined by the formats of the values in the feature struct.
+   *
+   * The
+   * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+   * field, pointed to by the
+   * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+   * the
+   * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+   * object, points to the schema file that describes the features and their
+   * attribution values (if it is populated).
+   * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the featureAttributions field is set. + */ + @java.lang.Override + public boolean hasFeatureAttributions() { + return featureAttributions_ != null; + } + /** + * + * + *
+   * Output only. Attributions of each explained feature. Features are extracted
+   * from the [prediction
+   * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * according to [explanation metadata for
+   * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   *
+   * The value is a struct, whose keys are the name of the feature. The values
+   * are how much the feature in the
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * contributed to the predicted result.
+   *
+   * The format of the value is determined by the feature's input format:
+   *
+   *   * If the feature is a scalar value, the attribution value is a
+   *     [floating number][google.protobuf.Value.number_value].
+   *
+   *   * If the feature is an array of scalar values, the attribution value is
+   *     an [array][google.protobuf.Value.list_value].
+   *
+   *   * If the feature is a struct, the attribution value is a
+   *     [struct][google.protobuf.Value.struct_value]. The keys in the
+   *     attribution value struct are the same as the keys in the feature
+   *     struct. The formats of the values in the attribution struct are
+   *     determined by the formats of the values in the feature struct.
+   *
+   * The
+   * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+   * field, pointed to by the
+   * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+   * the
+   * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+   * object, points to the schema file that describes the features and their
+   * attribution values (if it is populated).
+   * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The featureAttributions. + */ + @java.lang.Override + public com.google.protobuf.Value getFeatureAttributions() { + return featureAttributions_ == null + ? com.google.protobuf.Value.getDefaultInstance() + : featureAttributions_; + } + /** + * + * + *
+   * Output only. Attributions of each explained feature. Features are extracted
+   * from the [prediction
+   * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * according to [explanation metadata for
+   * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   *
+   * The value is a struct, whose keys are the name of the feature. The values
+   * are how much the feature in the
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * contributed to the predicted result.
+   *
+   * The format of the value is determined by the feature's input format:
+   *
+   *   * If the feature is a scalar value, the attribution value is a
+   *     [floating number][google.protobuf.Value.number_value].
+   *
+   *   * If the feature is an array of scalar values, the attribution value is
+   *     an [array][google.protobuf.Value.list_value].
+   *
+   *   * If the feature is a struct, the attribution value is a
+   *     [struct][google.protobuf.Value.struct_value]. The keys in the
+   *     attribution value struct are the same as the keys in the feature
+   *     struct. The formats of the values in the attribution struct are
+   *     determined by the formats of the values in the feature struct.
+   *
+   * The
+   * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+   * field, pointed to by the
+   * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+   * the
+   * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+   * object, points to the schema file that describes the features and their
+   * attribution values (if it is populated).
+   * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getFeatureAttributionsOrBuilder() { + return featureAttributions_ == null + ? com.google.protobuf.Value.getDefaultInstance() + : featureAttributions_; + } + + public static final int OUTPUT_INDEX_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList outputIndex_; + /** + * + * + *
+   * Output only. The index that locates the explained prediction output.
+   *
+   * If the prediction output is a scalar value, output_index is not populated.
+   * If the prediction output has multiple dimensions, the length of the
+   * output_index list is the same as the number of dimensions of the output.
+   * The i-th element in output_index is the element index of the i-th dimension
+   * of the output vector. Indices start from 0.
+   * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the outputIndex. + */ + @java.lang.Override + public java.util.List getOutputIndexList() { + return outputIndex_; + } + /** + * + * + *
+   * Output only. The index that locates the explained prediction output.
+   *
+   * If the prediction output is a scalar value, output_index is not populated.
+   * If the prediction output has multiple dimensions, the length of the
+   * output_index list is the same as the number of dimensions of the output.
+   * The i-th element in output_index is the element index of the i-th dimension
+   * of the output vector. Indices start from 0.
+   * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of outputIndex. + */ + public int getOutputIndexCount() { + return outputIndex_.size(); + } + /** + * + * + *
+   * Output only. The index that locates the explained prediction output.
+   *
+   * If the prediction output is a scalar value, output_index is not populated.
+   * If the prediction output has multiple dimensions, the length of the
+   * output_index list is the same as the number of dimensions of the output.
+   * The i-th element in output_index is the element index of the i-th dimension
+   * of the output vector. Indices start from 0.
+   * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The outputIndex at the given index. + */ + public int getOutputIndex(int index) { + return outputIndex_.getInt(index); + } + + private int outputIndexMemoizedSerializedSize = -1; + + public static final int OUTPUT_DISPLAY_NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object outputDisplayName_ = ""; + /** + * + * + *
+   * Output only. The display name of the output identified by
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+   * For example, the predicted class name by a multi-classification Model.
+   *
+   * This field is only populated iff the Model predicts display names as a
+   * separate field along with the explained output. The predicted display name
+   * must has the same shape of the explained output, and can be located using
+   * output_index.
+   * 
+ * + * string output_display_name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The outputDisplayName. + */ + @java.lang.Override + public java.lang.String getOutputDisplayName() { + java.lang.Object ref = outputDisplayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputDisplayName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The display name of the output identified by
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+   * For example, the predicted class name by a multi-classification Model.
+   *
+   * This field is only populated iff the Model predicts display names as a
+   * separate field along with the explained output. The predicted display name
+   * must has the same shape of the explained output, and can be located using
+   * output_index.
+   * 
+ * + * string output_display_name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for outputDisplayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputDisplayNameBytes() { + java.lang.Object ref = outputDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPROXIMATION_ERROR_FIELD_NUMBER = 6; + private double approximationError_ = 0D; + /** + * + * + *
+   * Output only. Error of
+   * [feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * caused by approximation used in the explanation method. Lower value means
+   * more precise attributions.
+   *
+   * * For Sampled Shapley
+   * [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.sampled_shapley_attribution],
+   * increasing
+   * [path_count][google.cloud.vertexai.v1beta1.SampledShapleyAttribution.path_count]
+   * might reduce the error.
+   * * For Integrated Gradients
+   * [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+   * increasing
+   * [step_count][google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution.step_count]
+   * might reduce the error.
+   * * For [XRAI
+   * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+   * increasing
+   * [step_count][google.cloud.vertexai.v1beta1.XraiAttribution.step_count]
+   * might reduce the error.
+   *
+   * See [this introduction](/vertex-ai/docs/explainable-ai/overview)
+   * for more information.
+   * 
+ * + * double approximation_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The approximationError. + */ + @java.lang.Override + public double getApproximationError() { + return approximationError_; + } + + public static final int OUTPUT_NAME_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object outputName_ = ""; + /** + * + * + *
+   * Output only. Name of the explain output. Specified as the key in
+   * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+   * 
+ * + * string output_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The outputName. + */ + @java.lang.Override + public java.lang.String getOutputName() { + java.lang.Object ref = outputName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the explain output. Specified as the key in
+   * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+   * 
+ * + * string output_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for outputName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputNameBytes() { + java.lang.Object ref = outputName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (java.lang.Double.doubleToRawLongBits(baselineOutputValue_) != 0) { + output.writeDouble(1, baselineOutputValue_); + } + if (java.lang.Double.doubleToRawLongBits(instanceOutputValue_) != 0) { + output.writeDouble(2, instanceOutputValue_); + } + if (featureAttributions_ != null) { + output.writeMessage(3, getFeatureAttributions()); + } + if (getOutputIndexList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(outputIndexMemoizedSerializedSize); + } + for (int i = 0; i < outputIndex_.size(); i++) { + output.writeInt32NoTag(outputIndex_.getInt(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputDisplayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, outputDisplayName_); + } + if (java.lang.Double.doubleToRawLongBits(approximationError_) != 0) { + output.writeDouble(6, approximationError_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, outputName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(baselineOutputValue_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, baselineOutputValue_); + } + if (java.lang.Double.doubleToRawLongBits(instanceOutputValue_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, instanceOutputValue_); + } + if (featureAttributions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFeatureAttributions()); + } + { + int dataSize = 0; + for (int i = 0; i < outputIndex_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(outputIndex_.getInt(i)); + } + size += dataSize; + if (!getOutputIndexList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + outputIndexMemoizedSerializedSize = dataSize; + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputDisplayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, outputDisplayName_); + } + if (java.lang.Double.doubleToRawLongBits(approximationError_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(6, approximationError_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, outputName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Attribution)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Attribution other = + (com.google.cloud.vertexai.api.Attribution) obj; + + if (java.lang.Double.doubleToLongBits(getBaselineOutputValue()) + != java.lang.Double.doubleToLongBits(other.getBaselineOutputValue())) return false; + if (java.lang.Double.doubleToLongBits(getInstanceOutputValue()) + != java.lang.Double.doubleToLongBits(other.getInstanceOutputValue())) return false; + if (hasFeatureAttributions() != other.hasFeatureAttributions()) return false; + if (hasFeatureAttributions()) { + if (!getFeatureAttributions().equals(other.getFeatureAttributions())) return false; + } + if (!getOutputIndexList().equals(other.getOutputIndexList())) return false; + if (!getOutputDisplayName().equals(other.getOutputDisplayName())) return false; + if (java.lang.Double.doubleToLongBits(getApproximationError()) + != java.lang.Double.doubleToLongBits(other.getApproximationError())) return false; + if (!getOutputName().equals(other.getOutputName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BASELINE_OUTPUT_VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getBaselineOutputValue())); + hash = (37 * hash) + INSTANCE_OUTPUT_VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getInstanceOutputValue())); + if (hasFeatureAttributions()) { + hash = (37 * hash) + FEATURE_ATTRIBUTIONS_FIELD_NUMBER; + hash = (53 * hash) + getFeatureAttributions().hashCode(); + } + if (getOutputIndexCount() > 0) { + hash = (37 * hash) + OUTPUT_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getOutputIndexList().hashCode(); + } + hash = (37 * hash) + OUTPUT_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOutputDisplayName().hashCode(); + hash = (37 * hash) + APPROXIMATION_ERROR_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getApproximationError())); + hash = (37 * hash) + OUTPUT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOutputName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Attribution parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Attribution parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Attribution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Attribution parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Attribution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Attribution parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Attribution parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Attribution parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Attribution parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Attribution parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Attribution parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Attribution parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Attribution prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Attribution that explains a particular prediction output.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Attribution} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Attribution) + com.google.cloud.vertexai.api.AttributionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Attribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Attribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Attribution.class, + com.google.cloud.vertexai.api.Attribution.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Attribution.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + baselineOutputValue_ = 0D; + instanceOutputValue_ = 0D; + featureAttributions_ = null; + if (featureAttributionsBuilder_ != null) { + featureAttributionsBuilder_.dispose(); + featureAttributionsBuilder_ = null; + } + outputIndex_ = emptyIntList(); + outputDisplayName_ = ""; + approximationError_ = 0D; + outputName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Attribution_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Attribution getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Attribution.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Attribution build() { + com.google.cloud.vertexai.api.Attribution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Attribution buildPartial() { + com.google.cloud.vertexai.api.Attribution result = + new com.google.cloud.vertexai.api.Attribution(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.Attribution result) { + if (((bitField0_ & 0x00000008) != 0)) { + outputIndex_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.outputIndex_ = outputIndex_; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Attribution result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.baselineOutputValue_ = baselineOutputValue_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceOutputValue_ = instanceOutputValue_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.featureAttributions_ = + featureAttributionsBuilder_ == null + ? featureAttributions_ + : featureAttributionsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.outputDisplayName_ = outputDisplayName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.approximationError_ = approximationError_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.outputName_ = outputName_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Attribution) { + return mergeFrom((com.google.cloud.vertexai.api.Attribution) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Attribution other) { + if (other == com.google.cloud.vertexai.api.Attribution.getDefaultInstance()) return this; + if (other.getBaselineOutputValue() != 0D) { + setBaselineOutputValue(other.getBaselineOutputValue()); + } + if (other.getInstanceOutputValue() != 0D) { + setInstanceOutputValue(other.getInstanceOutputValue()); + } + if (other.hasFeatureAttributions()) { + mergeFeatureAttributions(other.getFeatureAttributions()); + } + if (!other.outputIndex_.isEmpty()) { + if (outputIndex_.isEmpty()) { + outputIndex_ = other.outputIndex_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureOutputIndexIsMutable(); + outputIndex_.addAll(other.outputIndex_); + } + onChanged(); + } + if (!other.getOutputDisplayName().isEmpty()) { + outputDisplayName_ = other.outputDisplayName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getApproximationError() != 0D) { + setApproximationError(other.getApproximationError()); + } + if (!other.getOutputName().isEmpty()) { + outputName_ = other.outputName_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + baselineOutputValue_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 17: + { + instanceOutputValue_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 26: + { + input.readMessage( + getFeatureAttributionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + int v = input.readInt32(); + ensureOutputIndexIsMutable(); + outputIndex_.addInt(v); + break; + } // case 32 + case 34: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureOutputIndexIsMutable(); + while (input.getBytesUntilLimit() > 0) { + outputIndex_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 34 + case 42: + { + outputDisplayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 49: + { + approximationError_ = input.readDouble(); + bitField0_ |= 0x00000020; + break; + } // case 49 + case 58: + { + outputName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private double baselineOutputValue_; + /** + * + * + *
+     * Output only. Model predicted output if the input instance is constructed
+     * from the baselines of all the features defined in
+     * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * The field name of the output is determined by the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     *
+     * If the Model's predicted output has multiple dimensions (rank > 1), this is
+     * the value in the output located by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     *
+     * If there are multiple baselines, their output values are averaged.
+     * 
+ * + * double baseline_output_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The baselineOutputValue. + */ + @java.lang.Override + public double getBaselineOutputValue() { + return baselineOutputValue_; + } + /** + * + * + *
+     * Output only. Model predicted output if the input instance is constructed
+     * from the baselines of all the features defined in
+     * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * The field name of the output is determined by the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     *
+     * If the Model's predicted output has multiple dimensions (rank > 1), this is
+     * the value in the output located by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     *
+     * If there are multiple baselines, their output values are averaged.
+     * 
+ * + * double baseline_output_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The baselineOutputValue to set. + * @return This builder for chaining. + */ + public Builder setBaselineOutputValue(double value) { + + baselineOutputValue_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Model predicted output if the input instance is constructed
+     * from the baselines of all the features defined in
+     * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * The field name of the output is determined by the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     *
+     * If the Model's predicted output has multiple dimensions (rank > 1), this is
+     * the value in the output located by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     *
+     * If there are multiple baselines, their output values are averaged.
+     * 
+ * + * double baseline_output_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBaselineOutputValue() { + bitField0_ = (bitField0_ & ~0x00000001); + baselineOutputValue_ = 0D; + onChanged(); + return this; + } + + private double instanceOutputValue_; + /** + * + * + *
+     * Output only. Model predicted output on the corresponding [explanation
+     * instance][ExplainRequest.instances]. The field name of the output is
+     * determined by the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     *
+     * If the Model predicted output has multiple dimensions, this is the value in
+     * the output located by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * 
+ * + * double instance_output_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The instanceOutputValue. + */ + @java.lang.Override + public double getInstanceOutputValue() { + return instanceOutputValue_; + } + /** + * + * + *
+     * Output only. Model predicted output on the corresponding [explanation
+     * instance][ExplainRequest.instances]. The field name of the output is
+     * determined by the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     *
+     * If the Model predicted output has multiple dimensions, this is the value in
+     * the output located by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * 
+ * + * double instance_output_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The instanceOutputValue to set. + * @return This builder for chaining. + */ + public Builder setInstanceOutputValue(double value) { + + instanceOutputValue_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Model predicted output on the corresponding [explanation
+     * instance][ExplainRequest.instances]. The field name of the output is
+     * determined by the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     *
+     * If the Model predicted output has multiple dimensions, this is the value in
+     * the output located by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * 
+ * + * double instance_output_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceOutputValue() { + bitField0_ = (bitField0_ & ~0x00000002); + instanceOutputValue_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.Value featureAttributions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + featureAttributionsBuilder_; + /** + * + * + *
+     * Output only. Attributions of each explained feature. Features are extracted
+     * from the [prediction
+     * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * according to [explanation metadata for
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     *
+     * The value is a struct, whose keys are the name of the feature. The values
+     * are how much the feature in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * contributed to the predicted result.
+     *
+     * The format of the value is determined by the feature's input format:
+     *
+     *   * If the feature is a scalar value, the attribution value is a
+     *     [floating number][google.protobuf.Value.number_value].
+     *
+     *   * If the feature is an array of scalar values, the attribution value is
+     *     an [array][google.protobuf.Value.list_value].
+     *
+     *   * If the feature is a struct, the attribution value is a
+     *     [struct][google.protobuf.Value.struct_value]. The keys in the
+     *     attribution value struct are the same as the keys in the feature
+     *     struct. The formats of the values in the attribution struct are
+     *     determined by the formats of the values in the feature struct.
+     *
+     * The
+     * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+     * field, pointed to by the
+     * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+     * the
+     * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+     * object, points to the schema file that describes the features and their
+     * attribution values (if it is populated).
+     * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the featureAttributions field is set. + */ + public boolean hasFeatureAttributions() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Attributions of each explained feature. Features are extracted
+     * from the [prediction
+     * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * according to [explanation metadata for
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     *
+     * The value is a struct, whose keys are the name of the feature. The values
+     * are how much the feature in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * contributed to the predicted result.
+     *
+     * The format of the value is determined by the feature's input format:
+     *
+     *   * If the feature is a scalar value, the attribution value is a
+     *     [floating number][google.protobuf.Value.number_value].
+     *
+     *   * If the feature is an array of scalar values, the attribution value is
+     *     an [array][google.protobuf.Value.list_value].
+     *
+     *   * If the feature is a struct, the attribution value is a
+     *     [struct][google.protobuf.Value.struct_value]. The keys in the
+     *     attribution value struct are the same as the keys in the feature
+     *     struct. The formats of the values in the attribution struct are
+     *     determined by the formats of the values in the feature struct.
+     *
+     * The
+     * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+     * field, pointed to by the
+     * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+     * the
+     * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+     * object, points to the schema file that describes the features and their
+     * attribution values (if it is populated).
+     * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The featureAttributions. + */ + public com.google.protobuf.Value getFeatureAttributions() { + if (featureAttributionsBuilder_ == null) { + return featureAttributions_ == null + ? com.google.protobuf.Value.getDefaultInstance() + : featureAttributions_; + } else { + return featureAttributionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Attributions of each explained feature. Features are extracted
+     * from the [prediction
+     * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * according to [explanation metadata for
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     *
+     * The value is a struct, whose keys are the name of the feature. The values
+     * are how much the feature in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * contributed to the predicted result.
+     *
+     * The format of the value is determined by the feature's input format:
+     *
+     *   * If the feature is a scalar value, the attribution value is a
+     *     [floating number][google.protobuf.Value.number_value].
+     *
+     *   * If the feature is an array of scalar values, the attribution value is
+     *     an [array][google.protobuf.Value.list_value].
+     *
+     *   * If the feature is a struct, the attribution value is a
+     *     [struct][google.protobuf.Value.struct_value]. The keys in the
+     *     attribution value struct are the same as the keys in the feature
+     *     struct. The formats of the values in the attribution struct are
+     *     determined by the formats of the values in the feature struct.
+     *
+     * The
+     * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+     * field, pointed to by the
+     * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+     * the
+     * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+     * object, points to the schema file that describes the features and their
+     * attribution values (if it is populated).
+     * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFeatureAttributions(com.google.protobuf.Value value) { + if (featureAttributionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + featureAttributions_ = value; + } else { + featureAttributionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Attributions of each explained feature. Features are extracted
+     * from the [prediction
+     * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * according to [explanation metadata for
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     *
+     * The value is a struct, whose keys are the name of the feature. The values
+     * are how much the feature in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * contributed to the predicted result.
+     *
+     * The format of the value is determined by the feature's input format:
+     *
+     *   * If the feature is a scalar value, the attribution value is a
+     *     [floating number][google.protobuf.Value.number_value].
+     *
+     *   * If the feature is an array of scalar values, the attribution value is
+     *     an [array][google.protobuf.Value.list_value].
+     *
+     *   * If the feature is a struct, the attribution value is a
+     *     [struct][google.protobuf.Value.struct_value]. The keys in the
+     *     attribution value struct are the same as the keys in the feature
+     *     struct. The formats of the values in the attribution struct are
+     *     determined by the formats of the values in the feature struct.
+     *
+     * The
+     * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+     * field, pointed to by the
+     * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+     * the
+     * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+     * object, points to the schema file that describes the features and their
+     * attribution values (if it is populated).
+     * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFeatureAttributions(com.google.protobuf.Value.Builder builderForValue) { + if (featureAttributionsBuilder_ == null) { + featureAttributions_ = builderForValue.build(); + } else { + featureAttributionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Attributions of each explained feature. Features are extracted
+     * from the [prediction
+     * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * according to [explanation metadata for
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     *
+     * The value is a struct, whose keys are the name of the feature. The values
+     * are how much the feature in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * contributed to the predicted result.
+     *
+     * The format of the value is determined by the feature's input format:
+     *
+     *   * If the feature is a scalar value, the attribution value is a
+     *     [floating number][google.protobuf.Value.number_value].
+     *
+     *   * If the feature is an array of scalar values, the attribution value is
+     *     an [array][google.protobuf.Value.list_value].
+     *
+     *   * If the feature is a struct, the attribution value is a
+     *     [struct][google.protobuf.Value.struct_value]. The keys in the
+     *     attribution value struct are the same as the keys in the feature
+     *     struct. The formats of the values in the attribution struct are
+     *     determined by the formats of the values in the feature struct.
+     *
+     * The
+     * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+     * field, pointed to by the
+     * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+     * the
+     * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+     * object, points to the schema file that describes the features and their
+     * attribution values (if it is populated).
+     * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeFeatureAttributions(com.google.protobuf.Value value) { + if (featureAttributionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && featureAttributions_ != null + && featureAttributions_ != com.google.protobuf.Value.getDefaultInstance()) { + getFeatureAttributionsBuilder().mergeFrom(value); + } else { + featureAttributions_ = value; + } + } else { + featureAttributionsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Attributions of each explained feature. Features are extracted
+     * from the [prediction
+     * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * according to [explanation metadata for
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     *
+     * The value is a struct, whose keys are the name of the feature. The values
+     * are how much the feature in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * contributed to the predicted result.
+     *
+     * The format of the value is determined by the feature's input format:
+     *
+     *   * If the feature is a scalar value, the attribution value is a
+     *     [floating number][google.protobuf.Value.number_value].
+     *
+     *   * If the feature is an array of scalar values, the attribution value is
+     *     an [array][google.protobuf.Value.list_value].
+     *
+     *   * If the feature is a struct, the attribution value is a
+     *     [struct][google.protobuf.Value.struct_value]. The keys in the
+     *     attribution value struct are the same as the keys in the feature
+     *     struct. The formats of the values in the attribution struct are
+     *     determined by the formats of the values in the feature struct.
+     *
+     * The
+     * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+     * field, pointed to by the
+     * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+     * the
+     * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+     * object, points to the schema file that describes the features and their
+     * attribution values (if it is populated).
+     * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearFeatureAttributions() { + bitField0_ = (bitField0_ & ~0x00000004); + featureAttributions_ = null; + if (featureAttributionsBuilder_ != null) { + featureAttributionsBuilder_.dispose(); + featureAttributionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Attributions of each explained feature. Features are extracted
+     * from the [prediction
+     * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * according to [explanation metadata for
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     *
+     * The value is a struct, whose keys are the name of the feature. The values
+     * are how much the feature in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * contributed to the predicted result.
+     *
+     * The format of the value is determined by the feature's input format:
+     *
+     *   * If the feature is a scalar value, the attribution value is a
+     *     [floating number][google.protobuf.Value.number_value].
+     *
+     *   * If the feature is an array of scalar values, the attribution value is
+     *     an [array][google.protobuf.Value.list_value].
+     *
+     *   * If the feature is a struct, the attribution value is a
+     *     [struct][google.protobuf.Value.struct_value]. The keys in the
+     *     attribution value struct are the same as the keys in the feature
+     *     struct. The formats of the values in the attribution struct are
+     *     determined by the formats of the values in the feature struct.
+     *
+     * The
+     * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+     * field, pointed to by the
+     * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+     * the
+     * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+     * object, points to the schema file that describes the features and their
+     * attribution values (if it is populated).
+     * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Value.Builder getFeatureAttributionsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getFeatureAttributionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Attributions of each explained feature. Features are extracted
+     * from the [prediction
+     * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * according to [explanation metadata for
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     *
+     * The value is a struct, whose keys are the name of the feature. The values
+     * are how much the feature in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * contributed to the predicted result.
+     *
+     * The format of the value is determined by the feature's input format:
+     *
+     *   * If the feature is a scalar value, the attribution value is a
+     *     [floating number][google.protobuf.Value.number_value].
+     *
+     *   * If the feature is an array of scalar values, the attribution value is
+     *     an [array][google.protobuf.Value.list_value].
+     *
+     *   * If the feature is a struct, the attribution value is a
+     *     [struct][google.protobuf.Value.struct_value]. The keys in the
+     *     attribution value struct are the same as the keys in the feature
+     *     struct. The formats of the values in the attribution struct are
+     *     determined by the formats of the values in the feature struct.
+     *
+     * The
+     * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+     * field, pointed to by the
+     * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+     * the
+     * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+     * object, points to the schema file that describes the features and their
+     * attribution values (if it is populated).
+     * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.ValueOrBuilder getFeatureAttributionsOrBuilder() { + if (featureAttributionsBuilder_ != null) { + return featureAttributionsBuilder_.getMessageOrBuilder(); + } else { + return featureAttributions_ == null + ? com.google.protobuf.Value.getDefaultInstance() + : featureAttributions_; + } + } + /** + * + * + *
+     * Output only. Attributions of each explained feature. Features are extracted
+     * from the [prediction
+     * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * according to [explanation metadata for
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     *
+     * The value is a struct, whose keys are the name of the feature. The values
+     * are how much the feature in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+     * contributed to the predicted result.
+     *
+     * The format of the value is determined by the feature's input format:
+     *
+     *   * If the feature is a scalar value, the attribution value is a
+     *     [floating number][google.protobuf.Value.number_value].
+     *
+     *   * If the feature is an array of scalar values, the attribution value is
+     *     an [array][google.protobuf.Value.list_value].
+     *
+     *   * If the feature is a struct, the attribution value is a
+     *     [struct][google.protobuf.Value.struct_value]. The keys in the
+     *     attribution value struct are the same as the keys in the feature
+     *     struct. The formats of the values in the attribution struct are
+     *     determined by the formats of the values in the feature struct.
+     *
+     * The
+     * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+     * field, pointed to by the
+     * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+     * the
+     * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+     * object, points to the schema file that describes the features and their
+     * attribution values (if it is populated).
+     * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getFeatureAttributionsFieldBuilder() { + if (featureAttributionsBuilder_ == null) { + featureAttributionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getFeatureAttributions(), getParentForChildren(), isClean()); + featureAttributions_ = null; + } + return featureAttributionsBuilder_; + } + + private com.google.protobuf.Internal.IntList outputIndex_ = emptyIntList(); + + private void ensureOutputIndexIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + outputIndex_ = mutableCopy(outputIndex_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * Output only. The index that locates the explained prediction output.
+     *
+     * If the prediction output is a scalar value, output_index is not populated.
+     * If the prediction output has multiple dimensions, the length of the
+     * output_index list is the same as the number of dimensions of the output.
+     * The i-th element in output_index is the element index of the i-th dimension
+     * of the output vector. Indices start from 0.
+     * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the outputIndex. + */ + public java.util.List getOutputIndexList() { + return ((bitField0_ & 0x00000008) != 0) + ? java.util.Collections.unmodifiableList(outputIndex_) + : outputIndex_; + } + /** + * + * + *
+     * Output only. The index that locates the explained prediction output.
+     *
+     * If the prediction output is a scalar value, output_index is not populated.
+     * If the prediction output has multiple dimensions, the length of the
+     * output_index list is the same as the number of dimensions of the output.
+     * The i-th element in output_index is the element index of the i-th dimension
+     * of the output vector. Indices start from 0.
+     * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of outputIndex. + */ + public int getOutputIndexCount() { + return outputIndex_.size(); + } + /** + * + * + *
+     * Output only. The index that locates the explained prediction output.
+     *
+     * If the prediction output is a scalar value, output_index is not populated.
+     * If the prediction output has multiple dimensions, the length of the
+     * output_index list is the same as the number of dimensions of the output.
+     * The i-th element in output_index is the element index of the i-th dimension
+     * of the output vector. Indices start from 0.
+     * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The outputIndex at the given index. + */ + public int getOutputIndex(int index) { + return outputIndex_.getInt(index); + } + /** + * + * + *
+     * Output only. The index that locates the explained prediction output.
+     *
+     * If the prediction output is a scalar value, output_index is not populated.
+     * If the prediction output has multiple dimensions, the length of the
+     * output_index list is the same as the number of dimensions of the output.
+     * The i-th element in output_index is the element index of the i-th dimension
+     * of the output vector. Indices start from 0.
+     * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index to set the value at. + * @param value The outputIndex to set. + * @return This builder for chaining. + */ + public Builder setOutputIndex(int index, int value) { + + ensureOutputIndexIsMutable(); + outputIndex_.setInt(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The index that locates the explained prediction output.
+     *
+     * If the prediction output is a scalar value, output_index is not populated.
+     * If the prediction output has multiple dimensions, the length of the
+     * output_index list is the same as the number of dimensions of the output.
+     * The i-th element in output_index is the element index of the i-th dimension
+     * of the output vector. Indices start from 0.
+     * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The outputIndex to add. + * @return This builder for chaining. + */ + public Builder addOutputIndex(int value) { + + ensureOutputIndexIsMutable(); + outputIndex_.addInt(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The index that locates the explained prediction output.
+     *
+     * If the prediction output is a scalar value, output_index is not populated.
+     * If the prediction output has multiple dimensions, the length of the
+     * output_index list is the same as the number of dimensions of the output.
+     * The i-th element in output_index is the element index of the i-th dimension
+     * of the output vector. Indices start from 0.
+     * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param values The outputIndex to add. + * @return This builder for chaining. + */ + public Builder addAllOutputIndex(java.lang.Iterable values) { + ensureOutputIndexIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, outputIndex_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The index that locates the explained prediction output.
+     *
+     * If the prediction output is a scalar value, output_index is not populated.
+     * If the prediction output has multiple dimensions, the length of the
+     * output_index list is the same as the number of dimensions of the output.
+     * The i-th element in output_index is the element index of the i-th dimension
+     * of the output vector. Indices start from 0.
+     * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearOutputIndex() { + outputIndex_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + private java.lang.Object outputDisplayName_ = ""; + /** + * + * + *
+     * Output only. The display name of the output identified by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * For example, the predicted class name by a multi-classification Model.
+     *
+     * This field is only populated iff the Model predicts display names as a
+     * separate field along with the explained output. The predicted display name
+     * must has the same shape of the explained output, and can be located using
+     * output_index.
+     * 
+ * + * string output_display_name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The outputDisplayName. + */ + public java.lang.String getOutputDisplayName() { + java.lang.Object ref = outputDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The display name of the output identified by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * For example, the predicted class name by a multi-classification Model.
+     *
+     * This field is only populated iff the Model predicts display names as a
+     * separate field along with the explained output. The predicted display name
+     * must has the same shape of the explained output, and can be located using
+     * output_index.
+     * 
+ * + * string output_display_name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for outputDisplayName. + */ + public com.google.protobuf.ByteString getOutputDisplayNameBytes() { + java.lang.Object ref = outputDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The display name of the output identified by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * For example, the predicted class name by a multi-classification Model.
+     *
+     * This field is only populated iff the Model predicts display names as a
+     * separate field along with the explained output. The predicted display name
+     * must has the same shape of the explained output, and can be located using
+     * output_index.
+     * 
+ * + * string output_display_name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The outputDisplayName to set. + * @return This builder for chaining. + */ + public Builder setOutputDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputDisplayName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The display name of the output identified by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * For example, the predicted class name by a multi-classification Model.
+     *
+     * This field is only populated iff the Model predicts display names as a
+     * separate field along with the explained output. The predicted display name
+     * must has the same shape of the explained output, and can be located using
+     * output_index.
+     * 
+ * + * string output_display_name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearOutputDisplayName() { + outputDisplayName_ = getDefaultInstance().getOutputDisplayName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The display name of the output identified by
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * For example, the predicted class name by a multi-classification Model.
+     *
+     * This field is only populated iff the Model predicts display names as a
+     * separate field along with the explained output. The predicted display name
+     * must has the same shape of the explained output, and can be located using
+     * output_index.
+     * 
+ * + * string output_display_name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for outputDisplayName to set. + * @return This builder for chaining. + */ + public Builder setOutputDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputDisplayName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private double approximationError_; + /** + * + * + *
+     * Output only. Error of
+     * [feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * caused by approximation used in the explanation method. Lower value means
+     * more precise attributions.
+     *
+     * * For Sampled Shapley
+     * [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.sampled_shapley_attribution],
+     * increasing
+     * [path_count][google.cloud.vertexai.v1beta1.SampledShapleyAttribution.path_count]
+     * might reduce the error.
+     * * For Integrated Gradients
+     * [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+     * increasing
+     * [step_count][google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution.step_count]
+     * might reduce the error.
+     * * For [XRAI
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+     * increasing
+     * [step_count][google.cloud.vertexai.v1beta1.XraiAttribution.step_count]
+     * might reduce the error.
+     *
+     * See [this introduction](/vertex-ai/docs/explainable-ai/overview)
+     * for more information.
+     * 
+ * + * double approximation_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The approximationError. + */ + @java.lang.Override + public double getApproximationError() { + return approximationError_; + } + /** + * + * + *
+     * Output only. Error of
+     * [feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * caused by approximation used in the explanation method. Lower value means
+     * more precise attributions.
+     *
+     * * For Sampled Shapley
+     * [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.sampled_shapley_attribution],
+     * increasing
+     * [path_count][google.cloud.vertexai.v1beta1.SampledShapleyAttribution.path_count]
+     * might reduce the error.
+     * * For Integrated Gradients
+     * [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+     * increasing
+     * [step_count][google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution.step_count]
+     * might reduce the error.
+     * * For [XRAI
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+     * increasing
+     * [step_count][google.cloud.vertexai.v1beta1.XraiAttribution.step_count]
+     * might reduce the error.
+     *
+     * See [this introduction](/vertex-ai/docs/explainable-ai/overview)
+     * for more information.
+     * 
+ * + * double approximation_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The approximationError to set. + * @return This builder for chaining. + */ + public Builder setApproximationError(double value) { + + approximationError_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Error of
+     * [feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * caused by approximation used in the explanation method. Lower value means
+     * more precise attributions.
+     *
+     * * For Sampled Shapley
+     * [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.sampled_shapley_attribution],
+     * increasing
+     * [path_count][google.cloud.vertexai.v1beta1.SampledShapleyAttribution.path_count]
+     * might reduce the error.
+     * * For Integrated Gradients
+     * [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+     * increasing
+     * [step_count][google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution.step_count]
+     * might reduce the error.
+     * * For [XRAI
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+     * increasing
+     * [step_count][google.cloud.vertexai.v1beta1.XraiAttribution.step_count]
+     * might reduce the error.
+     *
+     * See [this introduction](/vertex-ai/docs/explainable-ai/overview)
+     * for more information.
+     * 
+ * + * double approximation_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApproximationError() { + bitField0_ = (bitField0_ & ~0x00000020); + approximationError_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object outputName_ = ""; + /** + * + * + *
+     * Output only. Name of the explain output. Specified as the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     * 
+ * + * string output_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The outputName. + */ + public java.lang.String getOutputName() { + java.lang.Object ref = outputName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the explain output. Specified as the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     * 
+ * + * string output_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for outputName. + */ + public com.google.protobuf.ByteString getOutputNameBytes() { + java.lang.Object ref = outputName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the explain output. Specified as the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     * 
+ * + * string output_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The outputName to set. + * @return This builder for chaining. + */ + public Builder setOutputName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the explain output. Specified as the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     * 
+ * + * string output_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearOutputName() { + outputName_ = getDefaultInstance().getOutputName(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the explain output. Specified as the key in
+     * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+     * 
+ * + * string output_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for outputName to set. + * @return This builder for chaining. + */ + public Builder setOutputNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Attribution) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Attribution) + private static final com.google.cloud.vertexai.api.Attribution DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Attribution(); + } + + public static com.google.cloud.vertexai.api.Attribution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attribution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Attribution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AttributionOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AttributionOrBuilder.java new file mode 100644 index 000000000000..fcc031e9de0b --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AttributionOrBuilder.java @@ -0,0 +1,362 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface AttributionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Attribution) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Model predicted output if the input instance is constructed
+   * from the baselines of all the features defined in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The field name of the output is determined by the key in
+   * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+   *
+   * If the Model's predicted output has multiple dimensions (rank > 1), this is
+   * the value in the output located by
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+   *
+   * If there are multiple baselines, their output values are averaged.
+   * 
+ * + * double baseline_output_value = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The baselineOutputValue. + */ + double getBaselineOutputValue(); + + /** + * + * + *
+   * Output only. Model predicted output on the corresponding [explanation
+   * instance][ExplainRequest.instances]. The field name of the output is
+   * determined by the key in
+   * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+   *
+   * If the Model predicted output has multiple dimensions, this is the value in
+   * the output located by
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+   * 
+ * + * double instance_output_value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The instanceOutputValue. + */ + double getInstanceOutputValue(); + + /** + * + * + *
+   * Output only. Attributions of each explained feature. Features are extracted
+   * from the [prediction
+   * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * according to [explanation metadata for
+   * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   *
+   * The value is a struct, whose keys are the name of the feature. The values
+   * are how much the feature in the
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * contributed to the predicted result.
+   *
+   * The format of the value is determined by the feature's input format:
+   *
+   *   * If the feature is a scalar value, the attribution value is a
+   *     [floating number][google.protobuf.Value.number_value].
+   *
+   *   * If the feature is an array of scalar values, the attribution value is
+   *     an [array][google.protobuf.Value.list_value].
+   *
+   *   * If the feature is a struct, the attribution value is a
+   *     [struct][google.protobuf.Value.struct_value]. The keys in the
+   *     attribution value struct are the same as the keys in the feature
+   *     struct. The formats of the values in the attribution struct are
+   *     determined by the formats of the values in the feature struct.
+   *
+   * The
+   * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+   * field, pointed to by the
+   * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+   * the
+   * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+   * object, points to the schema file that describes the features and their
+   * attribution values (if it is populated).
+   * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the featureAttributions field is set. + */ + boolean hasFeatureAttributions(); + /** + * + * + *
+   * Output only. Attributions of each explained feature. Features are extracted
+   * from the [prediction
+   * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * according to [explanation metadata for
+   * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   *
+   * The value is a struct, whose keys are the name of the feature. The values
+   * are how much the feature in the
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * contributed to the predicted result.
+   *
+   * The format of the value is determined by the feature's input format:
+   *
+   *   * If the feature is a scalar value, the attribution value is a
+   *     [floating number][google.protobuf.Value.number_value].
+   *
+   *   * If the feature is an array of scalar values, the attribution value is
+   *     an [array][google.protobuf.Value.list_value].
+   *
+   *   * If the feature is a struct, the attribution value is a
+   *     [struct][google.protobuf.Value.struct_value]. The keys in the
+   *     attribution value struct are the same as the keys in the feature
+   *     struct. The formats of the values in the attribution struct are
+   *     determined by the formats of the values in the feature struct.
+   *
+   * The
+   * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+   * field, pointed to by the
+   * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+   * the
+   * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+   * object, points to the schema file that describes the features and their
+   * attribution values (if it is populated).
+   * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The featureAttributions. + */ + com.google.protobuf.Value getFeatureAttributions(); + /** + * + * + *
+   * Output only. Attributions of each explained feature. Features are extracted
+   * from the [prediction
+   * instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * according to [explanation metadata for
+   * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   *
+   * The value is a struct, whose keys are the name of the feature. The values
+   * are how much the feature in the
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]
+   * contributed to the predicted result.
+   *
+   * The format of the value is determined by the feature's input format:
+   *
+   *   * If the feature is a scalar value, the attribution value is a
+   *     [floating number][google.protobuf.Value.number_value].
+   *
+   *   * If the feature is an array of scalar values, the attribution value is
+   *     an [array][google.protobuf.Value.list_value].
+   *
+   *   * If the feature is a struct, the attribution value is a
+   *     [struct][google.protobuf.Value.struct_value]. The keys in the
+   *     attribution value struct are the same as the keys in the feature
+   *     struct. The formats of the values in the attribution struct are
+   *     determined by the formats of the values in the feature struct.
+   *
+   * The
+   * [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
+   * field, pointed to by the
+   * [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of
+   * the
+   * [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models]
+   * object, points to the schema file that describes the features and their
+   * attribution values (if it is populated).
+   * 
+ * + * + * .google.protobuf.Value feature_attributions = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.ValueOrBuilder getFeatureAttributionsOrBuilder(); + + /** + * + * + *
+   * Output only. The index that locates the explained prediction output.
+   *
+   * If the prediction output is a scalar value, output_index is not populated.
+   * If the prediction output has multiple dimensions, the length of the
+   * output_index list is the same as the number of dimensions of the output.
+   * The i-th element in output_index is the element index of the i-th dimension
+   * of the output vector. Indices start from 0.
+   * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the outputIndex. + */ + java.util.List getOutputIndexList(); + /** + * + * + *
+   * Output only. The index that locates the explained prediction output.
+   *
+   * If the prediction output is a scalar value, output_index is not populated.
+   * If the prediction output has multiple dimensions, the length of the
+   * output_index list is the same as the number of dimensions of the output.
+   * The i-th element in output_index is the element index of the i-th dimension
+   * of the output vector. Indices start from 0.
+   * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of outputIndex. + */ + int getOutputIndexCount(); + /** + * + * + *
+   * Output only. The index that locates the explained prediction output.
+   *
+   * If the prediction output is a scalar value, output_index is not populated.
+   * If the prediction output has multiple dimensions, the length of the
+   * output_index list is the same as the number of dimensions of the output.
+   * The i-th element in output_index is the element index of the i-th dimension
+   * of the output vector. Indices start from 0.
+   * 
+ * + * repeated int32 output_index = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The outputIndex at the given index. + */ + int getOutputIndex(int index); + + /** + * + * + *
+   * Output only. The display name of the output identified by
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+   * For example, the predicted class name by a multi-classification Model.
+   *
+   * This field is only populated iff the Model predicts display names as a
+   * separate field along with the explained output. The predicted display name
+   * must has the same shape of the explained output, and can be located using
+   * output_index.
+   * 
+ * + * string output_display_name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The outputDisplayName. + */ + java.lang.String getOutputDisplayName(); + /** + * + * + *
+   * Output only. The display name of the output identified by
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+   * For example, the predicted class name by a multi-classification Model.
+   *
+   * This field is only populated iff the Model predicts display names as a
+   * separate field along with the explained output. The predicted display name
+   * must has the same shape of the explained output, and can be located using
+   * output_index.
+   * 
+ * + * string output_display_name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for outputDisplayName. + */ + com.google.protobuf.ByteString getOutputDisplayNameBytes(); + + /** + * + * + *
+   * Output only. Error of
+   * [feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * caused by approximation used in the explanation method. Lower value means
+   * more precise attributions.
+   *
+   * * For Sampled Shapley
+   * [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.sampled_shapley_attribution],
+   * increasing
+   * [path_count][google.cloud.vertexai.v1beta1.SampledShapleyAttribution.path_count]
+   * might reduce the error.
+   * * For Integrated Gradients
+   * [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+   * increasing
+   * [step_count][google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution.step_count]
+   * might reduce the error.
+   * * For [XRAI
+   * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+   * increasing
+   * [step_count][google.cloud.vertexai.v1beta1.XraiAttribution.step_count]
+   * might reduce the error.
+   *
+   * See [this introduction](/vertex-ai/docs/explainable-ai/overview)
+   * for more information.
+   * 
+ * + * double approximation_error = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The approximationError. + */ + double getApproximationError(); + + /** + * + * + *
+   * Output only. Name of the explain output. Specified as the key in
+   * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+   * 
+ * + * string output_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The outputName. + */ + java.lang.String getOutputName(); + /** + * + * + *
+   * Output only. Name of the explain output. Specified as the key in
+   * [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs].
+   * 
+ * + * string output_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for outputName. + */ + com.google.protobuf.ByteString getOutputNameBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutomaticResources.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutomaticResources.java new file mode 100644 index 000000000000..411b73dd0371 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutomaticResources.java @@ -0,0 +1,683 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A description of resources that to large degree are decided by Vertex AI,
+ * and require only a modest additional configuration.
+ * Each Model supporting these resources documents its specific guidelines.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.AutomaticResources} + */ +public final class AutomaticResources extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.AutomaticResources) + AutomaticResourcesOrBuilder { + private static final long serialVersionUID = 0L; + // Use AutomaticResources.newBuilder() to construct. + private AutomaticResources(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AutomaticResources() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AutomaticResources(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_AutomaticResources_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_AutomaticResources_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.AutomaticResources.class, + com.google.cloud.vertexai.api.AutomaticResources.Builder.class); + } + + public static final int MIN_REPLICA_COUNT_FIELD_NUMBER = 1; + private int minReplicaCount_ = 0; + /** + * + * + *
+   * Immutable. The minimum number of replicas this DeployedModel will be always
+   * deployed on. If traffic against it increases, it may dynamically be
+   * deployed onto more replicas up to
+   * [max_replica_count][google.cloud.vertexai.v1beta1.AutomaticResources.max_replica_count],
+   * and as traffic decreases, some of these extra replicas may be freed. If the
+   * requested value is too large, the deployment will error.
+   * 
+ * + * int32 min_replica_count = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The minReplicaCount. + */ + @java.lang.Override + public int getMinReplicaCount() { + return minReplicaCount_; + } + + public static final int MAX_REPLICA_COUNT_FIELD_NUMBER = 2; + private int maxReplicaCount_ = 0; + /** + * + * + *
+   * Immutable. The maximum number of replicas this DeployedModel may be
+   * deployed on when the traffic against it increases. If the requested value
+   * is too large, the deployment will error, but if deployment succeeds then
+   * the ability to scale the model to that many replicas is guaranteed (barring
+   * service outages). If traffic against the DeployedModel increases beyond
+   * what its replicas at maximum may handle, a portion of the traffic will be
+   * dropped. If this value is not provided, a no upper bound for scaling under
+   * heavy traffic will be assume, though Vertex AI may be unable to scale
+   * beyond certain replica number.
+   * 
+ * + * int32 max_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The maxReplicaCount. + */ + @java.lang.Override + public int getMaxReplicaCount() { + return maxReplicaCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (minReplicaCount_ != 0) { + output.writeInt32(1, minReplicaCount_); + } + if (maxReplicaCount_ != 0) { + output.writeInt32(2, maxReplicaCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minReplicaCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, minReplicaCount_); + } + if (maxReplicaCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxReplicaCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.AutomaticResources)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.AutomaticResources other = + (com.google.cloud.vertexai.api.AutomaticResources) obj; + + if (getMinReplicaCount() != other.getMinReplicaCount()) return false; + if (getMaxReplicaCount() != other.getMaxReplicaCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MIN_REPLICA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinReplicaCount(); + hash = (37 * hash) + MAX_REPLICA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxReplicaCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.AutomaticResources parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.AutomaticResources prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A description of resources that to large degree are decided by Vertex AI,
+   * and require only a modest additional configuration.
+   * Each Model supporting these resources documents its specific guidelines.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.AutomaticResources} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.AutomaticResources) + com.google.cloud.vertexai.api.AutomaticResourcesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_AutomaticResources_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_AutomaticResources_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.AutomaticResources.class, + com.google.cloud.vertexai.api.AutomaticResources.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.AutomaticResources.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minReplicaCount_ = 0; + maxReplicaCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_AutomaticResources_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AutomaticResources getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.AutomaticResources.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AutomaticResources build() { + com.google.cloud.vertexai.api.AutomaticResources result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AutomaticResources buildPartial() { + com.google.cloud.vertexai.api.AutomaticResources result = + new com.google.cloud.vertexai.api.AutomaticResources(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.AutomaticResources result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minReplicaCount_ = minReplicaCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxReplicaCount_ = maxReplicaCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.AutomaticResources) { + return mergeFrom((com.google.cloud.vertexai.api.AutomaticResources) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.AutomaticResources other) { + if (other == com.google.cloud.vertexai.api.AutomaticResources.getDefaultInstance()) + return this; + if (other.getMinReplicaCount() != 0) { + setMinReplicaCount(other.getMinReplicaCount()); + } + if (other.getMaxReplicaCount() != 0) { + setMaxReplicaCount(other.getMaxReplicaCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + minReplicaCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + maxReplicaCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int minReplicaCount_; + /** + * + * + *
+     * Immutable. The minimum number of replicas this DeployedModel will be always
+     * deployed on. If traffic against it increases, it may dynamically be
+     * deployed onto more replicas up to
+     * [max_replica_count][google.cloud.vertexai.v1beta1.AutomaticResources.max_replica_count],
+     * and as traffic decreases, some of these extra replicas may be freed. If the
+     * requested value is too large, the deployment will error.
+     * 
+ * + * int32 min_replica_count = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The minReplicaCount. + */ + @java.lang.Override + public int getMinReplicaCount() { + return minReplicaCount_; + } + /** + * + * + *
+     * Immutable. The minimum number of replicas this DeployedModel will be always
+     * deployed on. If traffic against it increases, it may dynamically be
+     * deployed onto more replicas up to
+     * [max_replica_count][google.cloud.vertexai.v1beta1.AutomaticResources.max_replica_count],
+     * and as traffic decreases, some of these extra replicas may be freed. If the
+     * requested value is too large, the deployment will error.
+     * 
+ * + * int32 min_replica_count = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The minReplicaCount to set. + * @return This builder for chaining. + */ + public Builder setMinReplicaCount(int value) { + + minReplicaCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The minimum number of replicas this DeployedModel will be always
+     * deployed on. If traffic against it increases, it may dynamically be
+     * deployed onto more replicas up to
+     * [max_replica_count][google.cloud.vertexai.v1beta1.AutomaticResources.max_replica_count],
+     * and as traffic decreases, some of these extra replicas may be freed. If the
+     * requested value is too large, the deployment will error.
+     * 
+ * + * int32 min_replica_count = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearMinReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000001); + minReplicaCount_ = 0; + onChanged(); + return this; + } + + private int maxReplicaCount_; + /** + * + * + *
+     * Immutable. The maximum number of replicas this DeployedModel may be
+     * deployed on when the traffic against it increases. If the requested value
+     * is too large, the deployment will error, but if deployment succeeds then
+     * the ability to scale the model to that many replicas is guaranteed (barring
+     * service outages). If traffic against the DeployedModel increases beyond
+     * what its replicas at maximum may handle, a portion of the traffic will be
+     * dropped. If this value is not provided, a no upper bound for scaling under
+     * heavy traffic will be assume, though Vertex AI may be unable to scale
+     * beyond certain replica number.
+     * 
+ * + * int32 max_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The maxReplicaCount. + */ + @java.lang.Override + public int getMaxReplicaCount() { + return maxReplicaCount_; + } + /** + * + * + *
+     * Immutable. The maximum number of replicas this DeployedModel may be
+     * deployed on when the traffic against it increases. If the requested value
+     * is too large, the deployment will error, but if deployment succeeds then
+     * the ability to scale the model to that many replicas is guaranteed (barring
+     * service outages). If traffic against the DeployedModel increases beyond
+     * what its replicas at maximum may handle, a portion of the traffic will be
+     * dropped. If this value is not provided, a no upper bound for scaling under
+     * heavy traffic will be assume, though Vertex AI may be unable to scale
+     * beyond certain replica number.
+     * 
+ * + * int32 max_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The maxReplicaCount to set. + * @return This builder for chaining. + */ + public Builder setMaxReplicaCount(int value) { + + maxReplicaCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The maximum number of replicas this DeployedModel may be
+     * deployed on when the traffic against it increases. If the requested value
+     * is too large, the deployment will error, but if deployment succeeds then
+     * the ability to scale the model to that many replicas is guaranteed (barring
+     * service outages). If traffic against the DeployedModel increases beyond
+     * what its replicas at maximum may handle, a portion of the traffic will be
+     * dropped. If this value is not provided, a no upper bound for scaling under
+     * heavy traffic will be assume, though Vertex AI may be unable to scale
+     * beyond certain replica number.
+     * 
+ * + * int32 max_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearMaxReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000002); + maxReplicaCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.AutomaticResources) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.AutomaticResources) + private static final com.google.cloud.vertexai.api.AutomaticResources DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.AutomaticResources(); + } + + public static com.google.cloud.vertexai.api.AutomaticResources getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutomaticResources parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AutomaticResources getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutomaticResourcesOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutomaticResourcesOrBuilder.java new file mode 100644 index 000000000000..1d27d492f23a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutomaticResourcesOrBuilder.java @@ -0,0 +1,64 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +public interface AutomaticResourcesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.AutomaticResources) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The minimum number of replicas this DeployedModel will be always
+   * deployed on. If traffic against it increases, it may dynamically be
+   * deployed onto more replicas up to
+   * [max_replica_count][google.cloud.vertexai.v1beta1.AutomaticResources.max_replica_count],
+   * and as traffic decreases, some of these extra replicas may be freed. If the
+   * requested value is too large, the deployment will error.
+   * 
+ * + * int32 min_replica_count = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The minReplicaCount. + */ + int getMinReplicaCount(); + + /** + * + * + *
+   * Immutable. The maximum number of replicas this DeployedModel may be
+   * deployed on when the traffic against it increases. If the requested value
+   * is too large, the deployment will error, but if deployment succeeds then
+   * the ability to scale the model to that many replicas is guaranteed (barring
+   * service outages). If traffic against the DeployedModel increases beyond
+   * what its replicas at maximum may handle, a portion of the traffic will be
+   * dropped. If this value is not provided, a no upper bound for scaling under
+   * heavy traffic will be assume, though Vertex AI may be unable to scale
+   * beyond certain replica number.
+   * 
+ * + * int32 max_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The maxReplicaCount. + */ + int getMaxReplicaCount(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutoscalingMetricSpec.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutoscalingMetricSpec.java new file mode 100644 index 000000000000..566415dffbd0 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutoscalingMetricSpec.java @@ -0,0 +1,768 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The metric specification that defines the target resource utilization
+ * (CPU utilization, accelerator's duty cycle, and so on) for calculating the
+ * desired replica count.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.AutoscalingMetricSpec} + */ +public final class AutoscalingMetricSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.AutoscalingMetricSpec) + AutoscalingMetricSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use AutoscalingMetricSpec.newBuilder() to construct. + private AutoscalingMetricSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AutoscalingMetricSpec() { + metricName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AutoscalingMetricSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_AutoscalingMetricSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_AutoscalingMetricSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.AutoscalingMetricSpec.class, + com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder.class); + } + + public static final int METRIC_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object metricName_ = ""; + /** + * + * + *
+   * Required. The resource metric name.
+   * Supported metrics:
+   *
+   * * For Online Prediction:
+   * * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle`
+   * * `aiplatform.googleapis.com/prediction/online/cpu/utilization`
+   * 
+ * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The metricName. + */ + @java.lang.Override + public java.lang.String getMetricName() { + java.lang.Object ref = metricName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource metric name.
+   * Supported metrics:
+   *
+   * * For Online Prediction:
+   * * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle`
+   * * `aiplatform.googleapis.com/prediction/online/cpu/utilization`
+   * 
+ * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for metricName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetricNameBytes() { + java.lang.Object ref = metricName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_FIELD_NUMBER = 2; + private int target_ = 0; + /** + * + * + *
+   * The target resource utilization in percentage (1% - 100%) for the given
+   * metric; once the real usage deviates from the target by a certain
+   * percentage, the machine replicas change. The default value is 60
+   * (representing 60%) if not provided.
+   * 
+ * + * int32 target = 2; + * + * @return The target. + */ + @java.lang.Override + public int getTarget() { + return target_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, metricName_); + } + if (target_ != 0) { + output.writeInt32(2, target_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, metricName_); + } + if (target_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, target_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.AutoscalingMetricSpec)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.AutoscalingMetricSpec other = + (com.google.cloud.vertexai.api.AutoscalingMetricSpec) obj; + + if (!getMetricName().equals(other.getMetricName())) return false; + if (getTarget() != other.getTarget()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + METRIC_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMetricName().hashCode(); + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.AutoscalingMetricSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The metric specification that defines the target resource utilization
+   * (CPU utilization, accelerator's duty cycle, and so on) for calculating the
+   * desired replica count.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.AutoscalingMetricSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.AutoscalingMetricSpec) + com.google.cloud.vertexai.api.AutoscalingMetricSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_AutoscalingMetricSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_AutoscalingMetricSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.AutoscalingMetricSpec.class, + com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.AutoscalingMetricSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metricName_ = ""; + target_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_AutoscalingMetricSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AutoscalingMetricSpec getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.AutoscalingMetricSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AutoscalingMetricSpec build() { + com.google.cloud.vertexai.api.AutoscalingMetricSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AutoscalingMetricSpec buildPartial() { + com.google.cloud.vertexai.api.AutoscalingMetricSpec result = + new com.google.cloud.vertexai.api.AutoscalingMetricSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.AutoscalingMetricSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metricName_ = metricName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.target_ = target_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.AutoscalingMetricSpec) { + return mergeFrom((com.google.cloud.vertexai.api.AutoscalingMetricSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.AutoscalingMetricSpec other) { + if (other == com.google.cloud.vertexai.api.AutoscalingMetricSpec.getDefaultInstance()) + return this; + if (!other.getMetricName().isEmpty()) { + metricName_ = other.metricName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getTarget() != 0) { + setTarget(other.getTarget()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + metricName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + target_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object metricName_ = ""; + /** + * + * + *
+     * Required. The resource metric name.
+     * Supported metrics:
+     *
+     * * For Online Prediction:
+     * * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle`
+     * * `aiplatform.googleapis.com/prediction/online/cpu/utilization`
+     * 
+ * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The metricName. + */ + public java.lang.String getMetricName() { + java.lang.Object ref = metricName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource metric name.
+     * Supported metrics:
+     *
+     * * For Online Prediction:
+     * * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle`
+     * * `aiplatform.googleapis.com/prediction/online/cpu/utilization`
+     * 
+ * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for metricName. + */ + public com.google.protobuf.ByteString getMetricNameBytes() { + java.lang.Object ref = metricName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource metric name.
+     * Supported metrics:
+     *
+     * * For Online Prediction:
+     * * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle`
+     * * `aiplatform.googleapis.com/prediction/online/cpu/utilization`
+     * 
+ * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The metricName to set. + * @return This builder for chaining. + */ + public Builder setMetricName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + metricName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource metric name.
+     * Supported metrics:
+     *
+     * * For Online Prediction:
+     * * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle`
+     * * `aiplatform.googleapis.com/prediction/online/cpu/utilization`
+     * 
+ * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMetricName() { + metricName_ = getDefaultInstance().getMetricName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource metric name.
+     * Supported metrics:
+     *
+     * * For Online Prediction:
+     * * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle`
+     * * `aiplatform.googleapis.com/prediction/online/cpu/utilization`
+     * 
+ * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for metricName to set. + * @return This builder for chaining. + */ + public Builder setMetricNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + metricName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int target_; + /** + * + * + *
+     * The target resource utilization in percentage (1% - 100%) for the given
+     * metric; once the real usage deviates from the target by a certain
+     * percentage, the machine replicas change. The default value is 60
+     * (representing 60%) if not provided.
+     * 
+ * + * int32 target = 2; + * + * @return The target. + */ + @java.lang.Override + public int getTarget() { + return target_; + } + /** + * + * + *
+     * The target resource utilization in percentage (1% - 100%) for the given
+     * metric; once the real usage deviates from the target by a certain
+     * percentage, the machine replicas change. The default value is 60
+     * (representing 60%) if not provided.
+     * 
+ * + * int32 target = 2; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(int value) { + + target_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The target resource utilization in percentage (1% - 100%) for the given
+     * metric; once the real usage deviates from the target by a certain
+     * percentage, the machine replicas change. The default value is 60
+     * (representing 60%) if not provided.
+     * 
+ * + * int32 target = 2; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + bitField0_ = (bitField0_ & ~0x00000002); + target_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.AutoscalingMetricSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.AutoscalingMetricSpec) + private static final com.google.cloud.vertexai.api.AutoscalingMetricSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.AutoscalingMetricSpec(); + } + + public static com.google.cloud.vertexai.api.AutoscalingMetricSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutoscalingMetricSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AutoscalingMetricSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutoscalingMetricSpecOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutoscalingMetricSpecOrBuilder.java new file mode 100644 index 000000000000..2a690061b88b --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AutoscalingMetricSpecOrBuilder.java @@ -0,0 +1,76 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +public interface AutoscalingMetricSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.AutoscalingMetricSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource metric name.
+   * Supported metrics:
+   *
+   * * For Online Prediction:
+   * * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle`
+   * * `aiplatform.googleapis.com/prediction/online/cpu/utilization`
+   * 
+ * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The metricName. + */ + java.lang.String getMetricName(); + /** + * + * + *
+   * Required. The resource metric name.
+   * Supported metrics:
+   *
+   * * For Online Prediction:
+   * * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle`
+   * * `aiplatform.googleapis.com/prediction/online/cpu/utilization`
+   * 
+ * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for metricName. + */ + com.google.protobuf.ByteString getMetricNameBytes(); + + /** + * + * + *
+   * The target resource utilization in percentage (1% - 100%) for the given
+   * metric; once the real usage deviates from the target by a certain
+   * percentage, the machine replicas change. The default value is 60
+   * (representing 60%) if not provided.
+   * 
+ * + * int32 target = 2; + * + * @return The target. + */ + int getTarget(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AvroSource.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AvroSource.java new file mode 100644 index 000000000000..06ed8bc1abb0 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AvroSource.java @@ -0,0 +1,727 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The storage details for Avro input content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.AvroSource} + */ +public final class AvroSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.AvroSource) + AvroSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use AvroSource.newBuilder() to construct. + private AvroSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AvroSource() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AvroSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_AvroSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_AvroSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.AvroSource.class, + com.google.cloud.vertexai.api.AvroSource.Builder.class); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.GcsSource gcsSource_; + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return gcsSource_ != null; + } + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSource getGcsSource() { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder() { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gcsSource_ != null) { + output.writeMessage(1, getGcsSource()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gcsSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcsSource()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.AvroSource)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.AvroSource other = (com.google.cloud.vertexai.api.AvroSource) obj; + + if (hasGcsSource() != other.hasGcsSource()) return false; + if (hasGcsSource()) { + if (!getGcsSource().equals(other.getGcsSource())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGcsSource()) { + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.AvroSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.AvroSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AvroSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.AvroSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AvroSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.AvroSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AvroSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.AvroSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AvroSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.AvroSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.AvroSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.AvroSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.AvroSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The storage details for Avro input content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.AvroSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.AvroSource) + com.google.cloud.vertexai.api.AvroSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_AvroSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_AvroSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.AvroSource.class, + com.google.cloud.vertexai.api.AvroSource.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.AvroSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + gcsSource_ = null; + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.dispose(); + gcsSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_AvroSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AvroSource getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.AvroSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AvroSource build() { + com.google.cloud.vertexai.api.AvroSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AvroSource buildPartial() { + com.google.cloud.vertexai.api.AvroSource result = + new com.google.cloud.vertexai.api.AvroSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.AvroSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.gcsSource_ = gcsSourceBuilder_ == null ? gcsSource_ : gcsSourceBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.AvroSource) { + return mergeFrom((com.google.cloud.vertexai.api.AvroSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.AvroSource other) { + if (other == com.google.cloud.vertexai.api.AvroSource.getDefaultInstance()) return this; + if (other.hasGcsSource()) { + mergeGcsSource(other.getGcsSource()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGcsSourceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.GcsSource gcsSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + public boolean hasGcsSource() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + public com.google.cloud.vertexai.api.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } else { + return gcsSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsSource(com.google.cloud.vertexai.api.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcsSource_ = value; + } else { + gcsSourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsSource(com.google.cloud.vertexai.api.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + gcsSource_ = builderForValue.build(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeGcsSource(com.google.cloud.vertexai.api.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && gcsSource_ != null + && gcsSource_ != com.google.cloud.vertexai.api.GcsSource.getDefaultInstance()) { + getGcsSourceBuilder().mergeFrom(value); + } else { + gcsSource_ = value; + } + } else { + gcsSourceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearGcsSource() { + bitField0_ = (bitField0_ & ~0x00000001); + gcsSource_ = null; + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.dispose(); + gcsSourceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.GcsSource.Builder getGcsSourceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (gcsSourceBuilder_ != null) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder>( + getGcsSource(), getParentForChildren(), isClean()); + gcsSource_ = null; + } + return gcsSourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.AvroSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.AvroSource) + private static final com.google.cloud.vertexai.api.AvroSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.AvroSource(); + } + + public static com.google.cloud.vertexai.api.AvroSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AvroSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.AvroSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AvroSourceOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AvroSourceOrBuilder.java new file mode 100644 index 000000000000..501c5d1a288a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/AvroSourceOrBuilder.java @@ -0,0 +1,66 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +public interface AvroSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.AvroSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + com.google.cloud.vertexai.api.GcsSource getGcsSource(); + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BatchDedicatedResources.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BatchDedicatedResources.java new file mode 100644 index 000000000000..e211c89443e6 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BatchDedicatedResources.java @@ -0,0 +1,932 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A description of resources that are used for performing batch operations, are
+ * dedicated to a Model, and need manual configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.BatchDedicatedResources} + */ +public final class BatchDedicatedResources extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.BatchDedicatedResources) + BatchDedicatedResourcesOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchDedicatedResources.newBuilder() to construct. + private BatchDedicatedResources(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchDedicatedResources() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchDedicatedResources(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_BatchDedicatedResources_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_BatchDedicatedResources_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.BatchDedicatedResources.class, + com.google.cloud.vertexai.api.BatchDedicatedResources.Builder.class); + } + + public static final int MACHINE_SPEC_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.MachineSpec machineSpec_; + /** + * + * + *
+   * Required. Immutable. The specification of a single machine.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the machineSpec field is set. + */ + @java.lang.Override + public boolean hasMachineSpec() { + return machineSpec_ != null; + } + /** + * + * + *
+   * Required. Immutable. The specification of a single machine.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The machineSpec. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.MachineSpec getMachineSpec() { + return machineSpec_ == null + ? com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance() + : machineSpec_; + } + /** + * + * + *
+   * Required. Immutable. The specification of a single machine.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.MachineSpecOrBuilder getMachineSpecOrBuilder() { + return machineSpec_ == null + ? com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance() + : machineSpec_; + } + + public static final int STARTING_REPLICA_COUNT_FIELD_NUMBER = 2; + private int startingReplicaCount_ = 0; + /** + * + * + *
+   * Immutable. The number of machine replicas used at the start of the batch
+   * operation. If not set, Vertex AI decides starting number, not greater than
+   * [max_replica_count][google.cloud.vertexai.v1beta1.BatchDedicatedResources.max_replica_count]
+   * 
+ * + * int32 starting_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The startingReplicaCount. + */ + @java.lang.Override + public int getStartingReplicaCount() { + return startingReplicaCount_; + } + + public static final int MAX_REPLICA_COUNT_FIELD_NUMBER = 3; + private int maxReplicaCount_ = 0; + /** + * + * + *
+   * Immutable. The maximum number of machine replicas the batch operation may
+   * be scaled to. The default value is 10.
+   * 
+ * + * int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The maxReplicaCount. + */ + @java.lang.Override + public int getMaxReplicaCount() { + return maxReplicaCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (machineSpec_ != null) { + output.writeMessage(1, getMachineSpec()); + } + if (startingReplicaCount_ != 0) { + output.writeInt32(2, startingReplicaCount_); + } + if (maxReplicaCount_ != 0) { + output.writeInt32(3, maxReplicaCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (machineSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMachineSpec()); + } + if (startingReplicaCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, startingReplicaCount_); + } + if (maxReplicaCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxReplicaCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.BatchDedicatedResources)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.BatchDedicatedResources other = + (com.google.cloud.vertexai.api.BatchDedicatedResources) obj; + + if (hasMachineSpec() != other.hasMachineSpec()) return false; + if (hasMachineSpec()) { + if (!getMachineSpec().equals(other.getMachineSpec())) return false; + } + if (getStartingReplicaCount() != other.getStartingReplicaCount()) return false; + if (getMaxReplicaCount() != other.getMaxReplicaCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMachineSpec()) { + hash = (37 * hash) + MACHINE_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getMachineSpec().hashCode(); + } + hash = (37 * hash) + STARTING_REPLICA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getStartingReplicaCount(); + hash = (37 * hash) + MAX_REPLICA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxReplicaCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.BatchDedicatedResources prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A description of resources that are used for performing batch operations, are
+   * dedicated to a Model, and need manual configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.BatchDedicatedResources} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.BatchDedicatedResources) + com.google.cloud.vertexai.api.BatchDedicatedResourcesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_BatchDedicatedResources_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_BatchDedicatedResources_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.BatchDedicatedResources.class, + com.google.cloud.vertexai.api.BatchDedicatedResources.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.BatchDedicatedResources.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + machineSpec_ = null; + if (machineSpecBuilder_ != null) { + machineSpecBuilder_.dispose(); + machineSpecBuilder_ = null; + } + startingReplicaCount_ = 0; + maxReplicaCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_BatchDedicatedResources_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BatchDedicatedResources getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.BatchDedicatedResources.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BatchDedicatedResources build() { + com.google.cloud.vertexai.api.BatchDedicatedResources result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BatchDedicatedResources buildPartial() { + com.google.cloud.vertexai.api.BatchDedicatedResources result = + new com.google.cloud.vertexai.api.BatchDedicatedResources(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.BatchDedicatedResources result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.machineSpec_ = + machineSpecBuilder_ == null ? machineSpec_ : machineSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startingReplicaCount_ = startingReplicaCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maxReplicaCount_ = maxReplicaCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.BatchDedicatedResources) { + return mergeFrom((com.google.cloud.vertexai.api.BatchDedicatedResources) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.BatchDedicatedResources other) { + if (other == com.google.cloud.vertexai.api.BatchDedicatedResources.getDefaultInstance()) + return this; + if (other.hasMachineSpec()) { + mergeMachineSpec(other.getMachineSpec()); + } + if (other.getStartingReplicaCount() != 0) { + setStartingReplicaCount(other.getStartingReplicaCount()); + } + if (other.getMaxReplicaCount() != 0) { + setMaxReplicaCount(other.getMaxReplicaCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getMachineSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + startingReplicaCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + maxReplicaCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.MachineSpec machineSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.MachineSpec, + com.google.cloud.vertexai.api.MachineSpec.Builder, + com.google.cloud.vertexai.api.MachineSpecOrBuilder> + machineSpecBuilder_; + /** + * + * + *
+     * Required. Immutable. The specification of a single machine.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the machineSpec field is set. + */ + public boolean hasMachineSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The machineSpec. + */ + public com.google.cloud.vertexai.api.MachineSpec getMachineSpec() { + if (machineSpecBuilder_ == null) { + return machineSpec_ == null + ? com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance() + : machineSpec_; + } else { + return machineSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setMachineSpec(com.google.cloud.vertexai.api.MachineSpec value) { + if (machineSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + machineSpec_ = value; + } else { + machineSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setMachineSpec( + com.google.cloud.vertexai.api.MachineSpec.Builder builderForValue) { + if (machineSpecBuilder_ == null) { + machineSpec_ = builderForValue.build(); + } else { + machineSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeMachineSpec(com.google.cloud.vertexai.api.MachineSpec value) { + if (machineSpecBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && machineSpec_ != null + && machineSpec_ != com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance()) { + getMachineSpecBuilder().mergeFrom(value); + } else { + machineSpec_ = value; + } + } else { + machineSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearMachineSpec() { + bitField0_ = (bitField0_ & ~0x00000001); + machineSpec_ = null; + if (machineSpecBuilder_ != null) { + machineSpecBuilder_.dispose(); + machineSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.vertexai.api.MachineSpec.Builder getMachineSpecBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMachineSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.vertexai.api.MachineSpecOrBuilder getMachineSpecOrBuilder() { + if (machineSpecBuilder_ != null) { + return machineSpecBuilder_.getMessageOrBuilder(); + } else { + return machineSpec_ == null + ? com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance() + : machineSpec_; + } + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.MachineSpec, + com.google.cloud.vertexai.api.MachineSpec.Builder, + com.google.cloud.vertexai.api.MachineSpecOrBuilder> + getMachineSpecFieldBuilder() { + if (machineSpecBuilder_ == null) { + machineSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.MachineSpec, + com.google.cloud.vertexai.api.MachineSpec.Builder, + com.google.cloud.vertexai.api.MachineSpecOrBuilder>( + getMachineSpec(), getParentForChildren(), isClean()); + machineSpec_ = null; + } + return machineSpecBuilder_; + } + + private int startingReplicaCount_; + /** + * + * + *
+     * Immutable. The number of machine replicas used at the start of the batch
+     * operation. If not set, Vertex AI decides starting number, not greater than
+     * [max_replica_count][google.cloud.vertexai.v1beta1.BatchDedicatedResources.max_replica_count]
+     * 
+ * + * int32 starting_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The startingReplicaCount. + */ + @java.lang.Override + public int getStartingReplicaCount() { + return startingReplicaCount_; + } + /** + * + * + *
+     * Immutable. The number of machine replicas used at the start of the batch
+     * operation. If not set, Vertex AI decides starting number, not greater than
+     * [max_replica_count][google.cloud.vertexai.v1beta1.BatchDedicatedResources.max_replica_count]
+     * 
+ * + * int32 starting_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The startingReplicaCount to set. + * @return This builder for chaining. + */ + public Builder setStartingReplicaCount(int value) { + + startingReplicaCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The number of machine replicas used at the start of the batch
+     * operation. If not set, Vertex AI decides starting number, not greater than
+     * [max_replica_count][google.cloud.vertexai.v1beta1.BatchDedicatedResources.max_replica_count]
+     * 
+ * + * int32 starting_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearStartingReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000002); + startingReplicaCount_ = 0; + onChanged(); + return this; + } + + private int maxReplicaCount_; + /** + * + * + *
+     * Immutable. The maximum number of machine replicas the batch operation may
+     * be scaled to. The default value is 10.
+     * 
+ * + * int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The maxReplicaCount. + */ + @java.lang.Override + public int getMaxReplicaCount() { + return maxReplicaCount_; + } + /** + * + * + *
+     * Immutable. The maximum number of machine replicas the batch operation may
+     * be scaled to. The default value is 10.
+     * 
+ * + * int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The maxReplicaCount to set. + * @return This builder for chaining. + */ + public Builder setMaxReplicaCount(int value) { + + maxReplicaCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The maximum number of machine replicas the batch operation may
+     * be scaled to. The default value is 10.
+     * 
+ * + * int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearMaxReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000004); + maxReplicaCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.BatchDedicatedResources) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.BatchDedicatedResources) + private static final com.google.cloud.vertexai.api.BatchDedicatedResources DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.BatchDedicatedResources(); + } + + public static com.google.cloud.vertexai.api.BatchDedicatedResources getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchDedicatedResources parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BatchDedicatedResources getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BatchDedicatedResourcesOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BatchDedicatedResourcesOrBuilder.java new file mode 100644 index 000000000000..b407d41aff18 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BatchDedicatedResourcesOrBuilder.java @@ -0,0 +1,95 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +public interface BatchDedicatedResourcesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.BatchDedicatedResources) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. The specification of a single machine.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the machineSpec field is set. + */ + boolean hasMachineSpec(); + /** + * + * + *
+   * Required. Immutable. The specification of a single machine.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The machineSpec. + */ + com.google.cloud.vertexai.api.MachineSpec getMachineSpec(); + /** + * + * + *
+   * Required. Immutable. The specification of a single machine.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.vertexai.api.MachineSpecOrBuilder getMachineSpecOrBuilder(); + + /** + * + * + *
+   * Immutable. The number of machine replicas used at the start of the batch
+   * operation. If not set, Vertex AI decides starting number, not greater than
+   * [max_replica_count][google.cloud.vertexai.v1beta1.BatchDedicatedResources.max_replica_count]
+   * 
+ * + * int32 starting_replica_count = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The startingReplicaCount. + */ + int getStartingReplicaCount(); + + /** + * + * + *
+   * Immutable. The maximum number of machine replicas the batch operation may
+   * be scaled to. The default value is 10.
+   * 
+ * + * int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The maxReplicaCount. + */ + int getMaxReplicaCount(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQueryDestination.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQueryDestination.java new file mode 100644 index 000000000000..7502fd589bf6 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQueryDestination.java @@ -0,0 +1,694 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The BigQuery location for the output content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.BigQueryDestination} + */ +public final class BigQueryDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.BigQueryDestination) + BigQueryDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use BigQueryDestination.newBuilder() to construct. + private BigQueryDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigQueryDestination() { + outputUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BigQueryDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_BigQueryDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_BigQueryDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.BigQueryDestination.class, + com.google.cloud.vertexai.api.BigQueryDestination.Builder.class); + } + + public static final int OUTPUT_URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object outputUri_ = ""; + /** + * + * + *
+   * Required. BigQuery URI to a project or table, up to 2000 characters long.
+   *
+   * When only the project is specified, the Dataset and Table is created.
+   * When the full table reference is specified, the Dataset must exist and
+   * table must not exist.
+   *
+   * Accepted forms:
+   *
+   * *  BigQuery path. For example:
+   * `bq://projectId` or `bq://projectId.bqDatasetId` or
+   * `bq://projectId.bqDatasetId.bqTableId`.
+   * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUri. + */ + @java.lang.Override + public java.lang.String getOutputUri() { + java.lang.Object ref = outputUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. BigQuery URI to a project or table, up to 2000 characters long.
+   *
+   * When only the project is specified, the Dataset and Table is created.
+   * When the full table reference is specified, the Dataset must exist and
+   * table must not exist.
+   *
+   * Accepted forms:
+   *
+   * *  BigQuery path. For example:
+   * `bq://projectId` or `bq://projectId.bqDatasetId` or
+   * `bq://projectId.bqDatasetId.bqTableId`.
+   * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputUriBytes() { + java.lang.Object ref = outputUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputUri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputUri_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.BigQueryDestination)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.BigQueryDestination other = + (com.google.cloud.vertexai.api.BigQueryDestination) obj; + + if (!getOutputUri().equals(other.getOutputUri())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OUTPUT_URI_FIELD_NUMBER; + hash = (53 * hash) + getOutputUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.BigQueryDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The BigQuery location for the output content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.BigQueryDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.BigQueryDestination) + com.google.cloud.vertexai.api.BigQueryDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_BigQueryDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_BigQueryDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.BigQueryDestination.class, + com.google.cloud.vertexai.api.BigQueryDestination.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.BigQueryDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + outputUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_BigQueryDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BigQueryDestination getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.BigQueryDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BigQueryDestination build() { + com.google.cloud.vertexai.api.BigQueryDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BigQueryDestination buildPartial() { + com.google.cloud.vertexai.api.BigQueryDestination result = + new com.google.cloud.vertexai.api.BigQueryDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.BigQueryDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.outputUri_ = outputUri_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.BigQueryDestination) { + return mergeFrom((com.google.cloud.vertexai.api.BigQueryDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.BigQueryDestination other) { + if (other == com.google.cloud.vertexai.api.BigQueryDestination.getDefaultInstance()) + return this; + if (!other.getOutputUri().isEmpty()) { + outputUri_ = other.outputUri_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + outputUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object outputUri_ = ""; + /** + * + * + *
+     * Required. BigQuery URI to a project or table, up to 2000 characters long.
+     *
+     * When only the project is specified, the Dataset and Table is created.
+     * When the full table reference is specified, the Dataset must exist and
+     * table must not exist.
+     *
+     * Accepted forms:
+     *
+     * *  BigQuery path. For example:
+     * `bq://projectId` or `bq://projectId.bqDatasetId` or
+     * `bq://projectId.bqDatasetId.bqTableId`.
+     * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUri. + */ + public java.lang.String getOutputUri() { + java.lang.Object ref = outputUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. BigQuery URI to a project or table, up to 2000 characters long.
+     *
+     * When only the project is specified, the Dataset and Table is created.
+     * When the full table reference is specified, the Dataset must exist and
+     * table must not exist.
+     *
+     * Accepted forms:
+     *
+     * *  BigQuery path. For example:
+     * `bq://projectId` or `bq://projectId.bqDatasetId` or
+     * `bq://projectId.bqDatasetId.bqTableId`.
+     * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUri. + */ + public com.google.protobuf.ByteString getOutputUriBytes() { + java.lang.Object ref = outputUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. BigQuery URI to a project or table, up to 2000 characters long.
+     *
+     * When only the project is specified, the Dataset and Table is created.
+     * When the full table reference is specified, the Dataset must exist and
+     * table must not exist.
+     *
+     * Accepted forms:
+     *
+     * *  BigQuery path. For example:
+     * `bq://projectId` or `bq://projectId.bqDatasetId` or
+     * `bq://projectId.bqDatasetId.bqTableId`.
+     * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The outputUri to set. + * @return This builder for chaining. + */ + public Builder setOutputUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. BigQuery URI to a project or table, up to 2000 characters long.
+     *
+     * When only the project is specified, the Dataset and Table is created.
+     * When the full table reference is specified, the Dataset must exist and
+     * table must not exist.
+     *
+     * Accepted forms:
+     *
+     * *  BigQuery path. For example:
+     * `bq://projectId` or `bq://projectId.bqDatasetId` or
+     * `bq://projectId.bqDatasetId.bqTableId`.
+     * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearOutputUri() { + outputUri_ = getDefaultInstance().getOutputUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. BigQuery URI to a project or table, up to 2000 characters long.
+     *
+     * When only the project is specified, the Dataset and Table is created.
+     * When the full table reference is specified, the Dataset must exist and
+     * table must not exist.
+     *
+     * Accepted forms:
+     *
+     * *  BigQuery path. For example:
+     * `bq://projectId` or `bq://projectId.bqDatasetId` or
+     * `bq://projectId.bqDatasetId.bqTableId`.
+     * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for outputUri to set. + * @return This builder for chaining. + */ + public Builder setOutputUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.BigQueryDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.BigQueryDestination) + private static final com.google.cloud.vertexai.api.BigQueryDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.BigQueryDestination(); + } + + public static com.google.cloud.vertexai.api.BigQueryDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQueryDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BigQueryDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQueryDestinationOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQueryDestinationOrBuilder.java new file mode 100644 index 000000000000..0c8b719e393f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQueryDestinationOrBuilder.java @@ -0,0 +1,70 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +public interface BigQueryDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.BigQueryDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. BigQuery URI to a project or table, up to 2000 characters long.
+   *
+   * When only the project is specified, the Dataset and Table is created.
+   * When the full table reference is specified, the Dataset must exist and
+   * table must not exist.
+   *
+   * Accepted forms:
+   *
+   * *  BigQuery path. For example:
+   * `bq://projectId` or `bq://projectId.bqDatasetId` or
+   * `bq://projectId.bqDatasetId.bqTableId`.
+   * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUri. + */ + java.lang.String getOutputUri(); + /** + * + * + *
+   * Required. BigQuery URI to a project or table, up to 2000 characters long.
+   *
+   * When only the project is specified, the Dataset and Table is created.
+   * When the full table reference is specified, the Dataset must exist and
+   * table must not exist.
+   *
+   * Accepted forms:
+   *
+   * *  BigQuery path. For example:
+   * `bq://projectId` or `bq://projectId.bqDatasetId` or
+   * `bq://projectId.bqDatasetId.bqTableId`.
+   * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUri. + */ + com.google.protobuf.ByteString getOutputUriBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQuerySource.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQuerySource.java new file mode 100644 index 000000000000..cfe7213301e0 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQuerySource.java @@ -0,0 +1,644 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The BigQuery location for the input content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.BigQuerySource} + */ +public final class BigQuerySource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.BigQuerySource) + BigQuerySourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use BigQuerySource.newBuilder() to construct. + private BigQuerySource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigQuerySource() { + inputUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BigQuerySource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_BigQuerySource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_BigQuerySource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.BigQuerySource.class, + com.google.cloud.vertexai.api.BigQuerySource.Builder.class); + } + + public static final int INPUT_URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object inputUri_ = ""; + /** + * + * + *
+   * Required. BigQuery URI to a table, up to 2000 characters long.
+   * Accepted forms:
+   *
+   * *  BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`.
+   * 
+ * + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The inputUri. + */ + @java.lang.Override + public java.lang.String getInputUri() { + java.lang.Object ref = inputUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputUri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. BigQuery URI to a table, up to 2000 characters long.
+   * Accepted forms:
+   *
+   * *  BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`.
+   * 
+ * + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for inputUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInputUriBytes() { + java.lang.Object ref = inputUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputUri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, inputUri_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.BigQuerySource)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.BigQuerySource other = + (com.google.cloud.vertexai.api.BigQuerySource) obj; + + if (!getInputUri().equals(other.getInputUri())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INPUT_URI_FIELD_NUMBER; + hash = (53 * hash) + getInputUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BigQuerySource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.BigQuerySource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The BigQuery location for the input content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.BigQuerySource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.BigQuerySource) + com.google.cloud.vertexai.api.BigQuerySourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_BigQuerySource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_BigQuerySource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.BigQuerySource.class, + com.google.cloud.vertexai.api.BigQuerySource.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.BigQuerySource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + inputUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_BigQuerySource_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BigQuerySource getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.BigQuerySource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BigQuerySource build() { + com.google.cloud.vertexai.api.BigQuerySource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BigQuerySource buildPartial() { + com.google.cloud.vertexai.api.BigQuerySource result = + new com.google.cloud.vertexai.api.BigQuerySource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.BigQuerySource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.inputUri_ = inputUri_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.BigQuerySource) { + return mergeFrom((com.google.cloud.vertexai.api.BigQuerySource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.BigQuerySource other) { + if (other == com.google.cloud.vertexai.api.BigQuerySource.getDefaultInstance()) return this; + if (!other.getInputUri().isEmpty()) { + inputUri_ = other.inputUri_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + inputUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object inputUri_ = ""; + /** + * + * + *
+     * Required. BigQuery URI to a table, up to 2000 characters long.
+     * Accepted forms:
+     *
+     * *  BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`.
+     * 
+ * + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The inputUri. + */ + public java.lang.String getInputUri() { + java.lang.Object ref = inputUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. BigQuery URI to a table, up to 2000 characters long.
+     * Accepted forms:
+     *
+     * *  BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`.
+     * 
+ * + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for inputUri. + */ + public com.google.protobuf.ByteString getInputUriBytes() { + java.lang.Object ref = inputUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. BigQuery URI to a table, up to 2000 characters long.
+     * Accepted forms:
+     *
+     * *  BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`.
+     * 
+ * + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The inputUri to set. + * @return This builder for chaining. + */ + public Builder setInputUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + inputUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. BigQuery URI to a table, up to 2000 characters long.
+     * Accepted forms:
+     *
+     * *  BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`.
+     * 
+ * + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInputUri() { + inputUri_ = getDefaultInstance().getInputUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. BigQuery URI to a table, up to 2000 characters long.
+     * Accepted forms:
+     *
+     * *  BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`.
+     * 
+ * + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for inputUri to set. + * @return This builder for chaining. + */ + public Builder setInputUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + inputUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.BigQuerySource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.BigQuerySource) + private static final com.google.cloud.vertexai.api.BigQuerySource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.BigQuerySource(); + } + + public static com.google.cloud.vertexai.api.BigQuerySource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQuerySource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BigQuerySource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQuerySourceOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQuerySourceOrBuilder.java new file mode 100644 index 000000000000..40d344574bc7 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BigQuerySourceOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +public interface BigQuerySourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.BigQuerySource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. BigQuery URI to a table, up to 2000 characters long.
+   * Accepted forms:
+   *
+   * *  BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`.
+   * 
+ * + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The inputUri. + */ + java.lang.String getInputUri(); + /** + * + * + *
+   * Required. BigQuery URI to a table, up to 2000 characters long.
+   * Accepted forms:
+   *
+   * *  BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`.
+   * 
+ * + * string input_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for inputUri. + */ + com.google.protobuf.ByteString getInputUriBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Blob.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Blob.java new file mode 100644 index 000000000000..6346504e3418 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Blob.java @@ -0,0 +1,720 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Raw media bytes.
+ *
+ * Text should not be sent as raw bytes, use the 'text' field.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Blob} + */ +public final class Blob extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Blob) + BlobOrBuilder { + private static final long serialVersionUID = 0L; + // Use Blob.newBuilder() to construct. + private Blob(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Blob() { + mimeType_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Blob(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Blob_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Blob_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Blob.class, + com.google.cloud.vertexai.api.Blob.Builder.class); + } + + public static final int MIME_TYPE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object mimeType_ = ""; + /** + * + * + *
+   * Required. The IANA standard MIME type of the source data.
+   * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + @java.lang.Override + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The IANA standard MIME type of the source data.
+   * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * Required. Raw bytes for media formats.
+   * 
+ * + * bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mimeType_); + } + if (!data_.isEmpty()) { + output.writeBytes(2, data_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mimeType_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, data_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Blob)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Blob other = (com.google.cloud.vertexai.api.Blob) obj; + + if (!getMimeType().equals(other.getMimeType())) return false; + if (!getData().equals(other.getData())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Blob parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Blob parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Blob parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Blob parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Blob parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Blob parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Blob parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Blob parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Blob parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Blob parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Blob parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Blob parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Blob prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Raw media bytes.
+   *
+   * Text should not be sent as raw bytes, use the 'text' field.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Blob} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Blob) + com.google.cloud.vertexai.api.BlobOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Blob_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Blob_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Blob.class, + com.google.cloud.vertexai.api.Blob.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Blob.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mimeType_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Blob_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Blob getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Blob.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Blob build() { + com.google.cloud.vertexai.api.Blob result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Blob buildPartial() { + com.google.cloud.vertexai.api.Blob result = new com.google.cloud.vertexai.api.Blob(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Blob result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mimeType_ = mimeType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.data_ = data_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Blob) { + return mergeFrom((com.google.cloud.vertexai.api.Blob) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Blob other) { + if (other == com.google.cloud.vertexai.api.Blob.getDefaultInstance()) return this; + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + mimeType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + data_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object mimeType_ = ""; + /** + * + * + *
+     * Required. The IANA standard MIME type of the source data.
+     * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The IANA standard MIME type of the source data.
+     * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The IANA standard MIME type of the source data.
+     * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + mimeType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IANA standard MIME type of the source data.
+     * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMimeType() { + mimeType_ = getDefaultInstance().getMimeType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IANA standard MIME type of the source data.
+     * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + mimeType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Required. Raw bytes for media formats.
+     * 
+ * + * bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * + * + *
+     * Required. Raw bytes for media formats.
+     * 
+ * + * bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Raw bytes for media formats.
+     * 
+ * + * bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearData() { + bitField0_ = (bitField0_ & ~0x00000002); + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Blob) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Blob) + private static final com.google.cloud.vertexai.api.Blob DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Blob(); + } + + public static com.google.cloud.vertexai.api.Blob getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Blob parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Blob getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BlobOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BlobOrBuilder.java new file mode 100644 index 000000000000..9479acf27e21 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BlobOrBuilder.java @@ -0,0 +1,63 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface BlobOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Blob) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The IANA standard MIME type of the source data.
+   * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + java.lang.String getMimeType(); + /** + * + * + *
+   * Required. The IANA standard MIME type of the source data.
+   * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + com.google.protobuf.ByteString getMimeTypeBytes(); + + /** + * + * + *
+   * Required. Raw bytes for media formats.
+   * 
+ * + * bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The data. + */ + com.google.protobuf.ByteString getData(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BlurBaselineConfig.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BlurBaselineConfig.java new file mode 100644 index 000000000000..acf538cf3fff --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BlurBaselineConfig.java @@ -0,0 +1,557 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Config for blur baseline.
+ *
+ * When enabled, a linear path from the maximally blurred image to the input
+ * image is created. Using a blurred baseline instead of zero (black image) is
+ * motivated by the BlurIG approach explained here:
+ * https://arxiv.org/abs/2004.03383
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.BlurBaselineConfig} + */ +public final class BlurBaselineConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.BlurBaselineConfig) + BlurBaselineConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use BlurBaselineConfig.newBuilder() to construct. + private BlurBaselineConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BlurBaselineConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BlurBaselineConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_BlurBaselineConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_BlurBaselineConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.BlurBaselineConfig.class, + com.google.cloud.vertexai.api.BlurBaselineConfig.Builder.class); + } + + public static final int MAX_BLUR_SIGMA_FIELD_NUMBER = 1; + private float maxBlurSigma_ = 0F; + /** + * + * + *
+   * The standard deviation of the blur kernel for the blurred baseline. The
+   * same blurring parameter is used for both the height and the width
+   * dimension. If not set, the method defaults to the zero (i.e. black for
+   * images) baseline.
+   * 
+ * + * float max_blur_sigma = 1; + * + * @return The maxBlurSigma. + */ + @java.lang.Override + public float getMaxBlurSigma() { + return maxBlurSigma_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(maxBlurSigma_) != 0) { + output.writeFloat(1, maxBlurSigma_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(maxBlurSigma_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, maxBlurSigma_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.BlurBaselineConfig)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.BlurBaselineConfig other = + (com.google.cloud.vertexai.api.BlurBaselineConfig) obj; + + if (java.lang.Float.floatToIntBits(getMaxBlurSigma()) + != java.lang.Float.floatToIntBits(other.getMaxBlurSigma())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAX_BLUR_SIGMA_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMaxBlurSigma()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.BlurBaselineConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Config for blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.BlurBaselineConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.BlurBaselineConfig) + com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_BlurBaselineConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_BlurBaselineConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.BlurBaselineConfig.class, + com.google.cloud.vertexai.api.BlurBaselineConfig.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.BlurBaselineConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maxBlurSigma_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_BlurBaselineConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BlurBaselineConfig getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BlurBaselineConfig build() { + com.google.cloud.vertexai.api.BlurBaselineConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BlurBaselineConfig buildPartial() { + com.google.cloud.vertexai.api.BlurBaselineConfig result = + new com.google.cloud.vertexai.api.BlurBaselineConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.BlurBaselineConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maxBlurSigma_ = maxBlurSigma_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.BlurBaselineConfig) { + return mergeFrom((com.google.cloud.vertexai.api.BlurBaselineConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.BlurBaselineConfig other) { + if (other == com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance()) + return this; + if (other.getMaxBlurSigma() != 0F) { + setMaxBlurSigma(other.getMaxBlurSigma()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + maxBlurSigma_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float maxBlurSigma_; + /** + * + * + *
+     * The standard deviation of the blur kernel for the blurred baseline. The
+     * same blurring parameter is used for both the height and the width
+     * dimension. If not set, the method defaults to the zero (i.e. black for
+     * images) baseline.
+     * 
+ * + * float max_blur_sigma = 1; + * + * @return The maxBlurSigma. + */ + @java.lang.Override + public float getMaxBlurSigma() { + return maxBlurSigma_; + } + /** + * + * + *
+     * The standard deviation of the blur kernel for the blurred baseline. The
+     * same blurring parameter is used for both the height and the width
+     * dimension. If not set, the method defaults to the zero (i.e. black for
+     * images) baseline.
+     * 
+ * + * float max_blur_sigma = 1; + * + * @param value The maxBlurSigma to set. + * @return This builder for chaining. + */ + public Builder setMaxBlurSigma(float value) { + + maxBlurSigma_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard deviation of the blur kernel for the blurred baseline. The
+     * same blurring parameter is used for both the height and the width
+     * dimension. If not set, the method defaults to the zero (i.e. black for
+     * images) baseline.
+     * 
+ * + * float max_blur_sigma = 1; + * + * @return This builder for chaining. + */ + public Builder clearMaxBlurSigma() { + bitField0_ = (bitField0_ & ~0x00000001); + maxBlurSigma_ = 0F; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.BlurBaselineConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.BlurBaselineConfig) + private static final com.google.cloud.vertexai.api.BlurBaselineConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.BlurBaselineConfig(); + } + + public static com.google.cloud.vertexai.api.BlurBaselineConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlurBaselineConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BlurBaselineConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BlurBaselineConfigOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BlurBaselineConfigOrBuilder.java new file mode 100644 index 000000000000..5510f8085086 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BlurBaselineConfigOrBuilder.java @@ -0,0 +1,41 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface BlurBaselineConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.BlurBaselineConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The standard deviation of the blur kernel for the blurred baseline. The
+   * same blurring parameter is used for both the height and the width
+   * dimension. If not set, the method defaults to the zero (i.e. black for
+   * images) baseline.
+   * 
+ * + * float max_blur_sigma = 1; + * + * @return The maxBlurSigma. + */ + float getMaxBlurSigma(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BoolArray.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BoolArray.java new file mode 100644 index 000000000000..57e6c380c6a3 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BoolArray.java @@ -0,0 +1,681 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A list of boolean values.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.BoolArray} + */ +public final class BoolArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.BoolArray) + BoolArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoolArray.newBuilder() to construct. + private BoolArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoolArray() { + values_ = emptyBooleanList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BoolArray(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_BoolArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_BoolArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.BoolArray.class, + com.google.cloud.vertexai.api.BoolArray.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.BooleanList values_; + /** + * + * + *
+   * A list of bool values.
+   * 
+ * + * repeated bool values = 1; + * + * @return A list containing the values. + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * A list of bool values.
+   * 
+ * + * repeated bool values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * A list of bool values.
+   * 
+ * + * repeated bool values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public boolean getValues(int index) { + return values_.getBoolean(index); + } + + private int valuesMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (getValuesList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valuesMemoizedSerializedSize); + } + for (int i = 0; i < values_.size(); i++) { + output.writeBoolNoTag(values_.getBoolean(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 1 * getValuesList().size(); + size += dataSize; + if (!getValuesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + valuesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.BoolArray)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.BoolArray other = (com.google.cloud.vertexai.api.BoolArray) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.BoolArray parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BoolArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BoolArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BoolArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BoolArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.BoolArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BoolArray parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BoolArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BoolArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BoolArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.BoolArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.BoolArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.BoolArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A list of boolean values.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.BoolArray} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.BoolArray) + com.google.cloud.vertexai.api.BoolArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_BoolArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_BoolArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.BoolArray.class, + com.google.cloud.vertexai.api.BoolArray.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.BoolArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + values_ = emptyBooleanList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_BoolArray_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BoolArray getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.BoolArray.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BoolArray build() { + com.google.cloud.vertexai.api.BoolArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BoolArray buildPartial() { + com.google.cloud.vertexai.api.BoolArray result = + new com.google.cloud.vertexai.api.BoolArray(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.BoolArray result) { + if (((bitField0_ & 0x00000001) != 0)) { + values_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } + + private void buildPartial0(com.google.cloud.vertexai.api.BoolArray result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.BoolArray) { + return mergeFrom((com.google.cloud.vertexai.api.BoolArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.BoolArray other) { + if (other == com.google.cloud.vertexai.api.BoolArray.getDefaultInstance()) return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + boolean v = input.readBool(); + ensureValuesIsMutable(); + values_.addBoolean(v); + break; + } // case 8 + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValuesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + values_.addBoolean(input.readBool()); + } + input.popLimit(limit); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.BooleanList values_ = emptyBooleanList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = mutableCopy(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A list of bool values.
+     * 
+ * + * repeated bool values = 1; + * + * @return A list containing the values. + */ + public java.util.List getValuesList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(values_) + : values_; + } + /** + * + * + *
+     * A list of bool values.
+     * 
+ * + * repeated bool values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * A list of bool values.
+     * 
+ * + * repeated bool values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public boolean getValues(int index) { + return values_.getBoolean(index); + } + /** + * + * + *
+     * A list of bool values.
+     * 
+ * + * repeated bool values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, boolean value) { + + ensureValuesIsMutable(); + values_.setBoolean(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of bool values.
+     * 
+ * + * repeated bool values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(boolean value) { + + ensureValuesIsMutable(); + values_.addBoolean(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of bool values.
+     * 
+ * + * repeated bool values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of bool values.
+     * 
+ * + * repeated bool values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = emptyBooleanList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.BoolArray) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.BoolArray) + private static final com.google.cloud.vertexai.api.BoolArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.BoolArray(); + } + + public static com.google.cloud.vertexai.api.BoolArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoolArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.BoolArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BoolArrayOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BoolArrayOrBuilder.java new file mode 100644 index 000000000000..a15a6614b527 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/BoolArrayOrBuilder.java @@ -0,0 +1,63 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +public interface BoolArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.BoolArray) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of bool values.
+   * 
+ * + * repeated bool values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * A list of bool values.
+   * 
+ * + * repeated bool values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * A list of bool values.
+   * 
+ * + * repeated bool values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + boolean getValues(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Candidate.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Candidate.java new file mode 100644 index 000000000000..082de51f9b03 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Candidate.java @@ -0,0 +1,2335 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A response candidate generated from the model.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Candidate} + */ +public final class Candidate extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Candidate) + CandidateOrBuilder { + private static final long serialVersionUID = 0L; + // Use Candidate.newBuilder() to construct. + private Candidate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Candidate() { + finishReason_ = 0; + safetyRatings_ = java.util.Collections.emptyList(); + finishMessage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Candidate(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Candidate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Candidate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Candidate.class, + com.google.cloud.vertexai.api.Candidate.Builder.class); + } + + /** + * + * + *
+   * The reason why the model stopped generating tokens.
+   * If empty, the model has not stopped generating the tokens.
+   * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.Candidate.FinishReason} + */ + public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The finish reason is unspecified.
+     * 
+ * + * FINISH_REASON_UNSPECIFIED = 0; + */ + FINISH_REASON_UNSPECIFIED(0), + /** + * + * + *
+     * Natural stop point of the model or provided stop sequence.
+     * 
+ * + * STOP = 1; + */ + STOP(1), + /** + * + * + *
+     * The maximum number of tokens as specified in the request was reached.
+     * 
+ * + * MAX_TOKENS = 2; + */ + MAX_TOKENS(2), + /** + * + * + *
+     * The token generation was stopped as the response was flagged for safety
+     * reasons. NOTE: When streaming the Candidate.content will be empty if
+     * content filters blocked the output.
+     * 
+ * + * SAFETY = 3; + */ + SAFETY(3), + /** + * + * + *
+     * The token generation was stopped as the response was flagged for
+     * unauthorized citations.
+     * 
+ * + * RECITATION = 4; + */ + RECITATION(4), + /** + * + * + *
+     * All other reasons that stopped the token generation
+     * 
+ * + * OTHER = 5; + */ + OTHER(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The finish reason is unspecified.
+     * 
+ * + * FINISH_REASON_UNSPECIFIED = 0; + */ + public static final int FINISH_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Natural stop point of the model or provided stop sequence.
+     * 
+ * + * STOP = 1; + */ + public static final int STOP_VALUE = 1; + /** + * + * + *
+     * The maximum number of tokens as specified in the request was reached.
+     * 
+ * + * MAX_TOKENS = 2; + */ + public static final int MAX_TOKENS_VALUE = 2; + /** + * + * + *
+     * The token generation was stopped as the response was flagged for safety
+     * reasons. NOTE: When streaming the Candidate.content will be empty if
+     * content filters blocked the output.
+     * 
+ * + * SAFETY = 3; + */ + public static final int SAFETY_VALUE = 3; + /** + * + * + *
+     * The token generation was stopped as the response was flagged for
+     * unauthorized citations.
+     * 
+ * + * RECITATION = 4; + */ + public static final int RECITATION_VALUE = 4; + /** + * + * + *
+     * All other reasons that stopped the token generation
+     * 
+ * + * OTHER = 5; + */ + public static final int OTHER_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FinishReason valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static FinishReason forNumber(int value) { + switch (value) { + case 0: + return FINISH_REASON_UNSPECIFIED; + case 1: + return STOP; + case 2: + return MAX_TOKENS; + case 3: + return SAFETY; + case 4: + return RECITATION; + case 5: + return OTHER; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public FinishReason findValueByNumber(int number) { + return FinishReason.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.Candidate.getDescriptor().getEnumTypes().get(0); + } + + private static final FinishReason[] VALUES = values(); + + public static FinishReason valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private FinishReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.Candidate.FinishReason) + } + + private int bitField0_; + public static final int INDEX_FIELD_NUMBER = 1; + private int index_ = 0; + /** + * + * + *
+   * Output only. Index of the candidate.
+   * 
+ * + * int32 index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + + public static final int CONTENT_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.Content content_; + /** + * + * + *
+   * Output only. Content parts of the candidate.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return content_ != null; + } + /** + * + * + *
+   * Output only. Content parts of the candidate.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The content. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Content getContent() { + return content_ == null ? com.google.cloud.vertexai.api.Content.getDefaultInstance() : content_; + } + /** + * + * + *
+   * Output only. Content parts of the candidate.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ContentOrBuilder getContentOrBuilder() { + return content_ == null ? com.google.cloud.vertexai.api.Content.getDefaultInstance() : content_; + } + + public static final int FINISH_REASON_FIELD_NUMBER = 3; + private int finishReason_ = 0; + /** + * + * + *
+   * Output only. The reason why the model stopped generating tokens.
+   * If empty, the model has not stopped generating the tokens.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for finishReason. + */ + @java.lang.Override + public int getFinishReasonValue() { + return finishReason_; + } + /** + * + * + *
+   * Output only. The reason why the model stopped generating tokens.
+   * If empty, the model has not stopped generating the tokens.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The finishReason. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Candidate.FinishReason getFinishReason() { + com.google.cloud.vertexai.api.Candidate.FinishReason result = + com.google.cloud.vertexai.api.Candidate.FinishReason.forNumber(finishReason_); + return result == null + ? com.google.cloud.vertexai.api.Candidate.FinishReason.UNRECOGNIZED + : result; + } + + public static final int SAFETY_RATINGS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List safetyRatings_; + /** + * + * + *
+   * Output only. List of ratings for the safety of a response candidate.
+   *
+   * There is at most one rating per category.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getSafetyRatingsList() { + return safetyRatings_; + } + /** + * + * + *
+   * Output only. List of ratings for the safety of a response candidate.
+   *
+   * There is at most one rating per category.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getSafetyRatingsOrBuilderList() { + return safetyRatings_; + } + /** + * + * + *
+   * Output only. List of ratings for the safety of a response candidate.
+   *
+   * There is at most one rating per category.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getSafetyRatingsCount() { + return safetyRatings_.size(); + } + /** + * + * + *
+   * Output only. List of ratings for the safety of a response candidate.
+   *
+   * There is at most one rating per category.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SafetyRating getSafetyRatings(int index) { + return safetyRatings_.get(index); + } + /** + * + * + *
+   * Output only. List of ratings for the safety of a response candidate.
+   *
+   * There is at most one rating per category.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SafetyRatingOrBuilder getSafetyRatingsOrBuilder(int index) { + return safetyRatings_.get(index); + } + + public static final int FINISH_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object finishMessage_ = ""; + /** + * + * + *
+   * Output only. Describes the reason the mode stopped generating tokens in
+   * more detail. This is only filled when `finish_reason` is set.
+   * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the finishMessage field is set. + */ + @java.lang.Override + public boolean hasFinishMessage() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Describes the reason the mode stopped generating tokens in
+   * more detail. This is only filled when `finish_reason` is set.
+   * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The finishMessage. + */ + @java.lang.Override + public java.lang.String getFinishMessage() { + java.lang.Object ref = finishMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + finishMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Describes the reason the mode stopped generating tokens in
+   * more detail. This is only filled when `finish_reason` is set.
+   * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for finishMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFinishMessageBytes() { + java.lang.Object ref = finishMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + finishMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CITATION_METADATA_FIELD_NUMBER = 6; + private com.google.cloud.vertexai.api.CitationMetadata citationMetadata_; + /** + * + * + *
+   * Output only. Source attribution of the generated content.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the citationMetadata field is set. + */ + @java.lang.Override + public boolean hasCitationMetadata() { + return citationMetadata_ != null; + } + /** + * + * + *
+   * Output only. Source attribution of the generated content.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The citationMetadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.CitationMetadata getCitationMetadata() { + return citationMetadata_ == null + ? com.google.cloud.vertexai.api.CitationMetadata.getDefaultInstance() + : citationMetadata_; + } + /** + * + * + *
+   * Output only. Source attribution of the generated content.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.CitationMetadataOrBuilder getCitationMetadataOrBuilder() { + return citationMetadata_ == null + ? com.google.cloud.vertexai.api.CitationMetadata.getDefaultInstance() + : citationMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (index_ != 0) { + output.writeInt32(1, index_); + } + if (content_ != null) { + output.writeMessage(2, getContent()); + } + if (finishReason_ + != com.google.cloud.vertexai.api.Candidate.FinishReason.FINISH_REASON_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, finishReason_); + } + for (int i = 0; i < safetyRatings_.size(); i++) { + output.writeMessage(4, safetyRatings_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, finishMessage_); + } + if (citationMetadata_ != null) { + output.writeMessage(6, getCitationMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (index_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, index_); + } + if (content_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getContent()); + } + if (finishReason_ + != com.google.cloud.vertexai.api.Candidate.FinishReason.FINISH_REASON_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, finishReason_); + } + for (int i = 0; i < safetyRatings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, safetyRatings_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, finishMessage_); + } + if (citationMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCitationMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Candidate)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Candidate other = (com.google.cloud.vertexai.api.Candidate) obj; + + if (getIndex() != other.getIndex()) return false; + if (hasContent() != other.hasContent()) return false; + if (hasContent()) { + if (!getContent().equals(other.getContent())) return false; + } + if (finishReason_ != other.finishReason_) return false; + if (!getSafetyRatingsList().equals(other.getSafetyRatingsList())) return false; + if (hasFinishMessage() != other.hasFinishMessage()) return false; + if (hasFinishMessage()) { + if (!getFinishMessage().equals(other.getFinishMessage())) return false; + } + if (hasCitationMetadata() != other.hasCitationMetadata()) return false; + if (hasCitationMetadata()) { + if (!getCitationMetadata().equals(other.getCitationMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + if (hasContent()) { + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + } + hash = (37 * hash) + FINISH_REASON_FIELD_NUMBER; + hash = (53 * hash) + finishReason_; + if (getSafetyRatingsCount() > 0) { + hash = (37 * hash) + SAFETY_RATINGS_FIELD_NUMBER; + hash = (53 * hash) + getSafetyRatingsList().hashCode(); + } + if (hasFinishMessage()) { + hash = (37 * hash) + FINISH_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getFinishMessage().hashCode(); + } + if (hasCitationMetadata()) { + hash = (37 * hash) + CITATION_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCitationMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Candidate parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Candidate parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Candidate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Candidate parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Candidate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Candidate parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Candidate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Candidate parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Candidate parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Candidate parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Candidate parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Candidate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Candidate prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A response candidate generated from the model.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Candidate} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Candidate) + com.google.cloud.vertexai.api.CandidateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Candidate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Candidate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Candidate.class, + com.google.cloud.vertexai.api.Candidate.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Candidate.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + index_ = 0; + content_ = null; + if (contentBuilder_ != null) { + contentBuilder_.dispose(); + contentBuilder_ = null; + } + finishReason_ = 0; + if (safetyRatingsBuilder_ == null) { + safetyRatings_ = java.util.Collections.emptyList(); + } else { + safetyRatings_ = null; + safetyRatingsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + finishMessage_ = ""; + citationMetadata_ = null; + if (citationMetadataBuilder_ != null) { + citationMetadataBuilder_.dispose(); + citationMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Candidate_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Candidate getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Candidate.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Candidate build() { + com.google.cloud.vertexai.api.Candidate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Candidate buildPartial() { + com.google.cloud.vertexai.api.Candidate result = + new com.google.cloud.vertexai.api.Candidate(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.Candidate result) { + if (safetyRatingsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + safetyRatings_ = java.util.Collections.unmodifiableList(safetyRatings_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.safetyRatings_ = safetyRatings_; + } else { + result.safetyRatings_ = safetyRatingsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.Candidate result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.index_ = index_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.content_ = contentBuilder_ == null ? content_ : contentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishReason_ = finishReason_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.finishMessage_ = finishMessage_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.citationMetadata_ = + citationMetadataBuilder_ == null ? citationMetadata_ : citationMetadataBuilder_.build(); + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Candidate) { + return mergeFrom((com.google.cloud.vertexai.api.Candidate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Candidate other) { + if (other == com.google.cloud.vertexai.api.Candidate.getDefaultInstance()) return this; + if (other.getIndex() != 0) { + setIndex(other.getIndex()); + } + if (other.hasContent()) { + mergeContent(other.getContent()); + } + if (other.finishReason_ != 0) { + setFinishReasonValue(other.getFinishReasonValue()); + } + if (safetyRatingsBuilder_ == null) { + if (!other.safetyRatings_.isEmpty()) { + if (safetyRatings_.isEmpty()) { + safetyRatings_ = other.safetyRatings_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSafetyRatingsIsMutable(); + safetyRatings_.addAll(other.safetyRatings_); + } + onChanged(); + } + } else { + if (!other.safetyRatings_.isEmpty()) { + if (safetyRatingsBuilder_.isEmpty()) { + safetyRatingsBuilder_.dispose(); + safetyRatingsBuilder_ = null; + safetyRatings_ = other.safetyRatings_; + bitField0_ = (bitField0_ & ~0x00000008); + safetyRatingsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSafetyRatingsFieldBuilder() + : null; + } else { + safetyRatingsBuilder_.addAllMessages(other.safetyRatings_); + } + } + } + if (other.hasFinishMessage()) { + finishMessage_ = other.finishMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasCitationMetadata()) { + mergeCitationMetadata(other.getCitationMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + index_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getContentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + finishReason_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + com.google.cloud.vertexai.api.SafetyRating m = + input.readMessage( + com.google.cloud.vertexai.api.SafetyRating.parser(), extensionRegistry); + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + safetyRatings_.add(m); + } else { + safetyRatingsBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: + { + finishMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + getCitationMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int index_; + /** + * + * + *
+     * Output only. Index of the candidate.
+     * 
+ * + * int32 index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + /** + * + * + *
+     * Output only. Index of the candidate.
+     * 
+ * + * int32 index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The index to set. + * @return This builder for chaining. + */ + public Builder setIndex(int value) { + + index_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Index of the candidate.
+     * 
+ * + * int32 index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + index_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.Content content_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder> + contentBuilder_; + /** + * + * + *
+     * Output only. Content parts of the candidate.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the content field is set. + */ + public boolean hasContent() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Content parts of the candidate.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The content. + */ + public com.google.cloud.vertexai.api.Content getContent() { + if (contentBuilder_ == null) { + return content_ == null + ? com.google.cloud.vertexai.api.Content.getDefaultInstance() + : content_; + } else { + return contentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Content parts of the candidate.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setContent(com.google.cloud.vertexai.api.Content value) { + if (contentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + } else { + contentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Content parts of the candidate.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setContent(com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (contentBuilder_ == null) { + content_ = builderForValue.build(); + } else { + contentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Content parts of the candidate.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeContent(com.google.cloud.vertexai.api.Content value) { + if (contentBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && content_ != null + && content_ != com.google.cloud.vertexai.api.Content.getDefaultInstance()) { + getContentBuilder().mergeFrom(value); + } else { + content_ = value; + } + } else { + contentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Content parts of the candidate.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearContent() { + bitField0_ = (bitField0_ & ~0x00000002); + content_ = null; + if (contentBuilder_ != null) { + contentBuilder_.dispose(); + contentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Content parts of the candidate.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder getContentBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getContentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Content parts of the candidate.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.ContentOrBuilder getContentOrBuilder() { + if (contentBuilder_ != null) { + return contentBuilder_.getMessageOrBuilder(); + } else { + return content_ == null + ? com.google.cloud.vertexai.api.Content.getDefaultInstance() + : content_; + } + } + /** + * + * + *
+     * Output only. Content parts of the candidate.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder> + getContentFieldBuilder() { + if (contentBuilder_ == null) { + contentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder>( + getContent(), getParentForChildren(), isClean()); + content_ = null; + } + return contentBuilder_; + } + + private int finishReason_ = 0; + /** + * + * + *
+     * Output only. The reason why the model stopped generating tokens.
+     * If empty, the model has not stopped generating the tokens.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for finishReason. + */ + @java.lang.Override + public int getFinishReasonValue() { + return finishReason_; + } + /** + * + * + *
+     * Output only. The reason why the model stopped generating tokens.
+     * If empty, the model has not stopped generating the tokens.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for finishReason to set. + * @return This builder for chaining. + */ + public Builder setFinishReasonValue(int value) { + finishReason_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The reason why the model stopped generating tokens.
+     * If empty, the model has not stopped generating the tokens.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The finishReason. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Candidate.FinishReason getFinishReason() { + com.google.cloud.vertexai.api.Candidate.FinishReason result = + com.google.cloud.vertexai.api.Candidate.FinishReason.forNumber(finishReason_); + return result == null + ? com.google.cloud.vertexai.api.Candidate.FinishReason.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The reason why the model stopped generating tokens.
+     * If empty, the model has not stopped generating the tokens.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The finishReason to set. + * @return This builder for chaining. + */ + public Builder setFinishReason(com.google.cloud.vertexai.api.Candidate.FinishReason value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + finishReason_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The reason why the model stopped generating tokens.
+     * If empty, the model has not stopped generating the tokens.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearFinishReason() { + bitField0_ = (bitField0_ & ~0x00000004); + finishReason_ = 0; + onChanged(); + return this; + } + + private java.util.List safetyRatings_ = + java.util.Collections.emptyList(); + + private void ensureSafetyRatingsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + safetyRatings_ = + new java.util.ArrayList(safetyRatings_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.SafetyRating, + com.google.cloud.vertexai.api.SafetyRating.Builder, + com.google.cloud.vertexai.api.SafetyRatingOrBuilder> + safetyRatingsBuilder_; + + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getSafetyRatingsList() { + if (safetyRatingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(safetyRatings_); + } else { + return safetyRatingsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getSafetyRatingsCount() { + if (safetyRatingsBuilder_ == null) { + return safetyRatings_.size(); + } else { + return safetyRatingsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.SafetyRating getSafetyRatings(int index) { + if (safetyRatingsBuilder_ == null) { + return safetyRatings_.get(index); + } else { + return safetyRatingsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSafetyRatings(int index, com.google.cloud.vertexai.api.SafetyRating value) { + if (safetyRatingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSafetyRatingsIsMutable(); + safetyRatings_.set(index, value); + onChanged(); + } else { + safetyRatingsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSafetyRatings( + int index, com.google.cloud.vertexai.api.SafetyRating.Builder builderForValue) { + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + safetyRatings_.set(index, builderForValue.build()); + onChanged(); + } else { + safetyRatingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSafetyRatings(com.google.cloud.vertexai.api.SafetyRating value) { + if (safetyRatingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSafetyRatingsIsMutable(); + safetyRatings_.add(value); + onChanged(); + } else { + safetyRatingsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSafetyRatings(int index, com.google.cloud.vertexai.api.SafetyRating value) { + if (safetyRatingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSafetyRatingsIsMutable(); + safetyRatings_.add(index, value); + onChanged(); + } else { + safetyRatingsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSafetyRatings( + com.google.cloud.vertexai.api.SafetyRating.Builder builderForValue) { + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + safetyRatings_.add(builderForValue.build()); + onChanged(); + } else { + safetyRatingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSafetyRatings( + int index, com.google.cloud.vertexai.api.SafetyRating.Builder builderForValue) { + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + safetyRatings_.add(index, builderForValue.build()); + onChanged(); + } else { + safetyRatingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllSafetyRatings( + java.lang.Iterable values) { + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, safetyRatings_); + onChanged(); + } else { + safetyRatingsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSafetyRatings() { + if (safetyRatingsBuilder_ == null) { + safetyRatings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + safetyRatingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeSafetyRatings(int index) { + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + safetyRatings_.remove(index); + onChanged(); + } else { + safetyRatingsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.SafetyRating.Builder getSafetyRatingsBuilder(int index) { + return getSafetyRatingsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.SafetyRatingOrBuilder getSafetyRatingsOrBuilder( + int index) { + if (safetyRatingsBuilder_ == null) { + return safetyRatings_.get(index); + } else { + return safetyRatingsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getSafetyRatingsOrBuilderList() { + if (safetyRatingsBuilder_ != null) { + return safetyRatingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(safetyRatings_); + } + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.SafetyRating.Builder addSafetyRatingsBuilder() { + return getSafetyRatingsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.SafetyRating.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.SafetyRating.Builder addSafetyRatingsBuilder(int index) { + return getSafetyRatingsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.SafetyRating.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of ratings for the safety of a response candidate.
+     *
+     * There is at most one rating per category.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getSafetyRatingsBuilderList() { + return getSafetyRatingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.SafetyRating, + com.google.cloud.vertexai.api.SafetyRating.Builder, + com.google.cloud.vertexai.api.SafetyRatingOrBuilder> + getSafetyRatingsFieldBuilder() { + if (safetyRatingsBuilder_ == null) { + safetyRatingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.SafetyRating, + com.google.cloud.vertexai.api.SafetyRating.Builder, + com.google.cloud.vertexai.api.SafetyRatingOrBuilder>( + safetyRatings_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + safetyRatings_ = null; + } + return safetyRatingsBuilder_; + } + + private java.lang.Object finishMessage_ = ""; + /** + * + * + *
+     * Output only. Describes the reason the mode stopped generating tokens in
+     * more detail. This is only filled when `finish_reason` is set.
+     * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the finishMessage field is set. + */ + public boolean hasFinishMessage() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Describes the reason the mode stopped generating tokens in
+     * more detail. This is only filled when `finish_reason` is set.
+     * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The finishMessage. + */ + public java.lang.String getFinishMessage() { + java.lang.Object ref = finishMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + finishMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Describes the reason the mode stopped generating tokens in
+     * more detail. This is only filled when `finish_reason` is set.
+     * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for finishMessage. + */ + public com.google.protobuf.ByteString getFinishMessageBytes() { + java.lang.Object ref = finishMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + finishMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Describes the reason the mode stopped generating tokens in
+     * more detail. This is only filled when `finish_reason` is set.
+     * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The finishMessage to set. + * @return This builder for chaining. + */ + public Builder setFinishMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + finishMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Describes the reason the mode stopped generating tokens in
+     * more detail. This is only filled when `finish_reason` is set.
+     * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearFinishMessage() { + finishMessage_ = getDefaultInstance().getFinishMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Describes the reason the mode stopped generating tokens in
+     * more detail. This is only filled when `finish_reason` is set.
+     * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for finishMessage to set. + * @return This builder for chaining. + */ + public Builder setFinishMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + finishMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.CitationMetadata citationMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.CitationMetadata, + com.google.cloud.vertexai.api.CitationMetadata.Builder, + com.google.cloud.vertexai.api.CitationMetadataOrBuilder> + citationMetadataBuilder_; + /** + * + * + *
+     * Output only. Source attribution of the generated content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the citationMetadata field is set. + */ + public boolean hasCitationMetadata() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Source attribution of the generated content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The citationMetadata. + */ + public com.google.cloud.vertexai.api.CitationMetadata getCitationMetadata() { + if (citationMetadataBuilder_ == null) { + return citationMetadata_ == null + ? com.google.cloud.vertexai.api.CitationMetadata.getDefaultInstance() + : citationMetadata_; + } else { + return citationMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Source attribution of the generated content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCitationMetadata(com.google.cloud.vertexai.api.CitationMetadata value) { + if (citationMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + citationMetadata_ = value; + } else { + citationMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Source attribution of the generated content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCitationMetadata( + com.google.cloud.vertexai.api.CitationMetadata.Builder builderForValue) { + if (citationMetadataBuilder_ == null) { + citationMetadata_ = builderForValue.build(); + } else { + citationMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Source attribution of the generated content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCitationMetadata(com.google.cloud.vertexai.api.CitationMetadata value) { + if (citationMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && citationMetadata_ != null + && citationMetadata_ + != com.google.cloud.vertexai.api.CitationMetadata.getDefaultInstance()) { + getCitationMetadataBuilder().mergeFrom(value); + } else { + citationMetadata_ = value; + } + } else { + citationMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Source attribution of the generated content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCitationMetadata() { + bitField0_ = (bitField0_ & ~0x00000020); + citationMetadata_ = null; + if (citationMetadataBuilder_ != null) { + citationMetadataBuilder_.dispose(); + citationMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Source attribution of the generated content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.CitationMetadata.Builder getCitationMetadataBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getCitationMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Source attribution of the generated content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.CitationMetadataOrBuilder getCitationMetadataOrBuilder() { + if (citationMetadataBuilder_ != null) { + return citationMetadataBuilder_.getMessageOrBuilder(); + } else { + return citationMetadata_ == null + ? com.google.cloud.vertexai.api.CitationMetadata.getDefaultInstance() + : citationMetadata_; + } + } + /** + * + * + *
+     * Output only. Source attribution of the generated content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.CitationMetadata, + com.google.cloud.vertexai.api.CitationMetadata.Builder, + com.google.cloud.vertexai.api.CitationMetadataOrBuilder> + getCitationMetadataFieldBuilder() { + if (citationMetadataBuilder_ == null) { + citationMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.CitationMetadata, + com.google.cloud.vertexai.api.CitationMetadata.Builder, + com.google.cloud.vertexai.api.CitationMetadataOrBuilder>( + getCitationMetadata(), getParentForChildren(), isClean()); + citationMetadata_ = null; + } + return citationMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Candidate) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Candidate) + private static final com.google.cloud.vertexai.api.Candidate DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Candidate(); + } + + public static com.google.cloud.vertexai.api.Candidate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Candidate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Candidate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CandidateOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CandidateOrBuilder.java new file mode 100644 index 000000000000..2164653fe94f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CandidateOrBuilder.java @@ -0,0 +1,263 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface CandidateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Candidate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Index of the candidate.
+   * 
+ * + * int32 index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The index. + */ + int getIndex(); + + /** + * + * + *
+   * Output only. Content parts of the candidate.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the content field is set. + */ + boolean hasContent(); + /** + * + * + *
+   * Output only. Content parts of the candidate.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The content. + */ + com.google.cloud.vertexai.api.Content getContent(); + /** + * + * + *
+   * Output only. Content parts of the candidate.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.ContentOrBuilder getContentOrBuilder(); + + /** + * + * + *
+   * Output only. The reason why the model stopped generating tokens.
+   * If empty, the model has not stopped generating the tokens.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for finishReason. + */ + int getFinishReasonValue(); + /** + * + * + *
+   * Output only. The reason why the model stopped generating tokens.
+   * If empty, the model has not stopped generating the tokens.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The finishReason. + */ + com.google.cloud.vertexai.api.Candidate.FinishReason getFinishReason(); + + /** + * + * + *
+   * Output only. List of ratings for the safety of a response candidate.
+   *
+   * There is at most one rating per category.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getSafetyRatingsList(); + /** + * + * + *
+   * Output only. List of ratings for the safety of a response candidate.
+   *
+   * There is at most one rating per category.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.SafetyRating getSafetyRatings(int index); + /** + * + * + *
+   * Output only. List of ratings for the safety of a response candidate.
+   *
+   * There is at most one rating per category.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getSafetyRatingsCount(); + /** + * + * + *
+   * Output only. List of ratings for the safety of a response candidate.
+   *
+   * There is at most one rating per category.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getSafetyRatingsOrBuilderList(); + /** + * + * + *
+   * Output only. List of ratings for the safety of a response candidate.
+   *
+   * There is at most one rating per category.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.SafetyRatingOrBuilder getSafetyRatingsOrBuilder(int index); + + /** + * + * + *
+   * Output only. Describes the reason the mode stopped generating tokens in
+   * more detail. This is only filled when `finish_reason` is set.
+   * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the finishMessage field is set. + */ + boolean hasFinishMessage(); + /** + * + * + *
+   * Output only. Describes the reason the mode stopped generating tokens in
+   * more detail. This is only filled when `finish_reason` is set.
+   * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The finishMessage. + */ + java.lang.String getFinishMessage(); + /** + * + * + *
+   * Output only. Describes the reason the mode stopped generating tokens in
+   * more detail. This is only filled when `finish_reason` is set.
+   * 
+ * + * optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for finishMessage. + */ + com.google.protobuf.ByteString getFinishMessageBytes(); + + /** + * + * + *
+   * Output only. Source attribution of the generated content.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the citationMetadata field is set. + */ + boolean hasCitationMetadata(); + /** + * + * + *
+   * Output only. Source attribution of the generated content.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The citationMetadata. + */ + com.google.cloud.vertexai.api.CitationMetadata getCitationMetadata(); + /** + * + * + *
+   * Output only. Source attribution of the generated content.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.CitationMetadataOrBuilder getCitationMetadataOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Citation.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Citation.java new file mode 100644 index 000000000000..1ff227dfc1b3 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Citation.java @@ -0,0 +1,1439 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Source attributions for content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Citation} + */ +public final class Citation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Citation) + CitationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Citation.newBuilder() to construct. + private Citation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Citation() { + uri_ = ""; + title_ = ""; + license_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Citation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Citation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Citation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Citation.class, + com.google.cloud.vertexai.api.Citation.Builder.class); + } + + public static final int START_INDEX_FIELD_NUMBER = 1; + private int startIndex_ = 0; + /** + * + * + *
+   * Output only. Start index into the content.
+   * 
+ * + * int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The startIndex. + */ + @java.lang.Override + public int getStartIndex() { + return startIndex_; + } + + public static final int END_INDEX_FIELD_NUMBER = 2; + private int endIndex_ = 0; + /** + * + * + *
+   * Output only. End index into the content.
+   * 
+ * + * int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The endIndex. + */ + @java.lang.Override + public int getEndIndex() { + return endIndex_; + } + + public static final int URI_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + /** + * + * + *
+   * Output only. Url reference of the attribution.
+   * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Url reference of the attribution.
+   * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** + * + * + *
+   * Output only. Title of the attribution.
+   * 
+ * + * string title = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Title of the attribution.
+   * 
+ * + * string title = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LICENSE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object license_ = ""; + /** + * + * + *
+   * Output only. License of the attribution.
+   * 
+ * + * string license = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The license. + */ + @java.lang.Override + public java.lang.String getLicense() { + java.lang.Object ref = license_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + license_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. License of the attribution.
+   * 
+ * + * string license = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for license. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLicenseBytes() { + java.lang.Object ref = license_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + license_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PUBLICATION_DATE_FIELD_NUMBER = 6; + private com.google.type.Date publicationDate_; + /** + * + * + *
+   * Output only. Publication date of the attribution.
+   * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the publicationDate field is set. + */ + @java.lang.Override + public boolean hasPublicationDate() { + return publicationDate_ != null; + } + /** + * + * + *
+   * Output only. Publication date of the attribution.
+   * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The publicationDate. + */ + @java.lang.Override + public com.google.type.Date getPublicationDate() { + return publicationDate_ == null ? com.google.type.Date.getDefaultInstance() : publicationDate_; + } + /** + * + * + *
+   * Output only. Publication date of the attribution.
+   * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.type.DateOrBuilder getPublicationDateOrBuilder() { + return publicationDate_ == null ? com.google.type.Date.getDefaultInstance() : publicationDate_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (startIndex_ != 0) { + output.writeInt32(1, startIndex_); + } + if (endIndex_ != 0) { + output.writeInt32(2, endIndex_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(license_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, license_); + } + if (publicationDate_ != null) { + output.writeMessage(6, getPublicationDate()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, startIndex_); + } + if (endIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, endIndex_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(license_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, license_); + } + if (publicationDate_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPublicationDate()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Citation)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Citation other = (com.google.cloud.vertexai.api.Citation) obj; + + if (getStartIndex() != other.getStartIndex()) return false; + if (getEndIndex() != other.getEndIndex()) return false; + if (!getUri().equals(other.getUri())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getLicense().equals(other.getLicense())) return false; + if (hasPublicationDate() != other.hasPublicationDate()) return false; + if (hasPublicationDate()) { + if (!getPublicationDate().equals(other.getPublicationDate())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + START_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getStartIndex(); + hash = (37 * hash) + END_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getEndIndex(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + LICENSE_FIELD_NUMBER; + hash = (53 * hash) + getLicense().hashCode(); + if (hasPublicationDate()) { + hash = (37 * hash) + PUBLICATION_DATE_FIELD_NUMBER; + hash = (53 * hash) + getPublicationDate().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Citation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Citation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Citation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Citation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Citation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Citation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Citation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Citation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Citation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Citation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Citation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Citation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Citation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Source attributions for content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Citation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Citation) + com.google.cloud.vertexai.api.CitationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Citation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Citation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Citation.class, + com.google.cloud.vertexai.api.Citation.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Citation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startIndex_ = 0; + endIndex_ = 0; + uri_ = ""; + title_ = ""; + license_ = ""; + publicationDate_ = null; + if (publicationDateBuilder_ != null) { + publicationDateBuilder_.dispose(); + publicationDateBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Citation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Citation getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Citation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Citation build() { + com.google.cloud.vertexai.api.Citation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Citation buildPartial() { + com.google.cloud.vertexai.api.Citation result = + new com.google.cloud.vertexai.api.Citation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Citation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startIndex_ = startIndex_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endIndex_ = endIndex_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uri_ = uri_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.title_ = title_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.license_ = license_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.publicationDate_ = + publicationDateBuilder_ == null ? publicationDate_ : publicationDateBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Citation) { + return mergeFrom((com.google.cloud.vertexai.api.Citation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Citation other) { + if (other == com.google.cloud.vertexai.api.Citation.getDefaultInstance()) return this; + if (other.getStartIndex() != 0) { + setStartIndex(other.getStartIndex()); + } + if (other.getEndIndex() != 0) { + setEndIndex(other.getEndIndex()); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getLicense().isEmpty()) { + license_ = other.license_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasPublicationDate()) { + mergePublicationDate(other.getPublicationDate()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + startIndex_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + endIndex_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + title_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + license_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getPublicationDateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int startIndex_; + /** + * + * + *
+     * Output only. Start index into the content.
+     * 
+ * + * int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The startIndex. + */ + @java.lang.Override + public int getStartIndex() { + return startIndex_; + } + /** + * + * + *
+     * Output only. Start index into the content.
+     * 
+ * + * int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The startIndex to set. + * @return This builder for chaining. + */ + public Builder setStartIndex(int value) { + + startIndex_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Start index into the content.
+     * 
+ * + * int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStartIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + startIndex_ = 0; + onChanged(); + return this; + } + + private int endIndex_; + /** + * + * + *
+     * Output only. End index into the content.
+     * 
+ * + * int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The endIndex. + */ + @java.lang.Override + public int getEndIndex() { + return endIndex_; + } + /** + * + * + *
+     * Output only. End index into the content.
+     * 
+ * + * int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The endIndex to set. + * @return This builder for chaining. + */ + public Builder setEndIndex(int value) { + + endIndex_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. End index into the content.
+     * 
+ * + * int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearEndIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + endIndex_ = 0; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Output only. Url reference of the attribution.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Url reference of the attribution.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Url reference of the attribution.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uri_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Url reference of the attribution.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Url reference of the attribution.
+     * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * + * + *
+     * Output only. Title of the attribution.
+     * 
+ * + * string title = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Title of the attribution.
+     * 
+ * + * string title = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Title of the attribution.
+     * 
+ * + * string title = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + title_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Title of the attribution.
+     * 
+ * + * string title = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Title of the attribution.
+     * 
+ * + * string title = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + title_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object license_ = ""; + /** + * + * + *
+     * Output only. License of the attribution.
+     * 
+ * + * string license = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The license. + */ + public java.lang.String getLicense() { + java.lang.Object ref = license_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + license_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. License of the attribution.
+     * 
+ * + * string license = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for license. + */ + public com.google.protobuf.ByteString getLicenseBytes() { + java.lang.Object ref = license_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + license_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. License of the attribution.
+     * 
+ * + * string license = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The license to set. + * @return This builder for chaining. + */ + public Builder setLicense(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + license_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. License of the attribution.
+     * 
+ * + * string license = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearLicense() { + license_ = getDefaultInstance().getLicense(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. License of the attribution.
+     * 
+ * + * string license = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for license to set. + * @return This builder for chaining. + */ + public Builder setLicenseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + license_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.type.Date publicationDate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + publicationDateBuilder_; + /** + * + * + *
+     * Output only. Publication date of the attribution.
+     * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the publicationDate field is set. + */ + public boolean hasPublicationDate() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Publication date of the attribution.
+     * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The publicationDate. + */ + public com.google.type.Date getPublicationDate() { + if (publicationDateBuilder_ == null) { + return publicationDate_ == null + ? com.google.type.Date.getDefaultInstance() + : publicationDate_; + } else { + return publicationDateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Publication date of the attribution.
+     * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPublicationDate(com.google.type.Date value) { + if (publicationDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + publicationDate_ = value; + } else { + publicationDateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Publication date of the attribution.
+     * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPublicationDate(com.google.type.Date.Builder builderForValue) { + if (publicationDateBuilder_ == null) { + publicationDate_ = builderForValue.build(); + } else { + publicationDateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Publication date of the attribution.
+     * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePublicationDate(com.google.type.Date value) { + if (publicationDateBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && publicationDate_ != null + && publicationDate_ != com.google.type.Date.getDefaultInstance()) { + getPublicationDateBuilder().mergeFrom(value); + } else { + publicationDate_ = value; + } + } else { + publicationDateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Publication date of the attribution.
+     * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPublicationDate() { + bitField0_ = (bitField0_ & ~0x00000020); + publicationDate_ = null; + if (publicationDateBuilder_ != null) { + publicationDateBuilder_.dispose(); + publicationDateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Publication date of the attribution.
+     * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.type.Date.Builder getPublicationDateBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getPublicationDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Publication date of the attribution.
+     * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.type.DateOrBuilder getPublicationDateOrBuilder() { + if (publicationDateBuilder_ != null) { + return publicationDateBuilder_.getMessageOrBuilder(); + } else { + return publicationDate_ == null + ? com.google.type.Date.getDefaultInstance() + : publicationDate_; + } + } + /** + * + * + *
+     * Output only. Publication date of the attribution.
+     * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + getPublicationDateFieldBuilder() { + if (publicationDateBuilder_ == null) { + publicationDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>( + getPublicationDate(), getParentForChildren(), isClean()); + publicationDate_ = null; + } + return publicationDateBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Citation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Citation) + private static final com.google.cloud.vertexai.api.Citation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Citation(); + } + + public static com.google.cloud.vertexai.api.Citation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Citation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Citation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CitationMetadata.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CitationMetadata.java new file mode 100644 index 000000000000..97fa2bb16841 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CitationMetadata.java @@ -0,0 +1,979 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A collection of source attributions for a piece of content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CitationMetadata} + */ +public final class CitationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.CitationMetadata) + CitationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CitationMetadata.newBuilder() to construct. + private CitationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CitationMetadata() { + citations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CitationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_CitationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_CitationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CitationMetadata.class, + com.google.cloud.vertexai.api.CitationMetadata.Builder.class); + } + + public static final int CITATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List citations_; + /** + * + * + *
+   * Output only. List of citations.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getCitationsList() { + return citations_; + } + /** + * + * + *
+   * Output only. List of citations.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getCitationsOrBuilderList() { + return citations_; + } + /** + * + * + *
+   * Output only. List of citations.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getCitationsCount() { + return citations_.size(); + } + /** + * + * + *
+   * Output only. List of citations.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Citation getCitations(int index) { + return citations_.get(index); + } + /** + * + * + *
+   * Output only. List of citations.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.CitationOrBuilder getCitationsOrBuilder(int index) { + return citations_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < citations_.size(); i++) { + output.writeMessage(1, citations_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < citations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, citations_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.CitationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.CitationMetadata other = + (com.google.cloud.vertexai.api.CitationMetadata) obj; + + if (!getCitationsList().equals(other.getCitationsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCitationsCount() > 0) { + hash = (37 * hash) + CITATIONS_FIELD_NUMBER; + hash = (53 * hash) + getCitationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CitationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.CitationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A collection of source attributions for a piece of content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CitationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.CitationMetadata) + com.google.cloud.vertexai.api.CitationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_CitationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_CitationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CitationMetadata.class, + com.google.cloud.vertexai.api.CitationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.CitationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (citationsBuilder_ == null) { + citations_ = java.util.Collections.emptyList(); + } else { + citations_ = null; + citationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_CitationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CitationMetadata getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.CitationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CitationMetadata build() { + com.google.cloud.vertexai.api.CitationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CitationMetadata buildPartial() { + com.google.cloud.vertexai.api.CitationMetadata result = + new com.google.cloud.vertexai.api.CitationMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.CitationMetadata result) { + if (citationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + citations_ = java.util.Collections.unmodifiableList(citations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.citations_ = citations_; + } else { + result.citations_ = citationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.CitationMetadata result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.CitationMetadata) { + return mergeFrom((com.google.cloud.vertexai.api.CitationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.CitationMetadata other) { + if (other == com.google.cloud.vertexai.api.CitationMetadata.getDefaultInstance()) return this; + if (citationsBuilder_ == null) { + if (!other.citations_.isEmpty()) { + if (citations_.isEmpty()) { + citations_ = other.citations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCitationsIsMutable(); + citations_.addAll(other.citations_); + } + onChanged(); + } + } else { + if (!other.citations_.isEmpty()) { + if (citationsBuilder_.isEmpty()) { + citationsBuilder_.dispose(); + citationsBuilder_ = null; + citations_ = other.citations_; + bitField0_ = (bitField0_ & ~0x00000001); + citationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCitationsFieldBuilder() + : null; + } else { + citationsBuilder_.addAllMessages(other.citations_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vertexai.api.Citation m = + input.readMessage( + com.google.cloud.vertexai.api.Citation.parser(), extensionRegistry); + if (citationsBuilder_ == null) { + ensureCitationsIsMutable(); + citations_.add(m); + } else { + citationsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List citations_ = + java.util.Collections.emptyList(); + + private void ensureCitationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + citations_ = new java.util.ArrayList(citations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Citation, + com.google.cloud.vertexai.api.Citation.Builder, + com.google.cloud.vertexai.api.CitationOrBuilder> + citationsBuilder_; + + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getCitationsList() { + if (citationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(citations_); + } else { + return citationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getCitationsCount() { + if (citationsBuilder_ == null) { + return citations_.size(); + } else { + return citationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Citation getCitations(int index) { + if (citationsBuilder_ == null) { + return citations_.get(index); + } else { + return citationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCitations(int index, com.google.cloud.vertexai.api.Citation value) { + if (citationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCitationsIsMutable(); + citations_.set(index, value); + onChanged(); + } else { + citationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCitations( + int index, com.google.cloud.vertexai.api.Citation.Builder builderForValue) { + if (citationsBuilder_ == null) { + ensureCitationsIsMutable(); + citations_.set(index, builderForValue.build()); + onChanged(); + } else { + citationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCitations(com.google.cloud.vertexai.api.Citation value) { + if (citationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCitationsIsMutable(); + citations_.add(value); + onChanged(); + } else { + citationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCitations(int index, com.google.cloud.vertexai.api.Citation value) { + if (citationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCitationsIsMutable(); + citations_.add(index, value); + onChanged(); + } else { + citationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCitations(com.google.cloud.vertexai.api.Citation.Builder builderForValue) { + if (citationsBuilder_ == null) { + ensureCitationsIsMutable(); + citations_.add(builderForValue.build()); + onChanged(); + } else { + citationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCitations( + int index, com.google.cloud.vertexai.api.Citation.Builder builderForValue) { + if (citationsBuilder_ == null) { + ensureCitationsIsMutable(); + citations_.add(index, builderForValue.build()); + onChanged(); + } else { + citationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllCitations( + java.lang.Iterable values) { + if (citationsBuilder_ == null) { + ensureCitationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, citations_); + onChanged(); + } else { + citationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCitations() { + if (citationsBuilder_ == null) { + citations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + citationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeCitations(int index) { + if (citationsBuilder_ == null) { + ensureCitationsIsMutable(); + citations_.remove(index); + onChanged(); + } else { + citationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Citation.Builder getCitationsBuilder(int index) { + return getCitationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.CitationOrBuilder getCitationsOrBuilder(int index) { + if (citationsBuilder_ == null) { + return citations_.get(index); + } else { + return citationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getCitationsOrBuilderList() { + if (citationsBuilder_ != null) { + return citationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(citations_); + } + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Citation.Builder addCitationsBuilder() { + return getCitationsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Citation.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Citation.Builder addCitationsBuilder(int index) { + return getCitationsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Citation.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of citations.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getCitationsBuilderList() { + return getCitationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Citation, + com.google.cloud.vertexai.api.Citation.Builder, + com.google.cloud.vertexai.api.CitationOrBuilder> + getCitationsFieldBuilder() { + if (citationsBuilder_ == null) { + citationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Citation, + com.google.cloud.vertexai.api.Citation.Builder, + com.google.cloud.vertexai.api.CitationOrBuilder>( + citations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + citations_ = null; + } + return citationsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.CitationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.CitationMetadata) + private static final com.google.cloud.vertexai.api.CitationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.CitationMetadata(); + } + + public static com.google.cloud.vertexai.api.CitationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CitationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CitationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CitationMetadataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CitationMetadataOrBuilder.java new file mode 100644 index 000000000000..b7153afcdbc7 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CitationMetadataOrBuilder.java @@ -0,0 +1,87 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface CitationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.CitationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. List of citations.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getCitationsList(); + /** + * + * + *
+   * Output only. List of citations.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.Citation getCitations(int index); + /** + * + * + *
+   * Output only. List of citations.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getCitationsCount(); + /** + * + * + *
+   * Output only. List of citations.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getCitationsOrBuilderList(); + /** + * + * + *
+   * Output only. List of citations.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Citation citations = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.CitationOrBuilder getCitationsOrBuilder(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CitationOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CitationOrBuilder.java new file mode 100644 index 000000000000..d64ea03c24ae --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CitationOrBuilder.java @@ -0,0 +1,164 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface CitationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Citation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Start index into the content.
+   * 
+ * + * int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The startIndex. + */ + int getStartIndex(); + + /** + * + * + *
+   * Output only. End index into the content.
+   * 
+ * + * int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The endIndex. + */ + int getEndIndex(); + + /** + * + * + *
+   * Output only. Url reference of the attribution.
+   * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Output only. Url reference of the attribution.
+   * 
+ * + * string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Output only. Title of the attribution.
+   * 
+ * + * string title = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Output only. Title of the attribution.
+   * 
+ * + * string title = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * Output only. License of the attribution.
+   * 
+ * + * string license = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The license. + */ + java.lang.String getLicense(); + /** + * + * + *
+   * Output only. License of the attribution.
+   * 
+ * + * string license = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for license. + */ + com.google.protobuf.ByteString getLicenseBytes(); + + /** + * + * + *
+   * Output only. Publication date of the attribution.
+   * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the publicationDate field is set. + */ + boolean hasPublicationDate(); + /** + * + * + *
+   * Output only. Publication date of the attribution.
+   * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The publicationDate. + */ + com.google.type.Date getPublicationDate(); + /** + * + * + *
+   * Output only. Publication date of the attribution.
+   * 
+ * + * .google.type.Date publication_date = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.type.DateOrBuilder getPublicationDateOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContainerRegistryDestination.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContainerRegistryDestination.java new file mode 100644 index 000000000000..fc72e3017708 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContainerRegistryDestination.java @@ -0,0 +1,695 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The Container Registry location for the container image.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ContainerRegistryDestination} + */ +public final class ContainerRegistryDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ContainerRegistryDestination) + ContainerRegistryDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContainerRegistryDestination.newBuilder() to construct. + private ContainerRegistryDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContainerRegistryDestination() { + outputUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContainerRegistryDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_ContainerRegistryDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_ContainerRegistryDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ContainerRegistryDestination.class, + com.google.cloud.vertexai.api.ContainerRegistryDestination.Builder.class); + } + + public static final int OUTPUT_URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object outputUri_ = ""; + /** + * + * + *
+   * Required. Container Registry URI of a container image.
+   * Only Google Container Registry and Artifact Registry are supported now.
+   * Accepted forms:
+   *
+   * *  Google Container Registry path. For example:
+   *    `gcr.io/projectId/imageName:tag`.
+   *
+   * *  Artifact Registry path. For example:
+   *    `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`.
+   *
+   * If a tag is not specified, "latest" will be used as the default tag.
+   * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUri. + */ + @java.lang.Override + public java.lang.String getOutputUri() { + java.lang.Object ref = outputUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Container Registry URI of a container image.
+   * Only Google Container Registry and Artifact Registry are supported now.
+   * Accepted forms:
+   *
+   * *  Google Container Registry path. For example:
+   *    `gcr.io/projectId/imageName:tag`.
+   *
+   * *  Artifact Registry path. For example:
+   *    `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`.
+   *
+   * If a tag is not specified, "latest" will be used as the default tag.
+   * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputUriBytes() { + java.lang.Object ref = outputUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputUri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputUri_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ContainerRegistryDestination)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ContainerRegistryDestination other = + (com.google.cloud.vertexai.api.ContainerRegistryDestination) obj; + + if (!getOutputUri().equals(other.getOutputUri())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OUTPUT_URI_FIELD_NUMBER; + hash = (53 * hash) + getOutputUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.ContainerRegistryDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The Container Registry location for the container image.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ContainerRegistryDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ContainerRegistryDestination) + com.google.cloud.vertexai.api.ContainerRegistryDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_ContainerRegistryDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_ContainerRegistryDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ContainerRegistryDestination.class, + com.google.cloud.vertexai.api.ContainerRegistryDestination.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ContainerRegistryDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + outputUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_ContainerRegistryDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ContainerRegistryDestination getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ContainerRegistryDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ContainerRegistryDestination build() { + com.google.cloud.vertexai.api.ContainerRegistryDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ContainerRegistryDestination buildPartial() { + com.google.cloud.vertexai.api.ContainerRegistryDestination result = + new com.google.cloud.vertexai.api.ContainerRegistryDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.ContainerRegistryDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.outputUri_ = outputUri_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ContainerRegistryDestination) { + return mergeFrom((com.google.cloud.vertexai.api.ContainerRegistryDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ContainerRegistryDestination other) { + if (other == com.google.cloud.vertexai.api.ContainerRegistryDestination.getDefaultInstance()) + return this; + if (!other.getOutputUri().isEmpty()) { + outputUri_ = other.outputUri_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + outputUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object outputUri_ = ""; + /** + * + * + *
+     * Required. Container Registry URI of a container image.
+     * Only Google Container Registry and Artifact Registry are supported now.
+     * Accepted forms:
+     *
+     * *  Google Container Registry path. For example:
+     *    `gcr.io/projectId/imageName:tag`.
+     *
+     * *  Artifact Registry path. For example:
+     *    `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`.
+     *
+     * If a tag is not specified, "latest" will be used as the default tag.
+     * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUri. + */ + public java.lang.String getOutputUri() { + java.lang.Object ref = outputUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Container Registry URI of a container image.
+     * Only Google Container Registry and Artifact Registry are supported now.
+     * Accepted forms:
+     *
+     * *  Google Container Registry path. For example:
+     *    `gcr.io/projectId/imageName:tag`.
+     *
+     * *  Artifact Registry path. For example:
+     *    `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`.
+     *
+     * If a tag is not specified, "latest" will be used as the default tag.
+     * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUri. + */ + public com.google.protobuf.ByteString getOutputUriBytes() { + java.lang.Object ref = outputUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Container Registry URI of a container image.
+     * Only Google Container Registry and Artifact Registry are supported now.
+     * Accepted forms:
+     *
+     * *  Google Container Registry path. For example:
+     *    `gcr.io/projectId/imageName:tag`.
+     *
+     * *  Artifact Registry path. For example:
+     *    `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`.
+     *
+     * If a tag is not specified, "latest" will be used as the default tag.
+     * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The outputUri to set. + * @return This builder for chaining. + */ + public Builder setOutputUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Container Registry URI of a container image.
+     * Only Google Container Registry and Artifact Registry are supported now.
+     * Accepted forms:
+     *
+     * *  Google Container Registry path. For example:
+     *    `gcr.io/projectId/imageName:tag`.
+     *
+     * *  Artifact Registry path. For example:
+     *    `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`.
+     *
+     * If a tag is not specified, "latest" will be used as the default tag.
+     * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearOutputUri() { + outputUri_ = getDefaultInstance().getOutputUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Container Registry URI of a container image.
+     * Only Google Container Registry and Artifact Registry are supported now.
+     * Accepted forms:
+     *
+     * *  Google Container Registry path. For example:
+     *    `gcr.io/projectId/imageName:tag`.
+     *
+     * *  Artifact Registry path. For example:
+     *    `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`.
+     *
+     * If a tag is not specified, "latest" will be used as the default tag.
+     * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for outputUri to set. + * @return This builder for chaining. + */ + public Builder setOutputUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ContainerRegistryDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ContainerRegistryDestination) + private static final com.google.cloud.vertexai.api.ContainerRegistryDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ContainerRegistryDestination(); + } + + public static com.google.cloud.vertexai.api.ContainerRegistryDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContainerRegistryDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ContainerRegistryDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContainerRegistryDestinationOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContainerRegistryDestinationOrBuilder.java new file mode 100644 index 000000000000..bbb8e5529f9a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContainerRegistryDestinationOrBuilder.java @@ -0,0 +1,70 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +public interface ContainerRegistryDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ContainerRegistryDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Container Registry URI of a container image.
+   * Only Google Container Registry and Artifact Registry are supported now.
+   * Accepted forms:
+   *
+   * *  Google Container Registry path. For example:
+   *    `gcr.io/projectId/imageName:tag`.
+   *
+   * *  Artifact Registry path. For example:
+   *    `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`.
+   *
+   * If a tag is not specified, "latest" will be used as the default tag.
+   * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUri. + */ + java.lang.String getOutputUri(); + /** + * + * + *
+   * Required. Container Registry URI of a container image.
+   * Only Google Container Registry and Artifact Registry are supported now.
+   * Accepted forms:
+   *
+   * *  Google Container Registry path. For example:
+   *    `gcr.io/projectId/imageName:tag`.
+   *
+   * *  Artifact Registry path. For example:
+   *    `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`.
+   *
+   * If a tag is not specified, "latest" will be used as the default tag.
+   * 
+ * + * string output_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUri. + */ + com.google.protobuf.ByteString getOutputUriBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Content.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Content.java new file mode 100644 index 000000000000..bb690cdf5e7a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Content.java @@ -0,0 +1,1208 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The base structured datatype containing multi-part content of a message.
+ *
+ * A `Content` includes a `role` field designating the producer of the `Content`
+ * and a `parts` field containing multi-part data that contains the content of
+ * the message turn.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Content} + */ +public final class Content extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Content) + ContentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Content.newBuilder() to construct. + private Content(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Content() { + role_ = ""; + parts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Content(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Content_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Content_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Content.class, + com.google.cloud.vertexai.api.Content.Builder.class); + } + + public static final int ROLE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object role_ = ""; + /** + * + * + *
+   * Optional. The producer of the content. Must be either 'user' or 'model'.
+   *
+   * Useful to set for multi-turn conversations, otherwise can be left blank
+   * or unset.
+   * 
+ * + * string role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The role. + */ + @java.lang.Override + public java.lang.String getRole() { + java.lang.Object ref = role_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + role_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The producer of the content. Must be either 'user' or 'model'.
+   *
+   * Useful to set for multi-turn conversations, otherwise can be left blank
+   * or unset.
+   * 
+ * + * string role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for role. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoleBytes() { + java.lang.Object ref = role_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + role_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List parts_; + /** + * + * + *
+   * Required. Ordered `Parts` that constitute a single message. Parts may have
+   * different IANA MIME types.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getPartsList() { + return parts_; + } + /** + * + * + *
+   * Required. Ordered `Parts` that constitute a single message. Parts may have
+   * different IANA MIME types.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPartsOrBuilderList() { + return parts_; + } + /** + * + * + *
+   * Required. Ordered `Parts` that constitute a single message. Parts may have
+   * different IANA MIME types.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPartsCount() { + return parts_.size(); + } + /** + * + * + *
+   * Required. Ordered `Parts` that constitute a single message. Parts may have
+   * different IANA MIME types.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Part getParts(int index) { + return parts_.get(index); + } + /** + * + * + *
+   * Required. Ordered `Parts` that constitute a single message. Parts may have
+   * different IANA MIME types.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.PartOrBuilder getPartsOrBuilder(int index) { + return parts_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, role_); + } + for (int i = 0; i < parts_.size(); i++) { + output.writeMessage(2, parts_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, role_); + } + for (int i = 0; i < parts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, parts_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Content)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Content other = (com.google.cloud.vertexai.api.Content) obj; + + if (!getRole().equals(other.getRole())) return false; + if (!getPartsList().equals(other.getPartsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ROLE_FIELD_NUMBER; + hash = (53 * hash) + getRole().hashCode(); + if (getPartsCount() > 0) { + hash = (37 * hash) + PARTS_FIELD_NUMBER; + hash = (53 * hash) + getPartsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Content parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Content parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Content parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Content parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Content parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Content parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Content parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Content parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Content parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Content parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Content parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Content parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Content prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The base structured datatype containing multi-part content of a message.
+   *
+   * A `Content` includes a `role` field designating the producer of the `Content`
+   * and a `parts` field containing multi-part data that contains the content of
+   * the message turn.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Content} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Content) + com.google.cloud.vertexai.api.ContentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Content_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Content_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Content.class, + com.google.cloud.vertexai.api.Content.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Content.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + role_ = ""; + if (partsBuilder_ == null) { + parts_ = java.util.Collections.emptyList(); + } else { + parts_ = null; + partsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Content_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Content getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Content.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Content build() { + com.google.cloud.vertexai.api.Content result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Content buildPartial() { + com.google.cloud.vertexai.api.Content result = + new com.google.cloud.vertexai.api.Content(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.Content result) { + if (partsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + parts_ = java.util.Collections.unmodifiableList(parts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.parts_ = parts_; + } else { + result.parts_ = partsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.Content result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.role_ = role_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Content) { + return mergeFrom((com.google.cloud.vertexai.api.Content) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Content other) { + if (other == com.google.cloud.vertexai.api.Content.getDefaultInstance()) return this; + if (!other.getRole().isEmpty()) { + role_ = other.role_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (partsBuilder_ == null) { + if (!other.parts_.isEmpty()) { + if (parts_.isEmpty()) { + parts_ = other.parts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePartsIsMutable(); + parts_.addAll(other.parts_); + } + onChanged(); + } + } else { + if (!other.parts_.isEmpty()) { + if (partsBuilder_.isEmpty()) { + partsBuilder_.dispose(); + partsBuilder_ = null; + parts_ = other.parts_; + bitField0_ = (bitField0_ & ~0x00000002); + partsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPartsFieldBuilder() + : null; + } else { + partsBuilder_.addAllMessages(other.parts_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + role_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.vertexai.api.Part m = + input.readMessage( + com.google.cloud.vertexai.api.Part.parser(), extensionRegistry); + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.add(m); + } else { + partsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object role_ = ""; + /** + * + * + *
+     * Optional. The producer of the content. Must be either 'user' or 'model'.
+     *
+     * Useful to set for multi-turn conversations, otherwise can be left blank
+     * or unset.
+     * 
+ * + * string role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The role. + */ + public java.lang.String getRole() { + java.lang.Object ref = role_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + role_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The producer of the content. Must be either 'user' or 'model'.
+     *
+     * Useful to set for multi-turn conversations, otherwise can be left blank
+     * or unset.
+     * 
+ * + * string role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for role. + */ + public com.google.protobuf.ByteString getRoleBytes() { + java.lang.Object ref = role_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + role_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The producer of the content. Must be either 'user' or 'model'.
+     *
+     * Useful to set for multi-turn conversations, otherwise can be left blank
+     * or unset.
+     * 
+ * + * string role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The role to set. + * @return This builder for chaining. + */ + public Builder setRole(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + role_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The producer of the content. Must be either 'user' or 'model'.
+     *
+     * Useful to set for multi-turn conversations, otherwise can be left blank
+     * or unset.
+     * 
+ * + * string role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRole() { + role_ = getDefaultInstance().getRole(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The producer of the content. Must be either 'user' or 'model'.
+     *
+     * Useful to set for multi-turn conversations, otherwise can be left blank
+     * or unset.
+     * 
+ * + * string role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for role to set. + * @return This builder for chaining. + */ + public Builder setRoleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + role_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List parts_ = + java.util.Collections.emptyList(); + + private void ensurePartsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + parts_ = new java.util.ArrayList(parts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Part, + com.google.cloud.vertexai.api.Part.Builder, + com.google.cloud.vertexai.api.PartOrBuilder> + partsBuilder_; + + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getPartsList() { + if (partsBuilder_ == null) { + return java.util.Collections.unmodifiableList(parts_); + } else { + return partsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPartsCount() { + if (partsBuilder_ == null) { + return parts_.size(); + } else { + return partsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Part getParts(int index) { + if (partsBuilder_ == null) { + return parts_.get(index); + } else { + return partsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setParts(int index, com.google.cloud.vertexai.api.Part value) { + if (partsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartsIsMutable(); + parts_.set(index, value); + onChanged(); + } else { + partsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setParts(int index, com.google.cloud.vertexai.api.Part.Builder builderForValue) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.set(index, builderForValue.build()); + onChanged(); + } else { + partsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addParts(com.google.cloud.vertexai.api.Part value) { + if (partsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartsIsMutable(); + parts_.add(value); + onChanged(); + } else { + partsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addParts(int index, com.google.cloud.vertexai.api.Part value) { + if (partsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartsIsMutable(); + parts_.add(index, value); + onChanged(); + } else { + partsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addParts(com.google.cloud.vertexai.api.Part.Builder builderForValue) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.add(builderForValue.build()); + onChanged(); + } else { + partsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addParts(int index, com.google.cloud.vertexai.api.Part.Builder builderForValue) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.add(index, builderForValue.build()); + onChanged(); + } else { + partsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllParts( + java.lang.Iterable values) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parts_); + onChanged(); + } else { + partsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearParts() { + if (partsBuilder_ == null) { + parts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + partsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeParts(int index) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.remove(index); + onChanged(); + } else { + partsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Part.Builder getPartsBuilder(int index) { + return getPartsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.PartOrBuilder getPartsOrBuilder(int index) { + if (partsBuilder_ == null) { + return parts_.get(index); + } else { + return partsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPartsOrBuilderList() { + if (partsBuilder_ != null) { + return partsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(parts_); + } + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Part.Builder addPartsBuilder() { + return getPartsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Part.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Part.Builder addPartsBuilder(int index) { + return getPartsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Part.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Ordered `Parts` that constitute a single message. Parts may have
+     * different IANA MIME types.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getPartsBuilderList() { + return getPartsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Part, + com.google.cloud.vertexai.api.Part.Builder, + com.google.cloud.vertexai.api.PartOrBuilder> + getPartsFieldBuilder() { + if (partsBuilder_ == null) { + partsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Part, + com.google.cloud.vertexai.api.Part.Builder, + com.google.cloud.vertexai.api.PartOrBuilder>( + parts_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + parts_ = null; + } + return partsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Content) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Content) + private static final com.google.cloud.vertexai.api.Content DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Content(); + } + + public static com.google.cloud.vertexai.api.Content getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Content parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Content getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContentOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContentOrBuilder.java new file mode 100644 index 000000000000..70af99701027 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContentOrBuilder.java @@ -0,0 +1,122 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface ContentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Content) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The producer of the content. Must be either 'user' or 'model'.
+   *
+   * Useful to set for multi-turn conversations, otherwise can be left blank
+   * or unset.
+   * 
+ * + * string role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The role. + */ + java.lang.String getRole(); + /** + * + * + *
+   * Optional. The producer of the content. Must be either 'user' or 'model'.
+   *
+   * Useful to set for multi-turn conversations, otherwise can be left blank
+   * or unset.
+   * 
+ * + * string role = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for role. + */ + com.google.protobuf.ByteString getRoleBytes(); + + /** + * + * + *
+   * Required. Ordered `Parts` that constitute a single message. Parts may have
+   * different IANA MIME types.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getPartsList(); + /** + * + * + *
+   * Required. Ordered `Parts` that constitute a single message. Parts may have
+   * different IANA MIME types.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.Part getParts(int index); + /** + * + * + *
+   * Required. Ordered `Parts` that constitute a single message. Parts may have
+   * different IANA MIME types.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPartsCount(); + /** + * + * + *
+   * Required. Ordered `Parts` that constitute a single message. Parts may have
+   * different IANA MIME types.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getPartsOrBuilderList(); + /** + * + * + *
+   * Required. Ordered `Parts` that constitute a single message. Parts may have
+   * different IANA MIME types.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Part parts = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.PartOrBuilder getPartsOrBuilder(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContentProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContentProto.java new file mode 100644 index 000000000000..f13d4128cd10 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ContentProto.java @@ -0,0 +1,310 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public final class ContentProto { + private ContentProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Content_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Content_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Part_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Part_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Blob_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Blob_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_FileData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_FileData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_VideoMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_VideoMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_LogitBiasEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_LogitBiasEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_SafetySetting_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_SafetySetting_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_SafetyRating_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_SafetyRating_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_CitationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_CitationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Citation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Citation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Candidate_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Candidate_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n+google/cloud/vertexai/v1beta1/content." + + "proto\022\035google.cloud.vertexai.v1beta1\032\037go" + + "ogle/api/field_behavior.proto\032(google/cl" + + "oud/vertexai/v1beta1/tool.proto\032\036google/" + + "protobuf/duration.proto\032\026google/type/dat" + + "e.proto\"W\n\007Content\022\022\n\004role\030\001 \001(\tB\004\342A\001\001\0228" + + "\n\005parts\030\002 \003(\0132#.google.cloud.vertexai.v1" + + "beta1.PartB\004\342A\001\002\"\244\003\n\004Part\022\024\n\004text\030\001 \001(\tB" + + "\004\342A\001\001H\000\022@\n\013inline_data\030\002 \001(\0132#.google.cl" + + "oud.vertexai.v1beta1.BlobB\004\342A\001\001H\000\022B\n\tfil" + + "e_data\030\003 \001(\0132\'.google.cloud.vertexai.v1b" + + "eta1.FileDataB\004\342A\001\001H\000\022J\n\rfunction_call\030\005" + + " \001(\0132+.google.cloud.vertexai.v1beta1.Fun" + + "ctionCallB\004\342A\001\001H\000\022R\n\021function_response\030\006" + + " \001(\0132/.google.cloud.vertexai.v1beta1.Fun" + + "ctionResponseB\004\342A\001\001H\000\022L\n\016video_metadata\030" + + "\004 \001(\0132,.google.cloud.vertexai.v1beta1.Vi" + + "deoMetadataB\004\342A\001\001H\001B\006\n\004dataB\n\n\010metadata\"" + + "3\n\004Blob\022\027\n\tmime_type\030\001 \001(\tB\004\342A\001\002\022\022\n\004data" + + "\030\002 \001(\014B\004\342A\001\002\";\n\010FileData\022\027\n\tmime_type\030\001 " + + "\001(\tB\004\342A\001\002\022\026\n\010file_uri\030\002 \001(\tB\004\342A\001\002\"{\n\rVid" + + "eoMetadata\0225\n\014start_offset\030\001 \001(\0132\031.googl" + + "e.protobuf.DurationB\004\342A\001\001\0223\n\nend_offset\030" + + "\002 \001(\0132\031.google.protobuf.DurationB\004\342A\001\001\"\256" + + "\003\n\020GenerationConfig\022\031\n\013temperature\030\001 \001(\002" + + "B\004\342A\001\001\022\023\n\005top_p\030\002 \001(\002B\004\342A\001\001\022\023\n\005top_k\030\003 \001" + + "(\002B\004\342A\001\001\022\035\n\017candidate_count\030\004 \001(\005B\004\342A\001\001\022" + + "\037\n\021max_output_tokens\030\005 \001(\005B\004\342A\001\001\022\034\n\016stop" + + "_sequences\030\006 \003(\tB\004\342A\001\001\022\026\n\010logprobs\030\007 \001(\005" + + "B\004\342A\001\001\022\036\n\020presence_penalty\030\010 \001(\002B\004\342A\001\001\022\037" + + "\n\021frequency_penalty\030\t \001(\002B\004\342A\001\001\022X\n\nlogit" + + "_bias\030\n \003(\0132>.google.cloud.vertexai.v1be" + + "ta1.GenerationConfig.LogitBiasEntryB\004\342A\001" + + "\001\022\022\n\004echo\030\013 \001(\010B\004\342A\001\001\0320\n\016LogitBiasEntry\022" + + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\002:\0028\001\"\305\002\n\rSafe" + + "tySetting\022C\n\010category\030\001 \001(\0162+.google.clo" + + "ud.vertexai.v1beta1.HarmCategoryB\004\342A\001\002\022X" + + "\n\tthreshold\030\002 \001(\0162?.google.cloud.vertexa" + + "i.v1beta1.SafetySetting.HarmBlockThresho" + + "ldB\004\342A\001\002\"\224\001\n\022HarmBlockThreshold\022$\n HARM_" + + "BLOCK_THRESHOLD_UNSPECIFIED\020\000\022\027\n\023BLOCK_L" + + "OW_AND_ABOVE\020\001\022\032\n\026BLOCK_MEDIUM_AND_ABOVE" + + "\020\002\022\023\n\017BLOCK_ONLY_HIGH\020\003\022\016\n\nBLOCK_NONE\020\004\"" + + "\246\002\n\014SafetyRating\022C\n\010category\030\001 \001(\0162+.goo" + + "gle.cloud.vertexai.v1beta1.HarmCategoryB" + + "\004\342A\001\003\022V\n\013probability\030\002 \001(\0162;.google.clou" + + "d.vertexai.v1beta1.SafetyRating.HarmProb" + + "abilityB\004\342A\001\003\022\025\n\007blocked\030\003 \001(\010B\004\342A\001\003\"b\n\017" + + "HarmProbability\022 \n\034HARM_PROBABILITY_UNSP" + + "ECIFIED\020\000\022\016\n\nNEGLIGIBLE\020\001\022\007\n\003LOW\020\002\022\n\n\006ME" + + "DIUM\020\003\022\010\n\004HIGH\020\004\"T\n\020CitationMetadata\022@\n\t" + + "citations\030\001 \003(\0132\'.google.cloud.vertexai." + + "v1beta1.CitationB\004\342A\001\003\"\260\001\n\010Citation\022\031\n\013s" + + "tart_index\030\001 \001(\005B\004\342A\001\003\022\027\n\tend_index\030\002 \001(" + + "\005B\004\342A\001\003\022\021\n\003uri\030\003 \001(\tB\004\342A\001\003\022\023\n\005title\030\004 \001(" + + "\tB\004\342A\001\003\022\025\n\007license\030\005 \001(\tB\004\342A\001\003\0221\n\020public" + + "ation_date\030\006 \001(\0132\021.google.type.DateB\004\342A\001" + + "\003\"\366\003\n\tCandidate\022\023\n\005index\030\001 \001(\005B\004\342A\001\003\022=\n\007" + + "content\030\002 \001(\0132&.google.cloud.vertexai.v1" + + "beta1.ContentB\004\342A\001\003\022R\n\rfinish_reason\030\003 \001" + + "(\01625.google.cloud.vertexai.v1beta1.Candi" + + "date.FinishReasonB\004\342A\001\003\022I\n\016safety_rating" + + "s\030\004 \003(\0132+.google.cloud.vertexai.v1beta1." + + "SafetyRatingB\004\342A\001\003\022!\n\016finish_message\030\005 \001" + + "(\tB\004\342A\001\003H\000\210\001\001\022P\n\021citation_metadata\030\006 \001(\013" + + "2/.google.cloud.vertexai.v1beta1.Citatio" + + "nMetadataB\004\342A\001\003\"n\n\014FinishReason\022\035\n\031FINIS" + + "H_REASON_UNSPECIFIED\020\000\022\010\n\004STOP\020\001\022\016\n\nMAX_" + + "TOKENS\020\002\022\n\n\006SAFETY\020\003\022\016\n\nRECITATION\020\004\022\t\n\005" + + "OTHER\020\005B\021\n\017_finish_message*\264\001\n\014HarmCateg" + + "ory\022\035\n\031HARM_CATEGORY_UNSPECIFIED\020\000\022\035\n\031HA" + + "RM_CATEGORY_HATE_SPEECH\020\001\022#\n\037HARM_CATEGO" + + "RY_DANGEROUS_CONTENT\020\002\022\034\n\030HARM_CATEGORY_" + + "HARASSMENT\020\003\022#\n\037HARM_CATEGORY_SEXUALLY_E" + + "XPLICIT\020\004B\321\001\n\035com.google.cloud.vertexai." + + "apiB\014ContentProtoP\001Z=cloud.google.com/go" + + "/vertexai/apiv1beta1/vertexaipb;vertexai" + + "pb\252\002\035Google.Cloud.VertexAI.V1Beta1\312\002\035Goo" + + "gle\\Cloud\\VertexAI\\V1beta1\352\002 Google::Clo" + + "ud::VertexAI::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.vertexai.api.ToolProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.type.DateProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_Content_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_Content_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Content_descriptor, + new java.lang.String[] { + "Role", "Parts", + }); + internal_static_google_cloud_vertexai_v1beta1_Part_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vertexai_v1beta1_Part_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Part_descriptor, + new java.lang.String[] { + "Text", + "InlineData", + "FileData", + "FunctionCall", + "FunctionResponse", + "VideoMetadata", + "Data", + "Metadata", + }); + internal_static_google_cloud_vertexai_v1beta1_Blob_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vertexai_v1beta1_Blob_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Blob_descriptor, + new java.lang.String[] { + "MimeType", "Data", + }); + internal_static_google_cloud_vertexai_v1beta1_FileData_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vertexai_v1beta1_FileData_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_FileData_descriptor, + new java.lang.String[] { + "MimeType", "FileUri", + }); + internal_static_google_cloud_vertexai_v1beta1_VideoMetadata_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vertexai_v1beta1_VideoMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_VideoMetadata_descriptor, + new java.lang.String[] { + "StartOffset", "EndOffset", + }); + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_descriptor, + new java.lang.String[] { + "Temperature", + "TopP", + "TopK", + "CandidateCount", + "MaxOutputTokens", + "StopSequences", + "Logprobs", + "PresencePenalty", + "FrequencyPenalty", + "LogitBias", + "Echo", + }); + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_LogitBiasEntry_descriptor = + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_LogitBiasEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_LogitBiasEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_vertexai_v1beta1_SafetySetting_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_vertexai_v1beta1_SafetySetting_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_SafetySetting_descriptor, + new java.lang.String[] { + "Category", "Threshold", + }); + internal_static_google_cloud_vertexai_v1beta1_SafetyRating_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_vertexai_v1beta1_SafetyRating_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_SafetyRating_descriptor, + new java.lang.String[] { + "Category", "Probability", "Blocked", + }); + internal_static_google_cloud_vertexai_v1beta1_CitationMetadata_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_vertexai_v1beta1_CitationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_CitationMetadata_descriptor, + new java.lang.String[] { + "Citations", + }); + internal_static_google_cloud_vertexai_v1beta1_Citation_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_vertexai_v1beta1_Citation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Citation_descriptor, + new java.lang.String[] { + "StartIndex", "EndIndex", "Uri", "Title", "License", "PublicationDate", + }); + internal_static_google_cloud_vertexai_v1beta1_Candidate_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_vertexai_v1beta1_Candidate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Candidate_descriptor, + new java.lang.String[] { + "Index", + "Content", + "FinishReason", + "SafetyRatings", + "FinishMessage", + "CitationMetadata", + "FinishMessage", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.vertexai.api.ToolProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.type.DateProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequest.java new file mode 100644 index 000000000000..16df2a95b15e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequest.java @@ -0,0 +1,1933 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [PredictionService.CountTokens][google.cloud.vertexai.v1beta1.PredictionService.CountTokens].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CountTokensRequest} + */ +public final class CountTokensRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.CountTokensRequest) + CountTokensRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CountTokensRequest.newBuilder() to construct. + private CountTokensRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CountTokensRequest() { + endpoint_ = ""; + model_ = ""; + instances_ = java.util.Collections.emptyList(); + contents_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CountTokensRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CountTokensRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CountTokensRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CountTokensRequest.class, + com.google.cloud.vertexai.api.CountTokensRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint requested to perform token counting.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint requested to perform token counting.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object model_ = ""; + /** + * + * + *
+   * Required. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * `projects/{project}/locations/{location}/publishers/*/models/*`
+   * 
+ * + * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * `projects/{project}/locations/{location}/publishers/*/models/*`
+   * 
+ * + * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List instances_; + /** + * + * + *
+   * Required. The instances that are the input to token counting call.
+   * Schema is identical to the prediction schema of the underlying model.
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * Required. The instances that are the input to token counting call.
+   * Schema is identical to the prediction schema of the underlying model.
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * Required. The instances that are the input to token counting call.
+   * Schema is identical to the prediction schema of the underlying model.
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * Required. The instances that are the input to token counting call.
+   * Schema is identical to the prediction schema of the underlying model.
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.Value getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * Required. The instances that are the input to token counting call.
+   * Schema is identical to the prediction schema of the underlying model.
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int CONTENTS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List contents_; + /** + * + * + *
+   * Required. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getContentsList() { + return contents_; + } + /** + * + * + *
+   * Required. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getContentsOrBuilderList() { + return contents_; + } + /** + * + * + *
+   * Required. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getContentsCount() { + return contents_.size(); + } + /** + * + * + *
+   * Required. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Content getContents(int index) { + return contents_.get(index); + } + /** + * + * + *
+   * Required. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index) { + return contents_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + for (int i = 0; i < instances_.size(); i++) { + output.writeMessage(2, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, model_); + } + for (int i = 0; i < contents_.size(); i++) { + output.writeMessage(4, contents_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, model_); + } + for (int i = 0; i < contents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, contents_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.CountTokensRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.CountTokensRequest other = + (com.google.cloud.vertexai.api.CountTokensRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (!getModel().equals(other.getModel())) return false; + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getContentsList().equals(other.getContentsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + if (getContentsCount() > 0) { + hash = (37 * hash) + CONTENTS_FIELD_NUMBER; + hash = (53 * hash) + getContentsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.CountTokensRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [PredictionService.CountTokens][google.cloud.vertexai.v1beta1.PredictionService.CountTokens].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CountTokensRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.CountTokensRequest) + com.google.cloud.vertexai.api.CountTokensRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CountTokensRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CountTokensRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CountTokensRequest.class, + com.google.cloud.vertexai.api.CountTokensRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.CountTokensRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + model_ = ""; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (contentsBuilder_ == null) { + contents_ = java.util.Collections.emptyList(); + } else { + contents_ = null; + contentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CountTokensRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CountTokensRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.CountTokensRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CountTokensRequest build() { + com.google.cloud.vertexai.api.CountTokensRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CountTokensRequest buildPartial() { + com.google.cloud.vertexai.api.CountTokensRequest result = + new com.google.cloud.vertexai.api.CountTokensRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.CountTokensRequest result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + if (contentsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + contents_ = java.util.Collections.unmodifiableList(contents_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.contents_ = contents_; + } else { + result.contents_ = contentsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.CountTokensRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.model_ = model_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.CountTokensRequest) { + return mergeFrom((com.google.cloud.vertexai.api.CountTokensRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.CountTokensRequest other) { + if (other == com.google.cloud.vertexai.api.CountTokensRequest.getDefaultInstance()) + return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000004); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (contentsBuilder_ == null) { + if (!other.contents_.isEmpty()) { + if (contents_.isEmpty()) { + contents_ = other.contents_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureContentsIsMutable(); + contents_.addAll(other.contents_); + } + onChanged(); + } + } else { + if (!other.contents_.isEmpty()) { + if (contentsBuilder_.isEmpty()) { + contentsBuilder_.dispose(); + contentsBuilder_ = null; + contents_ = other.contents_; + bitField0_ = (bitField0_ & ~0x00000008); + contentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getContentsFieldBuilder() + : null; + } else { + contentsBuilder_.addAllMessages(other.contents_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.protobuf.Value m = + input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + model_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: + { + com.google.cloud.vertexai.api.Content m = + input.readMessage( + com.google.cloud.vertexai.api.Content.parser(), extensionRegistry); + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(m); + } else { + contentsBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint requested to perform token counting.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to perform token counting.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to perform token counting.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to perform token counting.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to perform token counting.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object model_ = ""; + /** + * + * + *
+     * Required. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * `projects/{project}/locations/{location}/publishers/*/models/*`
+     * 
+ * + * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * `projects/{project}/locations/{location}/publishers/*/models/*`
+     * 
+ * + * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for model. + */ + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * `projects/{project}/locations/{location}/publishers/*/models/*`
+     * 
+ * + * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + model_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * `projects/{project}/locations/{location}/publishers/*/models/*`
+     * 
+ * + * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearModel() { + model_ = getDefaultInstance().getModel(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * `projects/{project}/locations/{location}/publishers/*/models/*`
+     * 
+ * + * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + model_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstances(int index, com.google.protobuf.Value value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstances(int index, com.google.protobuf.Value.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(com.google.protobuf.Value value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(int index, com.google.protobuf.Value value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(com.google.protobuf.Value.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(int index, com.google.protobuf.Value.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllInstances(java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value.Builder addInstancesBuilder() { + return getInstancesFieldBuilder().addBuilder(com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The instances that are the input to token counting call.
+     * Schema is identical to the prediction schema of the underlying model.
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + instances_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private java.util.List contents_ = + java.util.Collections.emptyList(); + + private void ensureContentsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + contents_ = new java.util.ArrayList(contents_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder> + contentsBuilder_; + + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getContentsList() { + if (contentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(contents_); + } else { + return contentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getContentsCount() { + if (contentsBuilder_ == null) { + return contents_.size(); + } else { + return contentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Content getContents(int index) { + if (contentsBuilder_ == null) { + return contents_.get(index); + } else { + return contentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setContents(int index, com.google.cloud.vertexai.api.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.set(index, value); + onChanged(); + } else { + contentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setContents( + int index, com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.set(index, builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addContents(com.google.cloud.vertexai.api.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.add(value); + onChanged(); + } else { + contentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addContents(int index, com.google.cloud.vertexai.api.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.add(index, value); + onChanged(); + } else { + contentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addContents(com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addContents( + int index, com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(index, builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllContents( + java.lang.Iterable values) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contents_); + onChanged(); + } else { + contentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearContents() { + if (contentsBuilder_ == null) { + contents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + contentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeContents(int index) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.remove(index); + onChanged(); + } else { + contentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder getContentsBuilder(int index) { + return getContentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index) { + if (contentsBuilder_ == null) { + return contents_.get(index); + } else { + return contentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getContentsOrBuilderList() { + if (contentsBuilder_ != null) { + return contentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(contents_); + } + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder addContentsBuilder() { + return getContentsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Content.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder addContentsBuilder(int index) { + return getContentsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Content.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getContentsBuilderList() { + return getContentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder> + getContentsFieldBuilder() { + if (contentsBuilder_ == null) { + contentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder>( + contents_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + contents_ = null; + } + return contentsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.CountTokensRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.CountTokensRequest) + private static final com.google.cloud.vertexai.api.CountTokensRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.CountTokensRequest(); + } + + public static com.google.cloud.vertexai.api.CountTokensRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CountTokensRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CountTokensRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequestOrBuilder.java new file mode 100644 index 000000000000..c294be3231a8 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequestOrBuilder.java @@ -0,0 +1,210 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface CountTokensRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.CountTokensRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint requested to perform token counting.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint requested to perform token counting.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * Required. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * `projects/{project}/locations/{location}/publishers/*/models/*`
+   * 
+ * + * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * Required. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * `projects/{project}/locations/{location}/publishers/*/models/*`
+   * 
+ * + * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); + + /** + * + * + *
+   * Required. The instances that are the input to token counting call.
+   * Schema is identical to the prediction schema of the underlying model.
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * Required. The instances that are the input to token counting call.
+   * Schema is identical to the prediction schema of the underlying model.
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.Value getInstances(int index); + /** + * + * + *
+   * Required. The instances that are the input to token counting call.
+   * Schema is identical to the prediction schema of the underlying model.
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getInstancesCount(); + /** + * + * + *
+   * Required. The instances that are the input to token counting call.
+   * Schema is identical to the prediction schema of the underlying model.
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getInstancesOrBuilderList(); + /** + * + * + *
+   * Required. The instances that are the input to token counting call.
+   * Schema is identical to the prediction schema of the underlying model.
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index); + + /** + * + * + *
+   * Required. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getContentsList(); + /** + * + * + *
+   * Required. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.Content getContents(int index); + /** + * + * + *
+   * Required. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getContentsCount(); + /** + * + * + *
+   * Required. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getContentsOrBuilderList(); + /** + * + * + *
+   * Required. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensResponse.java new file mode 100644 index 000000000000..e635bb41b63e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensResponse.java @@ -0,0 +1,633 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [PredictionService.CountTokens][google.cloud.vertexai.v1beta1.PredictionService.CountTokens].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CountTokensResponse} + */ +public final class CountTokensResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.CountTokensResponse) + CountTokensResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use CountTokensResponse.newBuilder() to construct. + private CountTokensResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CountTokensResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CountTokensResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CountTokensResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CountTokensResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CountTokensResponse.class, + com.google.cloud.vertexai.api.CountTokensResponse.Builder.class); + } + + public static final int TOTAL_TOKENS_FIELD_NUMBER = 1; + private int totalTokens_ = 0; + /** + * + * + *
+   * The total number of tokens counted across all instances from the request.
+   * 
+ * + * int32 total_tokens = 1; + * + * @return The totalTokens. + */ + @java.lang.Override + public int getTotalTokens() { + return totalTokens_; + } + + public static final int TOTAL_BILLABLE_CHARACTERS_FIELD_NUMBER = 2; + private int totalBillableCharacters_ = 0; + /** + * + * + *
+   * The total number of billable characters counted across all instances from
+   * the request.
+   * 
+ * + * int32 total_billable_characters = 2; + * + * @return The totalBillableCharacters. + */ + @java.lang.Override + public int getTotalBillableCharacters() { + return totalBillableCharacters_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (totalTokens_ != 0) { + output.writeInt32(1, totalTokens_); + } + if (totalBillableCharacters_ != 0) { + output.writeInt32(2, totalBillableCharacters_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (totalTokens_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, totalTokens_); + } + if (totalBillableCharacters_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, totalBillableCharacters_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.CountTokensResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.CountTokensResponse other = + (com.google.cloud.vertexai.api.CountTokensResponse) obj; + + if (getTotalTokens() != other.getTotalTokens()) return false; + if (getTotalBillableCharacters() != other.getTotalBillableCharacters()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TOTAL_TOKENS_FIELD_NUMBER; + hash = (53 * hash) + getTotalTokens(); + hash = (37 * hash) + TOTAL_BILLABLE_CHARACTERS_FIELD_NUMBER; + hash = (53 * hash) + getTotalBillableCharacters(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.CountTokensResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [PredictionService.CountTokens][google.cloud.vertexai.v1beta1.PredictionService.CountTokens].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CountTokensResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.CountTokensResponse) + com.google.cloud.vertexai.api.CountTokensResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CountTokensResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CountTokensResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CountTokensResponse.class, + com.google.cloud.vertexai.api.CountTokensResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.CountTokensResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + totalTokens_ = 0; + totalBillableCharacters_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CountTokensResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CountTokensResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.CountTokensResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CountTokensResponse build() { + com.google.cloud.vertexai.api.CountTokensResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CountTokensResponse buildPartial() { + com.google.cloud.vertexai.api.CountTokensResponse result = + new com.google.cloud.vertexai.api.CountTokensResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.CountTokensResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.totalTokens_ = totalTokens_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.totalBillableCharacters_ = totalBillableCharacters_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.CountTokensResponse) { + return mergeFrom((com.google.cloud.vertexai.api.CountTokensResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.CountTokensResponse other) { + if (other == com.google.cloud.vertexai.api.CountTokensResponse.getDefaultInstance()) + return this; + if (other.getTotalTokens() != 0) { + setTotalTokens(other.getTotalTokens()); + } + if (other.getTotalBillableCharacters() != 0) { + setTotalBillableCharacters(other.getTotalBillableCharacters()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + totalTokens_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + totalBillableCharacters_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int totalTokens_; + /** + * + * + *
+     * The total number of tokens counted across all instances from the request.
+     * 
+ * + * int32 total_tokens = 1; + * + * @return The totalTokens. + */ + @java.lang.Override + public int getTotalTokens() { + return totalTokens_; + } + /** + * + * + *
+     * The total number of tokens counted across all instances from the request.
+     * 
+ * + * int32 total_tokens = 1; + * + * @param value The totalTokens to set. + * @return This builder for chaining. + */ + public Builder setTotalTokens(int value) { + + totalTokens_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of tokens counted across all instances from the request.
+     * 
+ * + * int32 total_tokens = 1; + * + * @return This builder for chaining. + */ + public Builder clearTotalTokens() { + bitField0_ = (bitField0_ & ~0x00000001); + totalTokens_ = 0; + onChanged(); + return this; + } + + private int totalBillableCharacters_; + /** + * + * + *
+     * The total number of billable characters counted across all instances from
+     * the request.
+     * 
+ * + * int32 total_billable_characters = 2; + * + * @return The totalBillableCharacters. + */ + @java.lang.Override + public int getTotalBillableCharacters() { + return totalBillableCharacters_; + } + /** + * + * + *
+     * The total number of billable characters counted across all instances from
+     * the request.
+     * 
+ * + * int32 total_billable_characters = 2; + * + * @param value The totalBillableCharacters to set. + * @return This builder for chaining. + */ + public Builder setTotalBillableCharacters(int value) { + + totalBillableCharacters_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of billable characters counted across all instances from
+     * the request.
+     * 
+ * + * int32 total_billable_characters = 2; + * + * @return This builder for chaining. + */ + public Builder clearTotalBillableCharacters() { + bitField0_ = (bitField0_ & ~0x00000002); + totalBillableCharacters_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.CountTokensResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.CountTokensResponse) + private static final com.google.cloud.vertexai.api.CountTokensResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.CountTokensResponse(); + } + + public static com.google.cloud.vertexai.api.CountTokensResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CountTokensResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CountTokensResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensResponseOrBuilder.java new file mode 100644 index 000000000000..08d6b9a5c3a7 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CountTokensResponseOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface CountTokensResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.CountTokensResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total number of tokens counted across all instances from the request.
+   * 
+ * + * int32 total_tokens = 1; + * + * @return The totalTokens. + */ + int getTotalTokens(); + + /** + * + * + *
+   * The total number of billable characters counted across all instances from
+   * the request.
+   * 
+ * + * int32 total_billable_characters = 2; + * + * @return The totalBillableCharacters. + */ + int getTotalBillableCharacters(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointOperationMetadata.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointOperationMetadata.java new file mode 100644 index 000000000000..6085bd0838e5 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointOperationMetadata.java @@ -0,0 +1,721 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Runtime operation information for
+ * [EndpointService.CreateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.CreateEndpoint].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CreateEndpointOperationMetadata} + */ +public final class CreateEndpointOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.CreateEndpointOperationMetadata) + CreateEndpointOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateEndpointOperationMetadata.newBuilder() to construct. + private CreateEndpointOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateEndpointOperationMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateEndpointOperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CreateEndpointOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CreateEndpointOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CreateEndpointOperationMetadata.class, + com.google.cloud.vertexai.api.CreateEndpointOperationMetadata.Builder.class); + } + + public static final int GENERIC_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.GenericOperationMetadata genericMetadata_; + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + @java.lang.Override + public boolean hasGenericMetadata() { + return genericMetadata_ != null; + } + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata() { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (genericMetadata_ != null) { + output.writeMessage(1, getGenericMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (genericMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGenericMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.CreateEndpointOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.CreateEndpointOperationMetadata other = + (com.google.cloud.vertexai.api.CreateEndpointOperationMetadata) obj; + + if (hasGenericMetadata() != other.hasGenericMetadata()) return false; + if (hasGenericMetadata()) { + if (!getGenericMetadata().equals(other.getGenericMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGenericMetadata()) { + hash = (37 * hash) + GENERIC_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getGenericMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.CreateEndpointOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for
+   * [EndpointService.CreateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.CreateEndpoint].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CreateEndpointOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.CreateEndpointOperationMetadata) + com.google.cloud.vertexai.api.CreateEndpointOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CreateEndpointOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CreateEndpointOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CreateEndpointOperationMetadata.class, + com.google.cloud.vertexai.api.CreateEndpointOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.CreateEndpointOperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CreateEndpointOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CreateEndpointOperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.CreateEndpointOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CreateEndpointOperationMetadata build() { + com.google.cloud.vertexai.api.CreateEndpointOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CreateEndpointOperationMetadata buildPartial() { + com.google.cloud.vertexai.api.CreateEndpointOperationMetadata result = + new com.google.cloud.vertexai.api.CreateEndpointOperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.CreateEndpointOperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.genericMetadata_ = + genericMetadataBuilder_ == null ? genericMetadata_ : genericMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.CreateEndpointOperationMetadata) { + return mergeFrom((com.google.cloud.vertexai.api.CreateEndpointOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.CreateEndpointOperationMetadata other) { + if (other + == com.google.cloud.vertexai.api.CreateEndpointOperationMetadata.getDefaultInstance()) + return this; + if (other.hasGenericMetadata()) { + mergeGenericMetadata(other.getGenericMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGenericMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.GenericOperationMetadata genericMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder> + genericMetadataBuilder_; + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + public boolean hasGenericMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + public com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata() { + if (genericMetadataBuilder_ == null) { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } else { + return genericMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + genericMetadata_ = value; + } else { + genericMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder builderForValue) { + if (genericMetadataBuilder_ == null) { + genericMetadata_ = builderForValue.build(); + } else { + genericMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder mergeGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && genericMetadata_ != null + && genericMetadata_ + != com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance()) { + getGenericMetadataBuilder().mergeFrom(value); + } else { + genericMetadata_ = value; + } + } else { + genericMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder clearGenericMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.vertexai.api.GenericOperationMetadata.Builder + getGenericMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGenericMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + if (genericMetadataBuilder_ != null) { + return genericMetadataBuilder_.getMessageOrBuilder(); + } else { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder> + getGenericMetadataFieldBuilder() { + if (genericMetadataBuilder_ == null) { + genericMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder>( + getGenericMetadata(), getParentForChildren(), isClean()); + genericMetadata_ = null; + } + return genericMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.CreateEndpointOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.CreateEndpointOperationMetadata) + private static final com.google.cloud.vertexai.api.CreateEndpointOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.CreateEndpointOperationMetadata(); + } + + public static com.google.cloud.vertexai.api.CreateEndpointOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateEndpointOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CreateEndpointOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointOperationMetadataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..f40ed5ea1673 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointOperationMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface CreateEndpointOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.CreateEndpointOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + boolean hasGenericMetadata(); + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata(); + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder getGenericMetadataOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointRequest.java new file mode 100644 index 000000000000..54122efbabbe --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointRequest.java @@ -0,0 +1,1208 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [EndpointService.CreateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.CreateEndpoint].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CreateEndpointRequest} + */ +public final class CreateEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.CreateEndpointRequest) + CreateEndpointRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateEndpointRequest.newBuilder() to construct. + private CreateEndpointRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateEndpointRequest() { + parent_ = ""; + endpointId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateEndpointRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CreateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CreateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CreateEndpointRequest.class, + com.google.cloud.vertexai.api.CreateEndpointRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The resource name of the Location to create the Endpoint in.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Location to create the Endpoint in.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENDPOINT_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.Endpoint endpoint_; + /** + * + * + *
+   * Required. The Endpoint to create.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + @java.lang.Override + public boolean hasEndpoint() { + return endpoint_ != null; + } + /** + * + * + *
+   * Required. The Endpoint to create.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Endpoint getEndpoint() { + return endpoint_ == null + ? com.google.cloud.vertexai.api.Endpoint.getDefaultInstance() + : endpoint_; + } + /** + * + * + *
+   * Required. The Endpoint to create.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.EndpointOrBuilder getEndpointOrBuilder() { + return endpoint_ == null + ? com.google.cloud.vertexai.api.Endpoint.getDefaultInstance() + : endpoint_; + } + + public static final int ENDPOINT_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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.
+   * 
+ * + * string endpoint_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The endpointId. + */ + @java.lang.Override + public java.lang.String getEndpointId() { + java.lang.Object ref = endpointId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpointId_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string endpoint_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for endpointId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointIdBytes() { + java.lang.Object ref = endpointId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpointId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (endpoint_ != null) { + output.writeMessage(2, getEndpoint()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpointId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, endpointId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (endpoint_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndpoint()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpointId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, endpointId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.CreateEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.CreateEndpointRequest other = + (com.google.cloud.vertexai.api.CreateEndpointRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasEndpoint() != other.hasEndpoint()) return false; + if (hasEndpoint()) { + if (!getEndpoint().equals(other.getEndpoint())) return false; + } + if (!getEndpointId().equals(other.getEndpointId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasEndpoint()) { + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + } + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.CreateEndpointRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EndpointService.CreateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.CreateEndpoint].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CreateEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.CreateEndpointRequest) + com.google.cloud.vertexai.api.CreateEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CreateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CreateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CreateEndpointRequest.class, + com.google.cloud.vertexai.api.CreateEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.CreateEndpointRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + endpoint_ = null; + if (endpointBuilder_ != null) { + endpointBuilder_.dispose(); + endpointBuilder_ = null; + } + endpointId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_CreateEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CreateEndpointRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.CreateEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CreateEndpointRequest build() { + com.google.cloud.vertexai.api.CreateEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CreateEndpointRequest buildPartial() { + com.google.cloud.vertexai.api.CreateEndpointRequest result = + new com.google.cloud.vertexai.api.CreateEndpointRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.CreateEndpointRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endpoint_ = endpointBuilder_ == null ? endpoint_ : endpointBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endpointId_ = endpointId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.CreateEndpointRequest) { + return mergeFrom((com.google.cloud.vertexai.api.CreateEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.CreateEndpointRequest other) { + if (other == com.google.cloud.vertexai.api.CreateEndpointRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasEndpoint()) { + mergeEndpoint(other.getEndpoint()); + } + if (!other.getEndpointId().isEmpty()) { + endpointId_ = other.endpointId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndpointFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + endpointId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the Location to create the Endpoint in.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Location to create the Endpoint in.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Location to create the Endpoint in.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Location to create the Endpoint in.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Location to create the Endpoint in.
+     * Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.Endpoint endpoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Endpoint, + com.google.cloud.vertexai.api.Endpoint.Builder, + com.google.cloud.vertexai.api.EndpointOrBuilder> + endpointBuilder_; + /** + * + * + *
+     * Required. The Endpoint to create.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + public boolean hasEndpoint() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The Endpoint to create.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + public com.google.cloud.vertexai.api.Endpoint getEndpoint() { + if (endpointBuilder_ == null) { + return endpoint_ == null + ? com.google.cloud.vertexai.api.Endpoint.getDefaultInstance() + : endpoint_; + } else { + return endpointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Endpoint to create.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint(com.google.cloud.vertexai.api.Endpoint value) { + if (endpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + } else { + endpointBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Endpoint to create.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint(com.google.cloud.vertexai.api.Endpoint.Builder builderForValue) { + if (endpointBuilder_ == null) { + endpoint_ = builderForValue.build(); + } else { + endpointBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Endpoint to create.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEndpoint(com.google.cloud.vertexai.api.Endpoint value) { + if (endpointBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endpoint_ != null + && endpoint_ != com.google.cloud.vertexai.api.Endpoint.getDefaultInstance()) { + getEndpointBuilder().mergeFrom(value); + } else { + endpoint_ = value; + } + } else { + endpointBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Endpoint to create.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEndpoint() { + bitField0_ = (bitField0_ & ~0x00000002); + endpoint_ = null; + if (endpointBuilder_ != null) { + endpointBuilder_.dispose(); + endpointBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Endpoint to create.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Endpoint.Builder getEndpointBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndpointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Endpoint to create.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.EndpointOrBuilder getEndpointOrBuilder() { + if (endpointBuilder_ != null) { + return endpointBuilder_.getMessageOrBuilder(); + } else { + return endpoint_ == null + ? com.google.cloud.vertexai.api.Endpoint.getDefaultInstance() + : endpoint_; + } + } + /** + * + * + *
+     * Required. The Endpoint to create.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Endpoint, + com.google.cloud.vertexai.api.Endpoint.Builder, + com.google.cloud.vertexai.api.EndpointOrBuilder> + getEndpointFieldBuilder() { + if (endpointBuilder_ == null) { + endpointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Endpoint, + com.google.cloud.vertexai.api.Endpoint.Builder, + com.google.cloud.vertexai.api.EndpointOrBuilder>( + getEndpoint(), getParentForChildren(), isClean()); + endpoint_ = null; + } + return endpointBuilder_; + } + + private java.lang.Object 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.
+     * 
+ * + * string endpoint_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The endpointId. + */ + public java.lang.String getEndpointId() { + java.lang.Object ref = endpointId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpointId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string endpoint_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for endpointId. + */ + public com.google.protobuf.ByteString getEndpointIdBytes() { + java.lang.Object ref = endpointId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpointId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string endpoint_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The endpointId to set. + * @return This builder for chaining. + */ + public Builder setEndpointId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string endpoint_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearEndpointId() { + endpointId_ = getDefaultInstance().getEndpointId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string endpoint_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for endpointId to set. + * @return This builder for chaining. + */ + public Builder setEndpointIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpointId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.CreateEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.CreateEndpointRequest) + private static final com.google.cloud.vertexai.api.CreateEndpointRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.CreateEndpointRequest(); + } + + public static com.google.cloud.vertexai.api.CreateEndpointRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateEndpointRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CreateEndpointRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointRequestOrBuilder.java new file mode 100644 index 000000000000..f059312fba3a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CreateEndpointRequestOrBuilder.java @@ -0,0 +1,148 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface CreateEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.CreateEndpointRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Location to create the Endpoint in.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the Location to create the Endpoint in.
+   * Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The Endpoint to create.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + boolean hasEndpoint(); + /** + * + * + *
+   * Required. The Endpoint to create.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + com.google.cloud.vertexai.api.Endpoint getEndpoint(); + /** + * + * + *
+   * Required. The Endpoint to create.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.EndpointOrBuilder getEndpointOrBuilder(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string endpoint_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The endpointId. + */ + java.lang.String getEndpointId(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string endpoint_id = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for endpointId. + */ + com.google.protobuf.ByteString getEndpointIdBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvDestination.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvDestination.java new file mode 100644 index 000000000000..6ac134e72877 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvDestination.java @@ -0,0 +1,731 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The storage details for CSV output content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CsvDestination} + */ +public final class CsvDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.CsvDestination) + CsvDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use CsvDestination.newBuilder() to construct. + private CsvDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CsvDestination() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CsvDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_CsvDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_CsvDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CsvDestination.class, + com.google.cloud.vertexai.api.CsvDestination.Builder.class); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.GcsDestination gcsDestination_; + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return gcsDestination_ != null; + } + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsDestination getGcsDestination() { + return gcsDestination_ == null + ? com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance() + : gcsDestination_; + } + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + return gcsDestination_ == null + ? com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance() + : gcsDestination_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gcsDestination_ != null) { + output.writeMessage(1, getGcsDestination()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gcsDestination_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcsDestination()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.CsvDestination)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.CsvDestination other = + (com.google.cloud.vertexai.api.CsvDestination) obj; + + if (hasGcsDestination() != other.hasGcsDestination()) return false; + if (hasGcsDestination()) { + if (!getGcsDestination().equals(other.getGcsDestination())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGcsDestination()) { + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.CsvDestination parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CsvDestination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.CsvDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The storage details for CSV output content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CsvDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.CsvDestination) + com.google.cloud.vertexai.api.CsvDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_CsvDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_CsvDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CsvDestination.class, + com.google.cloud.vertexai.api.CsvDestination.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.CsvDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + gcsDestination_ = null; + if (gcsDestinationBuilder_ != null) { + gcsDestinationBuilder_.dispose(); + gcsDestinationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_CsvDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CsvDestination getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.CsvDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CsvDestination build() { + com.google.cloud.vertexai.api.CsvDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CsvDestination buildPartial() { + com.google.cloud.vertexai.api.CsvDestination result = + new com.google.cloud.vertexai.api.CsvDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.CsvDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.gcsDestination_ = + gcsDestinationBuilder_ == null ? gcsDestination_ : gcsDestinationBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.CsvDestination) { + return mergeFrom((com.google.cloud.vertexai.api.CsvDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.CsvDestination other) { + if (other == com.google.cloud.vertexai.api.CsvDestination.getDefaultInstance()) return this; + if (other.hasGcsDestination()) { + mergeGcsDestination(other.getGcsDestination()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGcsDestinationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.GcsDestination gcsDestination_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsDestination, + com.google.cloud.vertexai.api.GcsDestination.Builder, + com.google.cloud.vertexai.api.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsDestination field is set. + */ + public boolean hasGcsDestination() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsDestination. + */ + public com.google.cloud.vertexai.api.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + return gcsDestination_ == null + ? com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance() + : gcsDestination_; + } else { + return gcsDestinationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsDestination(com.google.cloud.vertexai.api.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcsDestination_ = value; + } else { + gcsDestinationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsDestination( + com.google.cloud.vertexai.api.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + gcsDestination_ = builderForValue.build(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeGcsDestination(com.google.cloud.vertexai.api.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && gcsDestination_ != null + && gcsDestination_ + != com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance()) { + getGcsDestinationBuilder().mergeFrom(value); + } else { + gcsDestination_ = value; + } + } else { + gcsDestinationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearGcsDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + gcsDestination_ = null; + if (gcsDestinationBuilder_ != null) { + gcsDestinationBuilder_.dispose(); + gcsDestinationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.GcsDestination.Builder getGcsDestinationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (gcsDestinationBuilder_ != null) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + return gcsDestination_ == null + ? com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance() + : gcsDestination_; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsDestination, + com.google.cloud.vertexai.api.GcsDestination.Builder, + com.google.cloud.vertexai.api.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsDestination, + com.google.cloud.vertexai.api.GcsDestination.Builder, + com.google.cloud.vertexai.api.GcsDestinationOrBuilder>( + getGcsDestination(), getParentForChildren(), isClean()); + gcsDestination_ = null; + } + return gcsDestinationBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.CsvDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.CsvDestination) + private static final com.google.cloud.vertexai.api.CsvDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.CsvDestination(); + } + + public static com.google.cloud.vertexai.api.CsvDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CsvDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CsvDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvDestinationOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvDestinationOrBuilder.java new file mode 100644 index 000000000000..de53a463f5ad --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvDestinationOrBuilder.java @@ -0,0 +1,66 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +public interface CsvDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.CsvDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsDestination field is set. + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsDestination. + */ + com.google.cloud.vertexai.api.GcsDestination getGcsDestination(); + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvSource.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvSource.java new file mode 100644 index 000000000000..2c91757fcce6 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvSource.java @@ -0,0 +1,727 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The storage details for CSV input content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CsvSource} + */ +public final class CsvSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.CsvSource) + CsvSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use CsvSource.newBuilder() to construct. + private CsvSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CsvSource() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CsvSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_CsvSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_CsvSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CsvSource.class, + com.google.cloud.vertexai.api.CsvSource.Builder.class); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.GcsSource gcsSource_; + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return gcsSource_ != null; + } + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSource getGcsSource() { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder() { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gcsSource_ != null) { + output.writeMessage(1, getGcsSource()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gcsSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcsSource()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.CsvSource)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.CsvSource other = (com.google.cloud.vertexai.api.CsvSource) obj; + + if (hasGcsSource() != other.hasGcsSource()) return false; + if (hasGcsSource()) { + if (!getGcsSource().equals(other.getGcsSource())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGcsSource()) { + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.CsvSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CsvSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CsvSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CsvSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CsvSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.CsvSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CsvSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CsvSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CsvSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CsvSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.CsvSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.CsvSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.CsvSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The storage details for CSV input content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.CsvSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.CsvSource) + com.google.cloud.vertexai.api.CsvSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_CsvSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_CsvSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.CsvSource.class, + com.google.cloud.vertexai.api.CsvSource.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.CsvSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + gcsSource_ = null; + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.dispose(); + gcsSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_CsvSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CsvSource getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.CsvSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CsvSource build() { + com.google.cloud.vertexai.api.CsvSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CsvSource buildPartial() { + com.google.cloud.vertexai.api.CsvSource result = + new com.google.cloud.vertexai.api.CsvSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.CsvSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.gcsSource_ = gcsSourceBuilder_ == null ? gcsSource_ : gcsSourceBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.CsvSource) { + return mergeFrom((com.google.cloud.vertexai.api.CsvSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.CsvSource other) { + if (other == com.google.cloud.vertexai.api.CsvSource.getDefaultInstance()) return this; + if (other.hasGcsSource()) { + mergeGcsSource(other.getGcsSource()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGcsSourceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.GcsSource gcsSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + public boolean hasGcsSource() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + public com.google.cloud.vertexai.api.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } else { + return gcsSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsSource(com.google.cloud.vertexai.api.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcsSource_ = value; + } else { + gcsSourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsSource(com.google.cloud.vertexai.api.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + gcsSource_ = builderForValue.build(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeGcsSource(com.google.cloud.vertexai.api.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && gcsSource_ != null + && gcsSource_ != com.google.cloud.vertexai.api.GcsSource.getDefaultInstance()) { + getGcsSourceBuilder().mergeFrom(value); + } else { + gcsSource_ = value; + } + } else { + gcsSourceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearGcsSource() { + bitField0_ = (bitField0_ & ~0x00000001); + gcsSource_ = null; + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.dispose(); + gcsSourceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.GcsSource.Builder getGcsSourceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (gcsSourceBuilder_ != null) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder>( + getGcsSource(), getParentForChildren(), isClean()); + gcsSource_ = null; + } + return gcsSourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.CsvSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.CsvSource) + private static final com.google.cloud.vertexai.api.CsvSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.CsvSource(); + } + + public static com.google.cloud.vertexai.api.CsvSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CsvSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.CsvSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvSourceOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvSourceOrBuilder.java new file mode 100644 index 000000000000..f3396847716d --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/CsvSourceOrBuilder.java @@ -0,0 +1,66 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +public interface CsvSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.CsvSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsSource. + */ + com.google.cloud.vertexai.api.GcsSource getGcsSource(); + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DedicatedResources.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DedicatedResources.java new file mode 100644 index 000000000000..044493dae1bc --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DedicatedResources.java @@ -0,0 +1,2084 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A description of resources that are dedicated to a DeployedModel, and
+ * that need a higher degree of manual configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DedicatedResources} + */ +public final class DedicatedResources extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DedicatedResources) + DedicatedResourcesOrBuilder { + private static final long serialVersionUID = 0L; + // Use DedicatedResources.newBuilder() to construct. + private DedicatedResources(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DedicatedResources() { + autoscalingMetricSpecs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DedicatedResources(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_DedicatedResources_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_DedicatedResources_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DedicatedResources.class, + com.google.cloud.vertexai.api.DedicatedResources.Builder.class); + } + + public static final int MACHINE_SPEC_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.MachineSpec machineSpec_; + /** + * + * + *
+   * Required. Immutable. The specification of a single machine used by the
+   * prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the machineSpec field is set. + */ + @java.lang.Override + public boolean hasMachineSpec() { + return machineSpec_ != null; + } + /** + * + * + *
+   * Required. Immutable. The specification of a single machine used by the
+   * prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The machineSpec. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.MachineSpec getMachineSpec() { + return machineSpec_ == null + ? com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance() + : machineSpec_; + } + /** + * + * + *
+   * Required. Immutable. The specification of a single machine used by the
+   * prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.MachineSpecOrBuilder getMachineSpecOrBuilder() { + return machineSpec_ == null + ? com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance() + : machineSpec_; + } + + public static final int MIN_REPLICA_COUNT_FIELD_NUMBER = 2; + private int minReplicaCount_ = 0; + /** + * + * + *
+   * Required. Immutable. The minimum number of machine replicas this
+   * DeployedModel will be always deployed on. This value must be greater than
+   * or equal to 1.
+   *
+   * If traffic against the DeployedModel increases, it may dynamically be
+   * deployed onto more replicas, and as traffic decreases, some of these extra
+   * replicas may be freed.
+   * 
+ * + * + * int32 min_replica_count = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The minReplicaCount. + */ + @java.lang.Override + public int getMinReplicaCount() { + return minReplicaCount_; + } + + public static final int MAX_REPLICA_COUNT_FIELD_NUMBER = 3; + private int maxReplicaCount_ = 0; + /** + * + * + *
+   * Immutable. The maximum number of replicas this DeployedModel may be
+   * deployed on when the traffic against it increases. If the requested value
+   * is too large, the deployment will error, but if deployment succeeds then
+   * the ability to scale the model to that many replicas is guaranteed (barring
+   * service outages). If traffic against the DeployedModel increases beyond
+   * what its replicas at maximum may handle, a portion of the traffic will be
+   * dropped. If this value is not provided, will use
+   * [min_replica_count][google.cloud.vertexai.v1beta1.DedicatedResources.min_replica_count]
+   * as the default value.
+   *
+   * The value of this field impacts the charge against Vertex CPU and GPU
+   * quotas. Specifically, you will be charged for (max_replica_count *
+   * number of cores in the selected machine type) and (max_replica_count *
+   * number of GPUs per replica in the selected machine type).
+   * 
+ * + * int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The maxReplicaCount. + */ + @java.lang.Override + public int getMaxReplicaCount() { + return maxReplicaCount_; + } + + public static final int AUTOSCALING_METRIC_SPECS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List + autoscalingMetricSpecs_; + /** + * + * + *
+   * Immutable. The metric specifications that overrides a resource
+   * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+   * target value (default to 60 if not set). At most one entry is allowed per
+   * metric.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is above 0, the autoscaling will be based on both CPU utilization and
+   * accelerator's duty cycle metrics and scale up when either metrics exceeds
+   * its target value while scale down if both metrics are under their target
+   * value. The default target value is 60 for both metrics.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is 0, the autoscaling will be based on CPU utilization metric only with
+   * default target value 60 if not explicitly set.
+   *
+   * For example, in the case of Online Prediction, if you want to override
+   * target CPU utilization to 80, you should set
+   * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+   * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+   * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+   * to `80`.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.util.List + getAutoscalingMetricSpecsList() { + return autoscalingMetricSpecs_; + } + /** + * + * + *
+   * Immutable. The metric specifications that overrides a resource
+   * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+   * target value (default to 60 if not set). At most one entry is allowed per
+   * metric.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is above 0, the autoscaling will be based on both CPU utilization and
+   * accelerator's duty cycle metrics and scale up when either metrics exceeds
+   * its target value while scale down if both metrics are under their target
+   * value. The default target value is 60 for both metrics.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is 0, the autoscaling will be based on CPU utilization metric only with
+   * default target value 60 if not explicitly set.
+   *
+   * For example, in the case of Online Prediction, if you want to override
+   * target CPU utilization to 80, you should set
+   * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+   * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+   * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+   * to `80`.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.util.List + getAutoscalingMetricSpecsOrBuilderList() { + return autoscalingMetricSpecs_; + } + /** + * + * + *
+   * Immutable. The metric specifications that overrides a resource
+   * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+   * target value (default to 60 if not set). At most one entry is allowed per
+   * metric.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is above 0, the autoscaling will be based on both CPU utilization and
+   * accelerator's duty cycle metrics and scale up when either metrics exceeds
+   * its target value while scale down if both metrics are under their target
+   * value. The default target value is 60 for both metrics.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is 0, the autoscaling will be based on CPU utilization metric only with
+   * default target value 60 if not explicitly set.
+   *
+   * For example, in the case of Online Prediction, if you want to override
+   * target CPU utilization to 80, you should set
+   * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+   * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+   * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+   * to `80`.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public int getAutoscalingMetricSpecsCount() { + return autoscalingMetricSpecs_.size(); + } + /** + * + * + *
+   * Immutable. The metric specifications that overrides a resource
+   * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+   * target value (default to 60 if not set). At most one entry is allowed per
+   * metric.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is above 0, the autoscaling will be based on both CPU utilization and
+   * accelerator's duty cycle metrics and scale up when either metrics exceeds
+   * its target value while scale down if both metrics are under their target
+   * value. The default target value is 60 for both metrics.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is 0, the autoscaling will be based on CPU utilization metric only with
+   * default target value 60 if not explicitly set.
+   *
+   * For example, in the case of Online Prediction, if you want to override
+   * target CPU utilization to 80, you should set
+   * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+   * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+   * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+   * to `80`.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.AutoscalingMetricSpec getAutoscalingMetricSpecs(int index) { + return autoscalingMetricSpecs_.get(index); + } + /** + * + * + *
+   * Immutable. The metric specifications that overrides a resource
+   * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+   * target value (default to 60 if not set). At most one entry is allowed per
+   * metric.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is above 0, the autoscaling will be based on both CPU utilization and
+   * accelerator's duty cycle metrics and scale up when either metrics exceeds
+   * its target value while scale down if both metrics are under their target
+   * value. The default target value is 60 for both metrics.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is 0, the autoscaling will be based on CPU utilization metric only with
+   * default target value 60 if not explicitly set.
+   *
+   * For example, in the case of Online Prediction, if you want to override
+   * target CPU utilization to 80, you should set
+   * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+   * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+   * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+   * to `80`.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.AutoscalingMetricSpecOrBuilder + getAutoscalingMetricSpecsOrBuilder(int index) { + return autoscalingMetricSpecs_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (machineSpec_ != null) { + output.writeMessage(1, getMachineSpec()); + } + if (minReplicaCount_ != 0) { + output.writeInt32(2, minReplicaCount_); + } + if (maxReplicaCount_ != 0) { + output.writeInt32(3, maxReplicaCount_); + } + for (int i = 0; i < autoscalingMetricSpecs_.size(); i++) { + output.writeMessage(4, autoscalingMetricSpecs_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (machineSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMachineSpec()); + } + if (minReplicaCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, minReplicaCount_); + } + if (maxReplicaCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxReplicaCount_); + } + for (int i = 0; i < autoscalingMetricSpecs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, autoscalingMetricSpecs_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DedicatedResources)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DedicatedResources other = + (com.google.cloud.vertexai.api.DedicatedResources) obj; + + if (hasMachineSpec() != other.hasMachineSpec()) return false; + if (hasMachineSpec()) { + if (!getMachineSpec().equals(other.getMachineSpec())) return false; + } + if (getMinReplicaCount() != other.getMinReplicaCount()) return false; + if (getMaxReplicaCount() != other.getMaxReplicaCount()) return false; + if (!getAutoscalingMetricSpecsList().equals(other.getAutoscalingMetricSpecsList())) + return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMachineSpec()) { + hash = (37 * hash) + MACHINE_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getMachineSpec().hashCode(); + } + hash = (37 * hash) + MIN_REPLICA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinReplicaCount(); + hash = (37 * hash) + MAX_REPLICA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxReplicaCount(); + if (getAutoscalingMetricSpecsCount() > 0) { + hash = (37 * hash) + AUTOSCALING_METRIC_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getAutoscalingMetricSpecsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DedicatedResources parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.DedicatedResources prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A description of resources that are dedicated to a DeployedModel, and
+   * that need a higher degree of manual configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DedicatedResources} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DedicatedResources) + com.google.cloud.vertexai.api.DedicatedResourcesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_DedicatedResources_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_DedicatedResources_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DedicatedResources.class, + com.google.cloud.vertexai.api.DedicatedResources.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DedicatedResources.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + machineSpec_ = null; + if (machineSpecBuilder_ != null) { + machineSpecBuilder_.dispose(); + machineSpecBuilder_ = null; + } + minReplicaCount_ = 0; + maxReplicaCount_ = 0; + if (autoscalingMetricSpecsBuilder_ == null) { + autoscalingMetricSpecs_ = java.util.Collections.emptyList(); + } else { + autoscalingMetricSpecs_ = null; + autoscalingMetricSpecsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_DedicatedResources_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DedicatedResources getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DedicatedResources.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DedicatedResources build() { + com.google.cloud.vertexai.api.DedicatedResources result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DedicatedResources buildPartial() { + com.google.cloud.vertexai.api.DedicatedResources result = + new com.google.cloud.vertexai.api.DedicatedResources(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.DedicatedResources result) { + if (autoscalingMetricSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + autoscalingMetricSpecs_ = java.util.Collections.unmodifiableList(autoscalingMetricSpecs_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.autoscalingMetricSpecs_ = autoscalingMetricSpecs_; + } else { + result.autoscalingMetricSpecs_ = autoscalingMetricSpecsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.DedicatedResources result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.machineSpec_ = + machineSpecBuilder_ == null ? machineSpec_ : machineSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.minReplicaCount_ = minReplicaCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maxReplicaCount_ = maxReplicaCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DedicatedResources) { + return mergeFrom((com.google.cloud.vertexai.api.DedicatedResources) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DedicatedResources other) { + if (other == com.google.cloud.vertexai.api.DedicatedResources.getDefaultInstance()) + return this; + if (other.hasMachineSpec()) { + mergeMachineSpec(other.getMachineSpec()); + } + if (other.getMinReplicaCount() != 0) { + setMinReplicaCount(other.getMinReplicaCount()); + } + if (other.getMaxReplicaCount() != 0) { + setMaxReplicaCount(other.getMaxReplicaCount()); + } + if (autoscalingMetricSpecsBuilder_ == null) { + if (!other.autoscalingMetricSpecs_.isEmpty()) { + if (autoscalingMetricSpecs_.isEmpty()) { + autoscalingMetricSpecs_ = other.autoscalingMetricSpecs_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAutoscalingMetricSpecsIsMutable(); + autoscalingMetricSpecs_.addAll(other.autoscalingMetricSpecs_); + } + onChanged(); + } + } else { + if (!other.autoscalingMetricSpecs_.isEmpty()) { + if (autoscalingMetricSpecsBuilder_.isEmpty()) { + autoscalingMetricSpecsBuilder_.dispose(); + autoscalingMetricSpecsBuilder_ = null; + autoscalingMetricSpecs_ = other.autoscalingMetricSpecs_; + bitField0_ = (bitField0_ & ~0x00000008); + autoscalingMetricSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAutoscalingMetricSpecsFieldBuilder() + : null; + } else { + autoscalingMetricSpecsBuilder_.addAllMessages(other.autoscalingMetricSpecs_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getMachineSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + minReplicaCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + maxReplicaCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + com.google.cloud.vertexai.api.AutoscalingMetricSpec m = + input.readMessage( + com.google.cloud.vertexai.api.AutoscalingMetricSpec.parser(), + extensionRegistry); + if (autoscalingMetricSpecsBuilder_ == null) { + ensureAutoscalingMetricSpecsIsMutable(); + autoscalingMetricSpecs_.add(m); + } else { + autoscalingMetricSpecsBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.MachineSpec machineSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.MachineSpec, + com.google.cloud.vertexai.api.MachineSpec.Builder, + com.google.cloud.vertexai.api.MachineSpecOrBuilder> + machineSpecBuilder_; + /** + * + * + *
+     * Required. Immutable. The specification of a single machine used by the
+     * prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the machineSpec field is set. + */ + public boolean hasMachineSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine used by the
+     * prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The machineSpec. + */ + public com.google.cloud.vertexai.api.MachineSpec getMachineSpec() { + if (machineSpecBuilder_ == null) { + return machineSpec_ == null + ? com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance() + : machineSpec_; + } else { + return machineSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine used by the
+     * prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setMachineSpec(com.google.cloud.vertexai.api.MachineSpec value) { + if (machineSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + machineSpec_ = value; + } else { + machineSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine used by the
+     * prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setMachineSpec( + com.google.cloud.vertexai.api.MachineSpec.Builder builderForValue) { + if (machineSpecBuilder_ == null) { + machineSpec_ = builderForValue.build(); + } else { + machineSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine used by the
+     * prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeMachineSpec(com.google.cloud.vertexai.api.MachineSpec value) { + if (machineSpecBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && machineSpec_ != null + && machineSpec_ != com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance()) { + getMachineSpecBuilder().mergeFrom(value); + } else { + machineSpec_ = value; + } + } else { + machineSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine used by the
+     * prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearMachineSpec() { + bitField0_ = (bitField0_ & ~0x00000001); + machineSpec_ = null; + if (machineSpecBuilder_ != null) { + machineSpecBuilder_.dispose(); + machineSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine used by the
+     * prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.vertexai.api.MachineSpec.Builder getMachineSpecBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMachineSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine used by the
+     * prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.vertexai.api.MachineSpecOrBuilder getMachineSpecOrBuilder() { + if (machineSpecBuilder_ != null) { + return machineSpecBuilder_.getMessageOrBuilder(); + } else { + return machineSpec_ == null + ? com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance() + : machineSpec_; + } + } + /** + * + * + *
+     * Required. Immutable. The specification of a single machine used by the
+     * prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.MachineSpec, + com.google.cloud.vertexai.api.MachineSpec.Builder, + com.google.cloud.vertexai.api.MachineSpecOrBuilder> + getMachineSpecFieldBuilder() { + if (machineSpecBuilder_ == null) { + machineSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.MachineSpec, + com.google.cloud.vertexai.api.MachineSpec.Builder, + com.google.cloud.vertexai.api.MachineSpecOrBuilder>( + getMachineSpec(), getParentForChildren(), isClean()); + machineSpec_ = null; + } + return machineSpecBuilder_; + } + + private int minReplicaCount_; + /** + * + * + *
+     * Required. Immutable. The minimum number of machine replicas this
+     * DeployedModel will be always deployed on. This value must be greater than
+     * or equal to 1.
+     *
+     * If traffic against the DeployedModel increases, it may dynamically be
+     * deployed onto more replicas, and as traffic decreases, some of these extra
+     * replicas may be freed.
+     * 
+ * + * + * int32 min_replica_count = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The minReplicaCount. + */ + @java.lang.Override + public int getMinReplicaCount() { + return minReplicaCount_; + } + /** + * + * + *
+     * Required. Immutable. The minimum number of machine replicas this
+     * DeployedModel will be always deployed on. This value must be greater than
+     * or equal to 1.
+     *
+     * If traffic against the DeployedModel increases, it may dynamically be
+     * deployed onto more replicas, and as traffic decreases, some of these extra
+     * replicas may be freed.
+     * 
+ * + * + * int32 min_replica_count = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The minReplicaCount to set. + * @return This builder for chaining. + */ + public Builder setMinReplicaCount(int value) { + + minReplicaCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The minimum number of machine replicas this
+     * DeployedModel will be always deployed on. This value must be greater than
+     * or equal to 1.
+     *
+     * If traffic against the DeployedModel increases, it may dynamically be
+     * deployed onto more replicas, and as traffic decreases, some of these extra
+     * replicas may be freed.
+     * 
+ * + * + * int32 min_replica_count = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearMinReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000002); + minReplicaCount_ = 0; + onChanged(); + return this; + } + + private int maxReplicaCount_; + /** + * + * + *
+     * Immutable. The maximum number of replicas this DeployedModel may be
+     * deployed on when the traffic against it increases. If the requested value
+     * is too large, the deployment will error, but if deployment succeeds then
+     * the ability to scale the model to that many replicas is guaranteed (barring
+     * service outages). If traffic against the DeployedModel increases beyond
+     * what its replicas at maximum may handle, a portion of the traffic will be
+     * dropped. If this value is not provided, will use
+     * [min_replica_count][google.cloud.vertexai.v1beta1.DedicatedResources.min_replica_count]
+     * as the default value.
+     *
+     * The value of this field impacts the charge against Vertex CPU and GPU
+     * quotas. Specifically, you will be charged for (max_replica_count *
+     * number of cores in the selected machine type) and (max_replica_count *
+     * number of GPUs per replica in the selected machine type).
+     * 
+ * + * int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The maxReplicaCount. + */ + @java.lang.Override + public int getMaxReplicaCount() { + return maxReplicaCount_; + } + /** + * + * + *
+     * Immutable. The maximum number of replicas this DeployedModel may be
+     * deployed on when the traffic against it increases. If the requested value
+     * is too large, the deployment will error, but if deployment succeeds then
+     * the ability to scale the model to that many replicas is guaranteed (barring
+     * service outages). If traffic against the DeployedModel increases beyond
+     * what its replicas at maximum may handle, a portion of the traffic will be
+     * dropped. If this value is not provided, will use
+     * [min_replica_count][google.cloud.vertexai.v1beta1.DedicatedResources.min_replica_count]
+     * as the default value.
+     *
+     * The value of this field impacts the charge against Vertex CPU and GPU
+     * quotas. Specifically, you will be charged for (max_replica_count *
+     * number of cores in the selected machine type) and (max_replica_count *
+     * number of GPUs per replica in the selected machine type).
+     * 
+ * + * int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The maxReplicaCount to set. + * @return This builder for chaining. + */ + public Builder setMaxReplicaCount(int value) { + + maxReplicaCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The maximum number of replicas this DeployedModel may be
+     * deployed on when the traffic against it increases. If the requested value
+     * is too large, the deployment will error, but if deployment succeeds then
+     * the ability to scale the model to that many replicas is guaranteed (barring
+     * service outages). If traffic against the DeployedModel increases beyond
+     * what its replicas at maximum may handle, a portion of the traffic will be
+     * dropped. If this value is not provided, will use
+     * [min_replica_count][google.cloud.vertexai.v1beta1.DedicatedResources.min_replica_count]
+     * as the default value.
+     *
+     * The value of this field impacts the charge against Vertex CPU and GPU
+     * quotas. Specifically, you will be charged for (max_replica_count *
+     * number of cores in the selected machine type) and (max_replica_count *
+     * number of GPUs per replica in the selected machine type).
+     * 
+ * + * int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearMaxReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000004); + maxReplicaCount_ = 0; + onChanged(); + return this; + } + + private java.util.List + autoscalingMetricSpecs_ = java.util.Collections.emptyList(); + + private void ensureAutoscalingMetricSpecsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + autoscalingMetricSpecs_ = + new java.util.ArrayList( + autoscalingMetricSpecs_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.AutoscalingMetricSpec, + com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder, + com.google.cloud.vertexai.api.AutoscalingMetricSpecOrBuilder> + autoscalingMetricSpecsBuilder_; + + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List + getAutoscalingMetricSpecsList() { + if (autoscalingMetricSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(autoscalingMetricSpecs_); + } else { + return autoscalingMetricSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public int getAutoscalingMetricSpecsCount() { + if (autoscalingMetricSpecsBuilder_ == null) { + return autoscalingMetricSpecs_.size(); + } else { + return autoscalingMetricSpecsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.vertexai.api.AutoscalingMetricSpec getAutoscalingMetricSpecs( + int index) { + if (autoscalingMetricSpecsBuilder_ == null) { + return autoscalingMetricSpecs_.get(index); + } else { + return autoscalingMetricSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setAutoscalingMetricSpecs( + int index, com.google.cloud.vertexai.api.AutoscalingMetricSpec value) { + if (autoscalingMetricSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAutoscalingMetricSpecsIsMutable(); + autoscalingMetricSpecs_.set(index, value); + onChanged(); + } else { + autoscalingMetricSpecsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setAutoscalingMetricSpecs( + int index, com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder builderForValue) { + if (autoscalingMetricSpecsBuilder_ == null) { + ensureAutoscalingMetricSpecsIsMutable(); + autoscalingMetricSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + autoscalingMetricSpecsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addAutoscalingMetricSpecs( + com.google.cloud.vertexai.api.AutoscalingMetricSpec value) { + if (autoscalingMetricSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAutoscalingMetricSpecsIsMutable(); + autoscalingMetricSpecs_.add(value); + onChanged(); + } else { + autoscalingMetricSpecsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addAutoscalingMetricSpecs( + int index, com.google.cloud.vertexai.api.AutoscalingMetricSpec value) { + if (autoscalingMetricSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAutoscalingMetricSpecsIsMutable(); + autoscalingMetricSpecs_.add(index, value); + onChanged(); + } else { + autoscalingMetricSpecsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addAutoscalingMetricSpecs( + com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder builderForValue) { + if (autoscalingMetricSpecsBuilder_ == null) { + ensureAutoscalingMetricSpecsIsMutable(); + autoscalingMetricSpecs_.add(builderForValue.build()); + onChanged(); + } else { + autoscalingMetricSpecsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addAutoscalingMetricSpecs( + int index, com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder builderForValue) { + if (autoscalingMetricSpecsBuilder_ == null) { + ensureAutoscalingMetricSpecsIsMutable(); + autoscalingMetricSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + autoscalingMetricSpecsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addAllAutoscalingMetricSpecs( + java.lang.Iterable values) { + if (autoscalingMetricSpecsBuilder_ == null) { + ensureAutoscalingMetricSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, autoscalingMetricSpecs_); + onChanged(); + } else { + autoscalingMetricSpecsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearAutoscalingMetricSpecs() { + if (autoscalingMetricSpecsBuilder_ == null) { + autoscalingMetricSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + autoscalingMetricSpecsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder removeAutoscalingMetricSpecs(int index) { + if (autoscalingMetricSpecsBuilder_ == null) { + ensureAutoscalingMetricSpecsIsMutable(); + autoscalingMetricSpecs_.remove(index); + onChanged(); + } else { + autoscalingMetricSpecsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder + getAutoscalingMetricSpecsBuilder(int index) { + return getAutoscalingMetricSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.vertexai.api.AutoscalingMetricSpecOrBuilder + getAutoscalingMetricSpecsOrBuilder(int index) { + if (autoscalingMetricSpecsBuilder_ == null) { + return autoscalingMetricSpecs_.get(index); + } else { + return autoscalingMetricSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List + getAutoscalingMetricSpecsOrBuilderList() { + if (autoscalingMetricSpecsBuilder_ != null) { + return autoscalingMetricSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(autoscalingMetricSpecs_); + } + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder + addAutoscalingMetricSpecsBuilder() { + return getAutoscalingMetricSpecsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.AutoscalingMetricSpec.getDefaultInstance()); + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder + addAutoscalingMetricSpecsBuilder(int index) { + return getAutoscalingMetricSpecsFieldBuilder() + .addBuilder( + index, com.google.cloud.vertexai.api.AutoscalingMetricSpec.getDefaultInstance()); + } + /** + * + * + *
+     * Immutable. The metric specifications that overrides a resource
+     * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+     * target value (default to 60 if not set). At most one entry is allowed per
+     * metric.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is above 0, the autoscaling will be based on both CPU utilization and
+     * accelerator's duty cycle metrics and scale up when either metrics exceeds
+     * its target value while scale down if both metrics are under their target
+     * value. The default target value is 60 for both metrics.
+     *
+     * If
+     * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+     * is 0, the autoscaling will be based on CPU utilization metric only with
+     * default target value 60 if not explicitly set.
+     *
+     * For example, in the case of Online Prediction, if you want to override
+     * target CPU utilization to 80, you should set
+     * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+     * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+     * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+     * to `80`.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List + getAutoscalingMetricSpecsBuilderList() { + return getAutoscalingMetricSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.AutoscalingMetricSpec, + com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder, + com.google.cloud.vertexai.api.AutoscalingMetricSpecOrBuilder> + getAutoscalingMetricSpecsFieldBuilder() { + if (autoscalingMetricSpecsBuilder_ == null) { + autoscalingMetricSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.AutoscalingMetricSpec, + com.google.cloud.vertexai.api.AutoscalingMetricSpec.Builder, + com.google.cloud.vertexai.api.AutoscalingMetricSpecOrBuilder>( + autoscalingMetricSpecs_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + autoscalingMetricSpecs_ = null; + } + return autoscalingMetricSpecsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DedicatedResources) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DedicatedResources) + private static final com.google.cloud.vertexai.api.DedicatedResources DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DedicatedResources(); + } + + public static com.google.cloud.vertexai.api.DedicatedResources getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DedicatedResources parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DedicatedResources getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DedicatedResourcesOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DedicatedResourcesOrBuilder.java new file mode 100644 index 000000000000..57838b54f306 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DedicatedResourcesOrBuilder.java @@ -0,0 +1,290 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +public interface DedicatedResourcesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DedicatedResources) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. The specification of a single machine used by the
+   * prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the machineSpec field is set. + */ + boolean hasMachineSpec(); + /** + * + * + *
+   * Required. Immutable. The specification of a single machine used by the
+   * prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The machineSpec. + */ + com.google.cloud.vertexai.api.MachineSpec getMachineSpec(); + /** + * + * + *
+   * Required. Immutable. The specification of a single machine used by the
+   * prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.MachineSpec machine_spec = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.vertexai.api.MachineSpecOrBuilder getMachineSpecOrBuilder(); + + /** + * + * + *
+   * Required. Immutable. The minimum number of machine replicas this
+   * DeployedModel will be always deployed on. This value must be greater than
+   * or equal to 1.
+   *
+   * If traffic against the DeployedModel increases, it may dynamically be
+   * deployed onto more replicas, and as traffic decreases, some of these extra
+   * replicas may be freed.
+   * 
+ * + * + * int32 min_replica_count = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The minReplicaCount. + */ + int getMinReplicaCount(); + + /** + * + * + *
+   * Immutable. The maximum number of replicas this DeployedModel may be
+   * deployed on when the traffic against it increases. If the requested value
+   * is too large, the deployment will error, but if deployment succeeds then
+   * the ability to scale the model to that many replicas is guaranteed (barring
+   * service outages). If traffic against the DeployedModel increases beyond
+   * what its replicas at maximum may handle, a portion of the traffic will be
+   * dropped. If this value is not provided, will use
+   * [min_replica_count][google.cloud.vertexai.v1beta1.DedicatedResources.min_replica_count]
+   * as the default value.
+   *
+   * The value of this field impacts the charge against Vertex CPU and GPU
+   * quotas. Specifically, you will be charged for (max_replica_count *
+   * number of cores in the selected machine type) and (max_replica_count *
+   * number of GPUs per replica in the selected machine type).
+   * 
+ * + * int32 max_replica_count = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The maxReplicaCount. + */ + int getMaxReplicaCount(); + + /** + * + * + *
+   * Immutable. The metric specifications that overrides a resource
+   * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+   * target value (default to 60 if not set). At most one entry is allowed per
+   * metric.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is above 0, the autoscaling will be based on both CPU utilization and
+   * accelerator's duty cycle metrics and scale up when either metrics exceeds
+   * its target value while scale down if both metrics are under their target
+   * value. The default target value is 60 for both metrics.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is 0, the autoscaling will be based on CPU utilization metric only with
+   * default target value 60 if not explicitly set.
+   *
+   * For example, in the case of Online Prediction, if you want to override
+   * target CPU utilization to 80, you should set
+   * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+   * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+   * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+   * to `80`.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + java.util.List + getAutoscalingMetricSpecsList(); + /** + * + * + *
+   * Immutable. The metric specifications that overrides a resource
+   * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+   * target value (default to 60 if not set). At most one entry is allowed per
+   * metric.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is above 0, the autoscaling will be based on both CPU utilization and
+   * accelerator's duty cycle metrics and scale up when either metrics exceeds
+   * its target value while scale down if both metrics are under their target
+   * value. The default target value is 60 for both metrics.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is 0, the autoscaling will be based on CPU utilization metric only with
+   * default target value 60 if not explicitly set.
+   *
+   * For example, in the case of Online Prediction, if you want to override
+   * target CPU utilization to 80, you should set
+   * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+   * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+   * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+   * to `80`.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.vertexai.api.AutoscalingMetricSpec getAutoscalingMetricSpecs(int index); + /** + * + * + *
+   * Immutable. The metric specifications that overrides a resource
+   * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+   * target value (default to 60 if not set). At most one entry is allowed per
+   * metric.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is above 0, the autoscaling will be based on both CPU utilization and
+   * accelerator's duty cycle metrics and scale up when either metrics exceeds
+   * its target value while scale down if both metrics are under their target
+   * value. The default target value is 60 for both metrics.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is 0, the autoscaling will be based on CPU utilization metric only with
+   * default target value 60 if not explicitly set.
+   *
+   * For example, in the case of Online Prediction, if you want to override
+   * target CPU utilization to 80, you should set
+   * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+   * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+   * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+   * to `80`.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + int getAutoscalingMetricSpecsCount(); + /** + * + * + *
+   * Immutable. The metric specifications that overrides a resource
+   * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+   * target value (default to 60 if not set). At most one entry is allowed per
+   * metric.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is above 0, the autoscaling will be based on both CPU utilization and
+   * accelerator's duty cycle metrics and scale up when either metrics exceeds
+   * its target value while scale down if both metrics are under their target
+   * value. The default target value is 60 for both metrics.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is 0, the autoscaling will be based on CPU utilization metric only with
+   * default target value 60 if not explicitly set.
+   *
+   * For example, in the case of Online Prediction, if you want to override
+   * target CPU utilization to 80, you should set
+   * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+   * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+   * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+   * to `80`.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + java.util.List + getAutoscalingMetricSpecsOrBuilderList(); + /** + * + * + *
+   * Immutable. The metric specifications that overrides a resource
+   * utilization metric (CPU utilization, accelerator's duty cycle, and so on)
+   * target value (default to 60 if not set). At most one entry is allowed per
+   * metric.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is above 0, the autoscaling will be based on both CPU utilization and
+   * accelerator's duty cycle metrics and scale up when either metrics exceeds
+   * its target value while scale down if both metrics are under their target
+   * value. The default target value is 60 for both metrics.
+   *
+   * If
+   * [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]
+   * is 0, the autoscaling will be based on CPU utilization metric only with
+   * default target value 60 if not explicitly set.
+   *
+   * For example, in the case of Online Prediction, if you want to override
+   * target CPU utilization to 80, you should set
+   * [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name]
+   * to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and
+   * [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target]
+   * to `80`.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.AutoscalingMetricSpec autoscaling_metric_specs = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.vertexai.api.AutoscalingMetricSpecOrBuilder getAutoscalingMetricSpecsOrBuilder( + int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteEndpointRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteEndpointRequest.java new file mode 100644 index 000000000000..eee5c81eb8a3 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteEndpointRequest.java @@ -0,0 +1,654 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [EndpointService.DeleteEndpoint][google.cloud.vertexai.v1beta1.EndpointService.DeleteEndpoint].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeleteEndpointRequest} + */ +public final class DeleteEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DeleteEndpointRequest) + DeleteEndpointRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteEndpointRequest.newBuilder() to construct. + private DeleteEndpointRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteEndpointRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteEndpointRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeleteEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeleteEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeleteEndpointRequest.class, + com.google.cloud.vertexai.api.DeleteEndpointRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint resource to be deleted.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint resource to be deleted.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DeleteEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DeleteEndpointRequest other = + (com.google.cloud.vertexai.api.DeleteEndpointRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.DeleteEndpointRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EndpointService.DeleteEndpoint][google.cloud.vertexai.v1beta1.EndpointService.DeleteEndpoint].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeleteEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DeleteEndpointRequest) + com.google.cloud.vertexai.api.DeleteEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeleteEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeleteEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeleteEndpointRequest.class, + com.google.cloud.vertexai.api.DeleteEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DeleteEndpointRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeleteEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeleteEndpointRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DeleteEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeleteEndpointRequest build() { + com.google.cloud.vertexai.api.DeleteEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeleteEndpointRequest buildPartial() { + com.google.cloud.vertexai.api.DeleteEndpointRequest result = + new com.google.cloud.vertexai.api.DeleteEndpointRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.DeleteEndpointRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DeleteEndpointRequest) { + return mergeFrom((com.google.cloud.vertexai.api.DeleteEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DeleteEndpointRequest other) { + if (other == com.google.cloud.vertexai.api.DeleteEndpointRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint resource to be deleted.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint resource to be deleted.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint resource to be deleted.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint resource to be deleted.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint resource to be deleted.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DeleteEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DeleteEndpointRequest) + private static final com.google.cloud.vertexai.api.DeleteEndpointRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DeleteEndpointRequest(); + } + + public static com.google.cloud.vertexai.api.DeleteEndpointRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteEndpointRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeleteEndpointRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteEndpointRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteEndpointRequestOrBuilder.java new file mode 100644 index 000000000000..4f484a83062e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteEndpointRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface DeleteEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DeleteEndpointRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint resource to be deleted.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Endpoint resource to be deleted.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteOperationMetadata.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteOperationMetadata.java new file mode 100644 index 000000000000..e22a6b93f79a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteOperationMetadata.java @@ -0,0 +1,714 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/operation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Details of operations that perform deletes of any entities.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeleteOperationMetadata} + */ +public final class DeleteOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DeleteOperationMetadata) + DeleteOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteOperationMetadata.newBuilder() to construct. + private DeleteOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteOperationMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteOperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.OperationProto + .internal_static_google_cloud_vertexai_v1beta1_DeleteOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.OperationProto + .internal_static_google_cloud_vertexai_v1beta1_DeleteOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeleteOperationMetadata.class, + com.google.cloud.vertexai.api.DeleteOperationMetadata.Builder.class); + } + + public static final int GENERIC_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.GenericOperationMetadata genericMetadata_; + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + @java.lang.Override + public boolean hasGenericMetadata() { + return genericMetadata_ != null; + } + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata() { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (genericMetadata_ != null) { + output.writeMessage(1, getGenericMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (genericMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGenericMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DeleteOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DeleteOperationMetadata other = + (com.google.cloud.vertexai.api.DeleteOperationMetadata) obj; + + if (hasGenericMetadata() != other.hasGenericMetadata()) return false; + if (hasGenericMetadata()) { + if (!getGenericMetadata().equals(other.getGenericMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGenericMetadata()) { + hash = (37 * hash) + GENERIC_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getGenericMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.DeleteOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Details of operations that perform deletes of any entities.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeleteOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DeleteOperationMetadata) + com.google.cloud.vertexai.api.DeleteOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.OperationProto + .internal_static_google_cloud_vertexai_v1beta1_DeleteOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.OperationProto + .internal_static_google_cloud_vertexai_v1beta1_DeleteOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeleteOperationMetadata.class, + com.google.cloud.vertexai.api.DeleteOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DeleteOperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.OperationProto + .internal_static_google_cloud_vertexai_v1beta1_DeleteOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeleteOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DeleteOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeleteOperationMetadata build() { + com.google.cloud.vertexai.api.DeleteOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeleteOperationMetadata buildPartial() { + com.google.cloud.vertexai.api.DeleteOperationMetadata result = + new com.google.cloud.vertexai.api.DeleteOperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.DeleteOperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.genericMetadata_ = + genericMetadataBuilder_ == null ? genericMetadata_ : genericMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DeleteOperationMetadata) { + return mergeFrom((com.google.cloud.vertexai.api.DeleteOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DeleteOperationMetadata other) { + if (other == com.google.cloud.vertexai.api.DeleteOperationMetadata.getDefaultInstance()) + return this; + if (other.hasGenericMetadata()) { + mergeGenericMetadata(other.getGenericMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGenericMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.GenericOperationMetadata genericMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder> + genericMetadataBuilder_; + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + public boolean hasGenericMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + public com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata() { + if (genericMetadataBuilder_ == null) { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } else { + return genericMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + genericMetadata_ = value; + } else { + genericMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder builderForValue) { + if (genericMetadataBuilder_ == null) { + genericMetadata_ = builderForValue.build(); + } else { + genericMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder mergeGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && genericMetadata_ != null + && genericMetadata_ + != com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance()) { + getGenericMetadataBuilder().mergeFrom(value); + } else { + genericMetadata_ = value; + } + } else { + genericMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder clearGenericMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.vertexai.api.GenericOperationMetadata.Builder + getGenericMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGenericMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + if (genericMetadataBuilder_ != null) { + return genericMetadataBuilder_.getMessageOrBuilder(); + } else { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + } + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder> + getGenericMetadataFieldBuilder() { + if (genericMetadataBuilder_ == null) { + genericMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder>( + getGenericMetadata(), getParentForChildren(), isClean()); + genericMetadata_ = null; + } + return genericMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DeleteOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DeleteOperationMetadata) + private static final com.google.cloud.vertexai.api.DeleteOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DeleteOperationMetadata(); + } + + public static com.google.cloud.vertexai.api.DeleteOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeleteOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteOperationMetadataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..52a596cc513a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeleteOperationMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/operation.proto + +package com.google.cloud.vertexai.api; + +public interface DeleteOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DeleteOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + boolean hasGenericMetadata(); + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata(); + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder getGenericMetadataOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelOperationMetadata.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelOperationMetadata.java new file mode 100644 index 000000000000..870f1d3db8d2 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelOperationMetadata.java @@ -0,0 +1,716 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Runtime operation information for
+ * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeployModelOperationMetadata} + */ +public final class DeployModelOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DeployModelOperationMetadata) + DeployModelOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployModelOperationMetadata.newBuilder() to construct. + private DeployModelOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployModelOperationMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployModelOperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeployModelOperationMetadata.class, + com.google.cloud.vertexai.api.DeployModelOperationMetadata.Builder.class); + } + + public static final int GENERIC_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.GenericOperationMetadata genericMetadata_; + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + @java.lang.Override + public boolean hasGenericMetadata() { + return genericMetadata_ != null; + } + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata() { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (genericMetadata_ != null) { + output.writeMessage(1, getGenericMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (genericMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGenericMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DeployModelOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DeployModelOperationMetadata other = + (com.google.cloud.vertexai.api.DeployModelOperationMetadata) obj; + + if (hasGenericMetadata() != other.hasGenericMetadata()) return false; + if (hasGenericMetadata()) { + if (!getGenericMetadata().equals(other.getGenericMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGenericMetadata()) { + hash = (37 * hash) + GENERIC_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getGenericMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.DeployModelOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeployModelOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DeployModelOperationMetadata) + com.google.cloud.vertexai.api.DeployModelOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeployModelOperationMetadata.class, + com.google.cloud.vertexai.api.DeployModelOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DeployModelOperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DeployModelOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelOperationMetadata build() { + com.google.cloud.vertexai.api.DeployModelOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelOperationMetadata buildPartial() { + com.google.cloud.vertexai.api.DeployModelOperationMetadata result = + new com.google.cloud.vertexai.api.DeployModelOperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.DeployModelOperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.genericMetadata_ = + genericMetadataBuilder_ == null ? genericMetadata_ : genericMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DeployModelOperationMetadata) { + return mergeFrom((com.google.cloud.vertexai.api.DeployModelOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DeployModelOperationMetadata other) { + if (other == com.google.cloud.vertexai.api.DeployModelOperationMetadata.getDefaultInstance()) + return this; + if (other.hasGenericMetadata()) { + mergeGenericMetadata(other.getGenericMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGenericMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.GenericOperationMetadata genericMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder> + genericMetadataBuilder_; + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + public boolean hasGenericMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + public com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata() { + if (genericMetadataBuilder_ == null) { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } else { + return genericMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + genericMetadata_ = value; + } else { + genericMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder builderForValue) { + if (genericMetadataBuilder_ == null) { + genericMetadata_ = builderForValue.build(); + } else { + genericMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder mergeGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && genericMetadata_ != null + && genericMetadata_ + != com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance()) { + getGenericMetadataBuilder().mergeFrom(value); + } else { + genericMetadata_ = value; + } + } else { + genericMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder clearGenericMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.vertexai.api.GenericOperationMetadata.Builder + getGenericMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGenericMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + if (genericMetadataBuilder_ != null) { + return genericMetadataBuilder_.getMessageOrBuilder(); + } else { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder> + getGenericMetadataFieldBuilder() { + if (genericMetadataBuilder_ == null) { + genericMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder>( + getGenericMetadata(), getParentForChildren(), isClean()); + genericMetadata_ = null; + } + return genericMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DeployModelOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DeployModelOperationMetadata) + private static final com.google.cloud.vertexai.api.DeployModelOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DeployModelOperationMetadata(); + } + + public static com.google.cloud.vertexai.api.DeployModelOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployModelOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelOperationMetadataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..e3a13e53faf9 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelOperationMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface DeployModelOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DeployModelOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + boolean hasGenericMetadata(); + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata(); + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder getGenericMetadataOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelRequest.java new file mode 100644 index 000000000000..a56f609d24a5 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelRequest.java @@ -0,0 +1,1453 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeployModelRequest} + */ +public final class DeployModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DeployModelRequest) + DeployModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployModelRequest.newBuilder() to construct. + private DeployModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployModelRequest() { + endpoint_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployModelRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetTrafficSplit(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeployModelRequest.class, + com.google.cloud.vertexai.api.DeployModelRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint resource into which to deploy a Model.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint resource into which to deploy a Model.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPLOYED_MODEL_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.DeployedModel 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].
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployedModel field is set. + */ + @java.lang.Override + public boolean hasDeployedModel() { + return deployedModel_ != null; + } + /** + * + * + *
+   * 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].
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployedModel. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModel getDeployedModel() { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : 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].
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder() { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } + + public static final int TRAFFIC_SPLIT_FIELD_NUMBER = 3; + + private static final class TrafficSplitDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_TrafficSplitEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField trafficSplit_; + + private com.google.protobuf.MapField + internalGetTrafficSplit() { + if (trafficSplit_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TrafficSplitDefaultEntryHolder.defaultEntry); + } + return trafficSplit_; + } + + public int getTrafficSplitCount() { + return internalGetTrafficSplit().getMap().size(); + } + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public boolean containsTrafficSplit(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTrafficSplit().getMap().containsKey(key); + } + /** Use {@link #getTrafficSplitMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTrafficSplit() { + return getTrafficSplitMap(); + } + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public java.util.Map getTrafficSplitMap() { + return internalGetTrafficSplit().getMap(); + } + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public int getTrafficSplitOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public int getTrafficSplitOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + if (deployedModel_ != null) { + output.writeMessage(2, getDeployedModel()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetTrafficSplit(), TrafficSplitDefaultEntryHolder.defaultEntry, 3); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + if (deployedModel_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDeployedModel()); + } + for (java.util.Map.Entry entry : + internalGetTrafficSplit().getMap().entrySet()) { + com.google.protobuf.MapEntry trafficSplit__ = + TrafficSplitDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, trafficSplit__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DeployModelRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DeployModelRequest other = + (com.google.cloud.vertexai.api.DeployModelRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (hasDeployedModel() != other.hasDeployedModel()) return false; + if (hasDeployedModel()) { + if (!getDeployedModel().equals(other.getDeployedModel())) return false; + } + if (!internalGetTrafficSplit().equals(other.internalGetTrafficSplit())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + if (hasDeployedModel()) { + hash = (37 * hash) + DEPLOYED_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getDeployedModel().hashCode(); + } + if (!internalGetTrafficSplit().getMap().isEmpty()) { + hash = (37 * hash) + TRAFFIC_SPLIT_FIELD_NUMBER; + hash = (53 * hash) + internalGetTrafficSplit().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.DeployModelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeployModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DeployModelRequest) + com.google.cloud.vertexai.api.DeployModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetTrafficSplit(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 3: + return internalGetMutableTrafficSplit(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeployModelRequest.class, + com.google.cloud.vertexai.api.DeployModelRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DeployModelRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + deployedModel_ = null; + if (deployedModelBuilder_ != null) { + deployedModelBuilder_.dispose(); + deployedModelBuilder_ = null; + } + internalGetMutableTrafficSplit().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DeployModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelRequest build() { + com.google.cloud.vertexai.api.DeployModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelRequest buildPartial() { + com.google.cloud.vertexai.api.DeployModelRequest result = + new com.google.cloud.vertexai.api.DeployModelRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.DeployModelRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deployedModel_ = + deployedModelBuilder_ == null ? deployedModel_ : deployedModelBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.trafficSplit_ = internalGetTrafficSplit(); + result.trafficSplit_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DeployModelRequest) { + return mergeFrom((com.google.cloud.vertexai.api.DeployModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DeployModelRequest other) { + if (other == com.google.cloud.vertexai.api.DeployModelRequest.getDefaultInstance()) + return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasDeployedModel()) { + mergeDeployedModel(other.getDeployedModel()); + } + internalGetMutableTrafficSplit().mergeFrom(other.internalGetTrafficSplit()); + bitField0_ |= 0x00000004; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDeployedModelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry trafficSplit__ = + input.readMessage( + TrafficSplitDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableTrafficSplit() + .getMutableMap() + .put(trafficSplit__.getKey(), trafficSplit__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint resource into which to deploy a Model.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint resource into which to deploy a Model.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint resource into which to deploy a Model.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint resource into which to deploy a Model.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint resource into which to deploy a Model.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.DeployedModel deployedModel_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder> + deployedModelBuilder_; + /** + * + * + *
+     * 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].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployedModel field is set. + */ + public boolean hasDeployedModel() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployedModel. + */ + public com.google.cloud.vertexai.api.DeployedModel getDeployedModel() { + if (deployedModelBuilder_ == null) { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } else { + return deployedModelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDeployedModel(com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deployedModel_ = value; + } else { + deployedModelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDeployedModel( + com.google.cloud.vertexai.api.DeployedModel.Builder builderForValue) { + if (deployedModelBuilder_ == null) { + deployedModel_ = builderForValue.build(); + } else { + deployedModelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDeployedModel(com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && deployedModel_ != null + && deployedModel_ != com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance()) { + getDeployedModelBuilder().mergeFrom(value); + } else { + deployedModel_ = value; + } + } else { + deployedModelBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDeployedModel() { + bitField0_ = (bitField0_ & ~0x00000002); + deployedModel_ = null; + if (deployedModelBuilder_ != null) { + deployedModelBuilder_.dispose(); + deployedModelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.DeployedModel.Builder getDeployedModelBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDeployedModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder() { + if (deployedModelBuilder_ != null) { + return deployedModelBuilder_.getMessageOrBuilder(); + } else { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : 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].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder> + getDeployedModelFieldBuilder() { + if (deployedModelBuilder_ == null) { + deployedModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder>( + getDeployedModel(), getParentForChildren(), isClean()); + deployedModel_ = null; + } + return deployedModelBuilder_; + } + + private com.google.protobuf.MapField trafficSplit_; + + private com.google.protobuf.MapField + internalGetTrafficSplit() { + if (trafficSplit_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TrafficSplitDefaultEntryHolder.defaultEntry); + } + return trafficSplit_; + } + + private com.google.protobuf.MapField + internalGetMutableTrafficSplit() { + if (trafficSplit_ == null) { + trafficSplit_ = + com.google.protobuf.MapField.newMapField(TrafficSplitDefaultEntryHolder.defaultEntry); + } + if (!trafficSplit_.isMutable()) { + trafficSplit_ = trafficSplit_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return trafficSplit_; + } + + public int getTrafficSplitCount() { + return internalGetTrafficSplit().getMap().size(); + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public boolean containsTrafficSplit(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTrafficSplit().getMap().containsKey(key); + } + /** Use {@link #getTrafficSplitMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTrafficSplit() { + return getTrafficSplitMap(); + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public java.util.Map getTrafficSplitMap() { + return internalGetTrafficSplit().getMap(); + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public int getTrafficSplitOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public int getTrafficSplitOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTrafficSplit() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableTrafficSplit().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + public Builder removeTrafficSplit(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTrafficSplit().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableTrafficSplit() { + bitField0_ |= 0x00000004; + return internalGetMutableTrafficSplit().getMutableMap(); + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + public Builder putTrafficSplit(java.lang.String key, int value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableTrafficSplit().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + public Builder putAllTrafficSplit(java.util.Map values) { + internalGetMutableTrafficSplit().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DeployModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DeployModelRequest) + private static final com.google.cloud.vertexai.api.DeployModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DeployModelRequest(); + } + + public static com.google.cloud.vertexai.api.DeployModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelRequestOrBuilder.java new file mode 100644 index 000000000000..b205bf1c1fb3 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelRequestOrBuilder.java @@ -0,0 +1,225 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface DeployModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DeployModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint resource into which to deploy a Model.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint resource into which to deploy a Model.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * 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].
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployedModel field is set. + */ + boolean hasDeployedModel(); + /** + * + * + *
+   * 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].
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployedModel. + */ + com.google.cloud.vertexai.api.DeployedModel getDeployedModel(); + /** + * + * + *
+   * 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].
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder(); + + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + int getTrafficSplitCount(); + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + boolean containsTrafficSplit(java.lang.String key); + /** Use {@link #getTrafficSplitMap()} instead. */ + @java.lang.Deprecated + java.util.Map getTrafficSplit(); + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + java.util.Map getTrafficSplitMap(); + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + int getTrafficSplitOrDefault(java.lang.String key, int defaultValue); + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + int getTrafficSplitOrThrow(java.lang.String key); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelResponse.java new file mode 100644 index 000000000000..23a066ff4057 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelResponse.java @@ -0,0 +1,709 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeployModelResponse} + */ +public final class DeployModelResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DeployModelResponse) + DeployModelResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployModelResponse.newBuilder() to construct. + private DeployModelResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployModelResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployModelResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeployModelResponse.class, + com.google.cloud.vertexai.api.DeployModelResponse.Builder.class); + } + + public static final int DEPLOYED_MODEL_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.DeployedModel deployedModel_; + /** + * + * + *
+   * The DeployedModel that had been deployed in the Endpoint.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return Whether the deployedModel field is set. + */ + @java.lang.Override + public boolean hasDeployedModel() { + return deployedModel_ != null; + } + /** + * + * + *
+   * The DeployedModel that had been deployed in the Endpoint.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return The deployedModel. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModel getDeployedModel() { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } + /** + * + * + *
+   * The DeployedModel that had been deployed in the Endpoint.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder() { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (deployedModel_ != null) { + output.writeMessage(1, getDeployedModel()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (deployedModel_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDeployedModel()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DeployModelResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DeployModelResponse other = + (com.google.cloud.vertexai.api.DeployModelResponse) obj; + + if (hasDeployedModel() != other.hasDeployedModel()) return false; + if (hasDeployedModel()) { + if (!getDeployedModel().equals(other.getDeployedModel())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDeployedModel()) { + hash = (37 * hash) + DEPLOYED_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getDeployedModel().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.DeployModelResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeployModelResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DeployModelResponse) + com.google.cloud.vertexai.api.DeployModelResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeployModelResponse.class, + com.google.cloud.vertexai.api.DeployModelResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DeployModelResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + deployedModel_ = null; + if (deployedModelBuilder_ != null) { + deployedModelBuilder_.dispose(); + deployedModelBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DeployModelResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DeployModelResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelResponse build() { + com.google.cloud.vertexai.api.DeployModelResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelResponse buildPartial() { + com.google.cloud.vertexai.api.DeployModelResponse result = + new com.google.cloud.vertexai.api.DeployModelResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.DeployModelResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.deployedModel_ = + deployedModelBuilder_ == null ? deployedModel_ : deployedModelBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DeployModelResponse) { + return mergeFrom((com.google.cloud.vertexai.api.DeployModelResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DeployModelResponse other) { + if (other == com.google.cloud.vertexai.api.DeployModelResponse.getDefaultInstance()) + return this; + if (other.hasDeployedModel()) { + mergeDeployedModel(other.getDeployedModel()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDeployedModelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.DeployedModel deployedModel_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder> + deployedModelBuilder_; + /** + * + * + *
+     * The DeployedModel that had been deployed in the Endpoint.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return Whether the deployedModel field is set. + */ + public boolean hasDeployedModel() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The DeployedModel that had been deployed in the Endpoint.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return The deployedModel. + */ + public com.google.cloud.vertexai.api.DeployedModel getDeployedModel() { + if (deployedModelBuilder_ == null) { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } else { + return deployedModelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The DeployedModel that had been deployed in the Endpoint.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public Builder setDeployedModel(com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deployedModel_ = value; + } else { + deployedModelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The DeployedModel that had been deployed in the Endpoint.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public Builder setDeployedModel( + com.google.cloud.vertexai.api.DeployedModel.Builder builderForValue) { + if (deployedModelBuilder_ == null) { + deployedModel_ = builderForValue.build(); + } else { + deployedModelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The DeployedModel that had been deployed in the Endpoint.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public Builder mergeDeployedModel(com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && deployedModel_ != null + && deployedModel_ != com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance()) { + getDeployedModelBuilder().mergeFrom(value); + } else { + deployedModel_ = value; + } + } else { + deployedModelBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The DeployedModel that had been deployed in the Endpoint.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public Builder clearDeployedModel() { + bitField0_ = (bitField0_ & ~0x00000001); + deployedModel_ = null; + if (deployedModelBuilder_ != null) { + deployedModelBuilder_.dispose(); + deployedModelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The DeployedModel that had been deployed in the Endpoint.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public com.google.cloud.vertexai.api.DeployedModel.Builder getDeployedModelBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDeployedModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The DeployedModel that had been deployed in the Endpoint.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder() { + if (deployedModelBuilder_ != null) { + return deployedModelBuilder_.getMessageOrBuilder(); + } else { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } + } + /** + * + * + *
+     * The DeployedModel that had been deployed in the Endpoint.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder> + getDeployedModelFieldBuilder() { + if (deployedModelBuilder_ == null) { + deployedModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder>( + getDeployedModel(), getParentForChildren(), isClean()); + deployedModel_ = null; + } + return deployedModelBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DeployModelResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DeployModelResponse) + private static final com.google.cloud.vertexai.api.DeployModelResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DeployModelResponse(); + } + + public static com.google.cloud.vertexai.api.DeployModelResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployModelResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployModelResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelResponseOrBuilder.java new file mode 100644 index 000000000000..d5c95960aa1d --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployModelResponseOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface DeployModelResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DeployModelResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The DeployedModel that had been deployed in the Endpoint.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return Whether the deployedModel field is set. + */ + boolean hasDeployedModel(); + /** + * + * + *
+   * The DeployedModel that had been deployed in the Endpoint.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return The deployedModel. + */ + com.google.cloud.vertexai.api.DeployedModel getDeployedModel(); + /** + * + * + *
+   * The DeployedModel that had been deployed in the Endpoint.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployedModel.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployedModel.java new file mode 100644 index 000000000000..2ca8c9aebbe5 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployedModel.java @@ -0,0 +1,3859 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A deployment of a Model. Endpoints contain one or more DeployedModels.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeployedModel} + */ +public final class DeployedModel extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DeployedModel) + DeployedModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeployedModel.newBuilder() to construct. + private DeployedModel(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeployedModel() { + id_ = ""; + model_ = ""; + modelVersionId_ = ""; + displayName_ = ""; + serviceAccount_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeployedModel(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_DeployedModel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_DeployedModel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeployedModel.class, + com.google.cloud.vertexai.api.DeployedModel.Builder.class); + } + + private int predictionResourcesCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object predictionResources_; + + public enum PredictionResourcesCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DEDICATED_RESOURCES(7), + AUTOMATIC_RESOURCES(8), + SHARED_RESOURCES(17), + PREDICTIONRESOURCES_NOT_SET(0); + private final int value; + + private PredictionResourcesCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PredictionResourcesCase valueOf(int value) { + return forNumber(value); + } + + public static PredictionResourcesCase forNumber(int value) { + switch (value) { + case 7: + return DEDICATED_RESOURCES; + case 8: + return AUTOMATIC_RESOURCES; + case 17: + return SHARED_RESOURCES; + case 0: + return PREDICTIONRESOURCES_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PredictionResourcesCase getPredictionResourcesCase() { + return PredictionResourcesCase.forNumber(predictionResourcesCase_); + } + + public static final int DEDICATED_RESOURCES_FIELD_NUMBER = 7; + /** + * + * + *
+   * A description of resources that are dedicated to the DeployedModel, and
+   * that need a higher degree of manual configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + * + * @return Whether the dedicatedResources field is set. + */ + @java.lang.Override + public boolean hasDedicatedResources() { + return predictionResourcesCase_ == 7; + } + /** + * + * + *
+   * A description of resources that are dedicated to the DeployedModel, and
+   * that need a higher degree of manual configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + * + * @return The dedicatedResources. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DedicatedResources getDedicatedResources() { + if (predictionResourcesCase_ == 7) { + return (com.google.cloud.vertexai.api.DedicatedResources) predictionResources_; + } + return com.google.cloud.vertexai.api.DedicatedResources.getDefaultInstance(); + } + /** + * + * + *
+   * A description of resources that are dedicated to the DeployedModel, and
+   * that need a higher degree of manual configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DedicatedResourcesOrBuilder + getDedicatedResourcesOrBuilder() { + if (predictionResourcesCase_ == 7) { + return (com.google.cloud.vertexai.api.DedicatedResources) predictionResources_; + } + return com.google.cloud.vertexai.api.DedicatedResources.getDefaultInstance(); + } + + public static final int AUTOMATIC_RESOURCES_FIELD_NUMBER = 8; + /** + * + * + *
+   * A description of resources that to large degree are decided by Vertex
+   * AI, and require only a modest additional configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + * + * @return Whether the automaticResources field is set. + */ + @java.lang.Override + public boolean hasAutomaticResources() { + return predictionResourcesCase_ == 8; + } + /** + * + * + *
+   * A description of resources that to large degree are decided by Vertex
+   * AI, and require only a modest additional configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + * + * @return The automaticResources. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.AutomaticResources getAutomaticResources() { + if (predictionResourcesCase_ == 8) { + return (com.google.cloud.vertexai.api.AutomaticResources) predictionResources_; + } + return com.google.cloud.vertexai.api.AutomaticResources.getDefaultInstance(); + } + /** + * + * + *
+   * A description of resources that to large degree are decided by Vertex
+   * AI, and require only a modest additional configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.AutomaticResourcesOrBuilder + getAutomaticResourcesOrBuilder() { + if (predictionResourcesCase_ == 8) { + return (com.google.cloud.vertexai.api.AutomaticResources) predictionResources_; + } + return com.google.cloud.vertexai.api.AutomaticResources.getDefaultInstance(); + } + + public static final int SHARED_RESOURCES_FIELD_NUMBER = 17; + /** + * + * + *
+   * The resource name of the shared DeploymentResourcePool to deploy on.
+   * Format:
+   * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+   * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sharedResources field is set. + */ + public boolean hasSharedResources() { + return predictionResourcesCase_ == 17; + } + /** + * + * + *
+   * The resource name of the shared DeploymentResourcePool to deploy on.
+   * Format:
+   * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+   * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @return The sharedResources. + */ + public java.lang.String getSharedResources() { + java.lang.Object ref = ""; + if (predictionResourcesCase_ == 17) { + ref = predictionResources_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (predictionResourcesCase_ == 17) { + predictionResources_ = s; + } + return s; + } + } + /** + * + * + *
+   * The resource name of the shared DeploymentResourcePool to deploy on.
+   * Format:
+   * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+   * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sharedResources. + */ + public com.google.protobuf.ByteString getSharedResourcesBytes() { + java.lang.Object ref = ""; + if (predictionResourcesCase_ == 17) { + ref = predictionResources_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (predictionResourcesCase_ == 17) { + predictionResources_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+   * Immutable. The ID of the DeployedModel. If not provided upon deployment,
+   * Vertex AI will generate a value for this ID.
+   *
+   * This value should be 1-10 characters, and valid characters are `/[0-9]/`.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The ID of the DeployedModel. If not provided upon deployment,
+   * Vertex AI will generate a value for this ID.
+   *
+   * This value should be 1-10 characters, and valid characters are `/[0-9]/`.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object model_ = ""; + /** + * + * + *
+   * Required. The resource name of the Model that this is the deployment of.
+   * Note that the Model may be in a different location than the DeployedModel's
+   * Endpoint.
+   *
+   * The resource name may contain version id or version alias to specify the
+   * version.
+   *  Example: `projects/{project}/locations/{location}/models/{model}@2`
+   *              or
+   *            `projects/{project}/locations/{location}/models/{model}@golden`
+   * if no version is specified, the default version will be deployed.
+   * 
+ * + * + * string model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Model that this is the deployment of.
+   * Note that the Model may be in a different location than the DeployedModel's
+   * Endpoint.
+   *
+   * The resource name may contain version id or version alias to specify the
+   * version.
+   *  Example: `projects/{project}/locations/{location}/models/{model}@2`
+   *              or
+   *            `projects/{project}/locations/{location}/models/{model}@golden`
+   * if no version is specified, the default version will be deployed.
+   * 
+ * + * + * string model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_VERSION_ID_FIELD_NUMBER = 18; + + @SuppressWarnings("serial") + private volatile java.lang.Object modelVersionId_ = ""; + /** + * + * + *
+   * Output only. The version ID of the model that is deployed.
+   * 
+ * + * string model_version_id = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The modelVersionId. + */ + @java.lang.Override + public java.lang.String getModelVersionId() { + java.lang.Object ref = modelVersionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelVersionId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The version ID of the model that is deployed.
+   * 
+ * + * string model_version_id = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for modelVersionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelVersionIdBytes() { + java.lang.Object ref = modelVersionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelVersionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * The display name of the DeployedModel. If not provided upon creation,
+   * the Model's display_name is used.
+   * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of the DeployedModel. If not provided upon creation,
+   * the Model's display_name is used.
+   * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Timestamp when the DeployedModel was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the DeployedModel was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Timestamp when the DeployedModel was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int EXPLANATION_SPEC_FIELD_NUMBER = 9; + private com.google.cloud.vertexai.api.ExplanationSpec explanationSpec_; + /** + * + * + *
+   * Explanation configuration for this DeployedModel.
+   *
+   * When deploying a Model using
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+   * this value overrides the value of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+   * All fields of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * are optional in the request. If a field of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * is not populated, the value of the same field of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is inherited. If the corresponding
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is not populated, all fields of the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * will be used for the explanation configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + * + * @return Whether the explanationSpec field is set. + */ + @java.lang.Override + public boolean hasExplanationSpec() { + return explanationSpec_ != null; + } + /** + * + * + *
+   * Explanation configuration for this DeployedModel.
+   *
+   * When deploying a Model using
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+   * this value overrides the value of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+   * All fields of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * are optional in the request. If a field of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * is not populated, the value of the same field of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is inherited. If the corresponding
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is not populated, all fields of the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * will be used for the explanation configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + * + * @return The explanationSpec. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpec getExplanationSpec() { + return explanationSpec_ == null + ? com.google.cloud.vertexai.api.ExplanationSpec.getDefaultInstance() + : explanationSpec_; + } + /** + * + * + *
+   * Explanation configuration for this DeployedModel.
+   *
+   * When deploying a Model using
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+   * this value overrides the value of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+   * All fields of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * are optional in the request. If a field of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * is not populated, the value of the same field of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is inherited. If the corresponding
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is not populated, all fields of the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * will be used for the explanation configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpecOrBuilder getExplanationSpecOrBuilder() { + return explanationSpec_ == null + ? com.google.cloud.vertexai.api.ExplanationSpec.getDefaultInstance() + : explanationSpec_; + } + + public static final int DISABLE_EXPLANATIONS_FIELD_NUMBER = 19; + private boolean disableExplanations_ = false; + /** + * + * + *
+   * If true, deploy the model without explainable feature, regardless the
+   * existence of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * or
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec].
+   * 
+ * + * bool disable_explanations = 19; + * + * @return The disableExplanations. + */ + @java.lang.Override + public boolean getDisableExplanations() { + return disableExplanations_; + } + + public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAccount_ = ""; + /** + * + * + *
+   * The service account that the DeployedModel's container runs as. Specify the
+   * email address of the service account. If this service account is not
+   * specified, the container runs as a service account that doesn't have access
+   * to the resource project.
+   *
+   * Users deploying the Model must have the `iam.serviceAccounts.actAs`
+   * permission on this service account.
+   * 
+ * + * string service_account = 11; + * + * @return The serviceAccount. + */ + @java.lang.Override + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } + } + /** + * + * + *
+   * The service account that the DeployedModel's container runs as. Specify the
+   * email address of the service account. If this service account is not
+   * specified, the container runs as a service account that doesn't have access
+   * to the resource project.
+   *
+   * Users deploying the Model must have the `iam.serviceAccounts.actAs`
+   * permission on this service account.
+   * 
+ * + * string service_account = 11; + * + * @return The bytes for serviceAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_CONTAINER_LOGGING_FIELD_NUMBER = 12; + private boolean enableContainerLogging_ = false; + /** + * + * + *
+   * If true, the container of the DeployedModel instances will send `stderr`
+   * and `stdout` streams to Cloud Logging.
+   *
+   * Only supported for custom-trained Models and AutoML Tabular Models.
+   * 
+ * + * bool enable_container_logging = 12; + * + * @return The enableContainerLogging. + */ + @java.lang.Override + public boolean getEnableContainerLogging() { + return enableContainerLogging_; + } + + public static final int ENABLE_ACCESS_LOGGING_FIELD_NUMBER = 13; + private boolean enableAccessLogging_ = false; + /** + * + * + *
+   * If true, online prediction access logs are sent to Cloud
+   * Logging.
+   * These logs are like standard server access logs, containing
+   * information like timestamp and latency for each prediction request.
+   *
+   * Note that logs may incur a cost, especially if your project
+   * receives prediction requests at a high queries per second rate (QPS).
+   * Estimate your costs before enabling this option.
+   * 
+ * + * bool enable_access_logging = 13; + * + * @return The enableAccessLogging. + */ + @java.lang.Override + public boolean getEnableAccessLogging() { + return enableAccessLogging_; + } + + public static final int PRIVATE_ENDPOINTS_FIELD_NUMBER = 14; + private com.google.cloud.vertexai.api.PrivateEndpoints privateEndpoints_; + /** + * + * + *
+   * Output only. Provide paths for users to send predict/explain/health
+   * requests directly to the deployed model services running on Cloud via
+   * private services access. This field is populated if
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the privateEndpoints field is set. + */ + @java.lang.Override + public boolean hasPrivateEndpoints() { + return privateEndpoints_ != null; + } + /** + * + * + *
+   * Output only. Provide paths for users to send predict/explain/health
+   * requests directly to the deployed model services running on Cloud via
+   * private services access. This field is populated if
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The privateEndpoints. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.PrivateEndpoints getPrivateEndpoints() { + return privateEndpoints_ == null + ? com.google.cloud.vertexai.api.PrivateEndpoints.getDefaultInstance() + : privateEndpoints_; + } + /** + * + * + *
+   * Output only. Provide paths for users to send predict/explain/health
+   * requests directly to the deployed model services running on Cloud via
+   * private services access. This field is populated if
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.PrivateEndpointsOrBuilder getPrivateEndpointsOrBuilder() { + return privateEndpoints_ == null + ? com.google.cloud.vertexai.api.PrivateEndpoints.getDefaultInstance() + : privateEndpoints_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, model_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); + } + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (predictionResourcesCase_ == 7) { + output.writeMessage( + 7, (com.google.cloud.vertexai.api.DedicatedResources) predictionResources_); + } + if (predictionResourcesCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.vertexai.api.AutomaticResources) predictionResources_); + } + if (explanationSpec_ != null) { + output.writeMessage(9, getExplanationSpec()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, serviceAccount_); + } + if (enableContainerLogging_ != false) { + output.writeBool(12, enableContainerLogging_); + } + if (enableAccessLogging_ != false) { + output.writeBool(13, enableAccessLogging_); + } + if (privateEndpoints_ != null) { + output.writeMessage(14, getPrivateEndpoints()); + } + if (predictionResourcesCase_ == 17) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, predictionResources_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelVersionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, modelVersionId_); + } + if (disableExplanations_ != false) { + output.writeBool(19, disableExplanations_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, model_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (predictionResourcesCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.vertexai.api.DedicatedResources) predictionResources_); + } + if (predictionResourcesCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.vertexai.api.AutomaticResources) predictionResources_); + } + if (explanationSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getExplanationSpec()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, serviceAccount_); + } + if (enableContainerLogging_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, enableContainerLogging_); + } + if (enableAccessLogging_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, enableAccessLogging_); + } + if (privateEndpoints_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getPrivateEndpoints()); + } + if (predictionResourcesCase_ == 17) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, predictionResources_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelVersionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, modelVersionId_); + } + if (disableExplanations_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(19, disableExplanations_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DeployedModel)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DeployedModel other = + (com.google.cloud.vertexai.api.DeployedModel) obj; + + if (!getId().equals(other.getId())) return false; + if (!getModel().equals(other.getModel())) return false; + if (!getModelVersionId().equals(other.getModelVersionId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasExplanationSpec() != other.hasExplanationSpec()) return false; + if (hasExplanationSpec()) { + if (!getExplanationSpec().equals(other.getExplanationSpec())) return false; + } + if (getDisableExplanations() != other.getDisableExplanations()) return false; + if (!getServiceAccount().equals(other.getServiceAccount())) return false; + if (getEnableContainerLogging() != other.getEnableContainerLogging()) return false; + if (getEnableAccessLogging() != other.getEnableAccessLogging()) return false; + if (hasPrivateEndpoints() != other.hasPrivateEndpoints()) return false; + if (hasPrivateEndpoints()) { + if (!getPrivateEndpoints().equals(other.getPrivateEndpoints())) return false; + } + if (!getPredictionResourcesCase().equals(other.getPredictionResourcesCase())) return false; + switch (predictionResourcesCase_) { + case 7: + if (!getDedicatedResources().equals(other.getDedicatedResources())) return false; + break; + case 8: + if (!getAutomaticResources().equals(other.getAutomaticResources())) return false; + break; + case 17: + if (!getSharedResources().equals(other.getSharedResources())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (37 * hash) + MODEL_VERSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getModelVersionId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasExplanationSpec()) { + hash = (37 * hash) + EXPLANATION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getExplanationSpec().hashCode(); + } + hash = (37 * hash) + DISABLE_EXPLANATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisableExplanations()); + hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccount().hashCode(); + hash = (37 * hash) + ENABLE_CONTAINER_LOGGING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableContainerLogging()); + hash = (37 * hash) + ENABLE_ACCESS_LOGGING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableAccessLogging()); + if (hasPrivateEndpoints()) { + hash = (37 * hash) + PRIVATE_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getPrivateEndpoints().hashCode(); + } + switch (predictionResourcesCase_) { + case 7: + hash = (37 * hash) + DEDICATED_RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getDedicatedResources().hashCode(); + break; + case 8: + hash = (37 * hash) + AUTOMATIC_RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getAutomaticResources().hashCode(); + break; + case 17: + hash = (37 * hash) + SHARED_RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getSharedResources().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DeployedModel parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DeployedModel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.DeployedModel prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A deployment of a Model. Endpoints contain one or more DeployedModels.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DeployedModel} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DeployedModel) + com.google.cloud.vertexai.api.DeployedModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_DeployedModel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_DeployedModel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DeployedModel.class, + com.google.cloud.vertexai.api.DeployedModel.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DeployedModel.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (dedicatedResourcesBuilder_ != null) { + dedicatedResourcesBuilder_.clear(); + } + if (automaticResourcesBuilder_ != null) { + automaticResourcesBuilder_.clear(); + } + id_ = ""; + model_ = ""; + modelVersionId_ = ""; + displayName_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + explanationSpec_ = null; + if (explanationSpecBuilder_ != null) { + explanationSpecBuilder_.dispose(); + explanationSpecBuilder_ = null; + } + disableExplanations_ = false; + serviceAccount_ = ""; + enableContainerLogging_ = false; + enableAccessLogging_ = false; + privateEndpoints_ = null; + if (privateEndpointsBuilder_ != null) { + privateEndpointsBuilder_.dispose(); + privateEndpointsBuilder_ = null; + } + predictionResourcesCase_ = 0; + predictionResources_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_DeployedModel_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModel getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModel build() { + com.google.cloud.vertexai.api.DeployedModel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModel buildPartial() { + com.google.cloud.vertexai.api.DeployedModel result = + new com.google.cloud.vertexai.api.DeployedModel(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.DeployedModel result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.model_ = model_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.modelVersionId_ = modelVersionId_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.explanationSpec_ = + explanationSpecBuilder_ == null ? explanationSpec_ : explanationSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.disableExplanations_ = disableExplanations_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.serviceAccount_ = serviceAccount_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.enableContainerLogging_ = enableContainerLogging_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.enableAccessLogging_ = enableAccessLogging_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.privateEndpoints_ = + privateEndpointsBuilder_ == null ? privateEndpoints_ : privateEndpointsBuilder_.build(); + } + } + + private void buildPartialOneofs(com.google.cloud.vertexai.api.DeployedModel result) { + result.predictionResourcesCase_ = predictionResourcesCase_; + result.predictionResources_ = this.predictionResources_; + if (predictionResourcesCase_ == 7 && dedicatedResourcesBuilder_ != null) { + result.predictionResources_ = dedicatedResourcesBuilder_.build(); + } + if (predictionResourcesCase_ == 8 && automaticResourcesBuilder_ != null) { + result.predictionResources_ = automaticResourcesBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DeployedModel) { + return mergeFrom((com.google.cloud.vertexai.api.DeployedModel) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DeployedModel other) { + if (other == com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getModelVersionId().isEmpty()) { + modelVersionId_ = other.modelVersionId_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasExplanationSpec()) { + mergeExplanationSpec(other.getExplanationSpec()); + } + if (other.getDisableExplanations() != false) { + setDisableExplanations(other.getDisableExplanations()); + } + if (!other.getServiceAccount().isEmpty()) { + serviceAccount_ = other.serviceAccount_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.getEnableContainerLogging() != false) { + setEnableContainerLogging(other.getEnableContainerLogging()); + } + if (other.getEnableAccessLogging() != false) { + setEnableAccessLogging(other.getEnableAccessLogging()); + } + if (other.hasPrivateEndpoints()) { + mergePrivateEndpoints(other.getPrivateEndpoints()); + } + switch (other.getPredictionResourcesCase()) { + case DEDICATED_RESOURCES: + { + mergeDedicatedResources(other.getDedicatedResources()); + break; + } + case AUTOMATIC_RESOURCES: + { + mergeAutomaticResources(other.getAutomaticResources()); + break; + } + case SHARED_RESOURCES: + { + predictionResourcesCase_ = 17; + predictionResources_ = other.predictionResources_; + onChanged(); + break; + } + case PREDICTIONRESOURCES_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 10 + case 18: + { + model_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 18 + case 26: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 26 + case 50: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 50 + case 58: + { + input.readMessage( + getDedicatedResourcesFieldBuilder().getBuilder(), extensionRegistry); + predictionResourcesCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + getAutomaticResourcesFieldBuilder().getBuilder(), extensionRegistry); + predictionResourcesCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage(getExplanationSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 90: + { + serviceAccount_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 96: + { + enableContainerLogging_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 104: + { + enableAccessLogging_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: + { + input.readMessage( + getPrivateEndpointsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 138: + { + java.lang.String s = input.readStringRequireUtf8(); + predictionResourcesCase_ = 17; + predictionResources_ = s; + break; + } // case 138 + case 146: + { + modelVersionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 146 + case 152: + { + disableExplanations_ = input.readBool(); + bitField0_ |= 0x00000200; + break; + } // case 152 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int predictionResourcesCase_ = 0; + private java.lang.Object predictionResources_; + + public PredictionResourcesCase getPredictionResourcesCase() { + return PredictionResourcesCase.forNumber(predictionResourcesCase_); + } + + public Builder clearPredictionResources() { + predictionResourcesCase_ = 0; + predictionResources_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DedicatedResources, + com.google.cloud.vertexai.api.DedicatedResources.Builder, + com.google.cloud.vertexai.api.DedicatedResourcesOrBuilder> + dedicatedResourcesBuilder_; + /** + * + * + *
+     * A description of resources that are dedicated to the DeployedModel, and
+     * that need a higher degree of manual configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + * + * @return Whether the dedicatedResources field is set. + */ + @java.lang.Override + public boolean hasDedicatedResources() { + return predictionResourcesCase_ == 7; + } + /** + * + * + *
+     * A description of resources that are dedicated to the DeployedModel, and
+     * that need a higher degree of manual configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + * + * @return The dedicatedResources. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DedicatedResources getDedicatedResources() { + if (dedicatedResourcesBuilder_ == null) { + if (predictionResourcesCase_ == 7) { + return (com.google.cloud.vertexai.api.DedicatedResources) predictionResources_; + } + return com.google.cloud.vertexai.api.DedicatedResources.getDefaultInstance(); + } else { + if (predictionResourcesCase_ == 7) { + return dedicatedResourcesBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.DedicatedResources.getDefaultInstance(); + } + } + /** + * + * + *
+     * A description of resources that are dedicated to the DeployedModel, and
+     * that need a higher degree of manual configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + */ + public Builder setDedicatedResources(com.google.cloud.vertexai.api.DedicatedResources value) { + if (dedicatedResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + predictionResources_ = value; + onChanged(); + } else { + dedicatedResourcesBuilder_.setMessage(value); + } + predictionResourcesCase_ = 7; + return this; + } + /** + * + * + *
+     * A description of resources that are dedicated to the DeployedModel, and
+     * that need a higher degree of manual configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + */ + public Builder setDedicatedResources( + com.google.cloud.vertexai.api.DedicatedResources.Builder builderForValue) { + if (dedicatedResourcesBuilder_ == null) { + predictionResources_ = builderForValue.build(); + onChanged(); + } else { + dedicatedResourcesBuilder_.setMessage(builderForValue.build()); + } + predictionResourcesCase_ = 7; + return this; + } + /** + * + * + *
+     * A description of resources that are dedicated to the DeployedModel, and
+     * that need a higher degree of manual configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + */ + public Builder mergeDedicatedResources(com.google.cloud.vertexai.api.DedicatedResources value) { + if (dedicatedResourcesBuilder_ == null) { + if (predictionResourcesCase_ == 7 + && predictionResources_ + != com.google.cloud.vertexai.api.DedicatedResources.getDefaultInstance()) { + predictionResources_ = + com.google.cloud.vertexai.api.DedicatedResources.newBuilder( + (com.google.cloud.vertexai.api.DedicatedResources) predictionResources_) + .mergeFrom(value) + .buildPartial(); + } else { + predictionResources_ = value; + } + onChanged(); + } else { + if (predictionResourcesCase_ == 7) { + dedicatedResourcesBuilder_.mergeFrom(value); + } else { + dedicatedResourcesBuilder_.setMessage(value); + } + } + predictionResourcesCase_ = 7; + return this; + } + /** + * + * + *
+     * A description of resources that are dedicated to the DeployedModel, and
+     * that need a higher degree of manual configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + */ + public Builder clearDedicatedResources() { + if (dedicatedResourcesBuilder_ == null) { + if (predictionResourcesCase_ == 7) { + predictionResourcesCase_ = 0; + predictionResources_ = null; + onChanged(); + } + } else { + if (predictionResourcesCase_ == 7) { + predictionResourcesCase_ = 0; + predictionResources_ = null; + } + dedicatedResourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A description of resources that are dedicated to the DeployedModel, and
+     * that need a higher degree of manual configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + */ + public com.google.cloud.vertexai.api.DedicatedResources.Builder getDedicatedResourcesBuilder() { + return getDedicatedResourcesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A description of resources that are dedicated to the DeployedModel, and
+     * that need a higher degree of manual configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DedicatedResourcesOrBuilder + getDedicatedResourcesOrBuilder() { + if ((predictionResourcesCase_ == 7) && (dedicatedResourcesBuilder_ != null)) { + return dedicatedResourcesBuilder_.getMessageOrBuilder(); + } else { + if (predictionResourcesCase_ == 7) { + return (com.google.cloud.vertexai.api.DedicatedResources) predictionResources_; + } + return com.google.cloud.vertexai.api.DedicatedResources.getDefaultInstance(); + } + } + /** + * + * + *
+     * A description of resources that are dedicated to the DeployedModel, and
+     * that need a higher degree of manual configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DedicatedResources, + com.google.cloud.vertexai.api.DedicatedResources.Builder, + com.google.cloud.vertexai.api.DedicatedResourcesOrBuilder> + getDedicatedResourcesFieldBuilder() { + if (dedicatedResourcesBuilder_ == null) { + if (!(predictionResourcesCase_ == 7)) { + predictionResources_ = + com.google.cloud.vertexai.api.DedicatedResources.getDefaultInstance(); + } + dedicatedResourcesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DedicatedResources, + com.google.cloud.vertexai.api.DedicatedResources.Builder, + com.google.cloud.vertexai.api.DedicatedResourcesOrBuilder>( + (com.google.cloud.vertexai.api.DedicatedResources) predictionResources_, + getParentForChildren(), + isClean()); + predictionResources_ = null; + } + predictionResourcesCase_ = 7; + onChanged(); + return dedicatedResourcesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.AutomaticResources, + com.google.cloud.vertexai.api.AutomaticResources.Builder, + com.google.cloud.vertexai.api.AutomaticResourcesOrBuilder> + automaticResourcesBuilder_; + /** + * + * + *
+     * A description of resources that to large degree are decided by Vertex
+     * AI, and require only a modest additional configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + * + * @return Whether the automaticResources field is set. + */ + @java.lang.Override + public boolean hasAutomaticResources() { + return predictionResourcesCase_ == 8; + } + /** + * + * + *
+     * A description of resources that to large degree are decided by Vertex
+     * AI, and require only a modest additional configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + * + * @return The automaticResources. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.AutomaticResources getAutomaticResources() { + if (automaticResourcesBuilder_ == null) { + if (predictionResourcesCase_ == 8) { + return (com.google.cloud.vertexai.api.AutomaticResources) predictionResources_; + } + return com.google.cloud.vertexai.api.AutomaticResources.getDefaultInstance(); + } else { + if (predictionResourcesCase_ == 8) { + return automaticResourcesBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.AutomaticResources.getDefaultInstance(); + } + } + /** + * + * + *
+     * A description of resources that to large degree are decided by Vertex
+     * AI, and require only a modest additional configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + */ + public Builder setAutomaticResources(com.google.cloud.vertexai.api.AutomaticResources value) { + if (automaticResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + predictionResources_ = value; + onChanged(); + } else { + automaticResourcesBuilder_.setMessage(value); + } + predictionResourcesCase_ = 8; + return this; + } + /** + * + * + *
+     * A description of resources that to large degree are decided by Vertex
+     * AI, and require only a modest additional configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + */ + public Builder setAutomaticResources( + com.google.cloud.vertexai.api.AutomaticResources.Builder builderForValue) { + if (automaticResourcesBuilder_ == null) { + predictionResources_ = builderForValue.build(); + onChanged(); + } else { + automaticResourcesBuilder_.setMessage(builderForValue.build()); + } + predictionResourcesCase_ = 8; + return this; + } + /** + * + * + *
+     * A description of resources that to large degree are decided by Vertex
+     * AI, and require only a modest additional configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + */ + public Builder mergeAutomaticResources(com.google.cloud.vertexai.api.AutomaticResources value) { + if (automaticResourcesBuilder_ == null) { + if (predictionResourcesCase_ == 8 + && predictionResources_ + != com.google.cloud.vertexai.api.AutomaticResources.getDefaultInstance()) { + predictionResources_ = + com.google.cloud.vertexai.api.AutomaticResources.newBuilder( + (com.google.cloud.vertexai.api.AutomaticResources) predictionResources_) + .mergeFrom(value) + .buildPartial(); + } else { + predictionResources_ = value; + } + onChanged(); + } else { + if (predictionResourcesCase_ == 8) { + automaticResourcesBuilder_.mergeFrom(value); + } else { + automaticResourcesBuilder_.setMessage(value); + } + } + predictionResourcesCase_ = 8; + return this; + } + /** + * + * + *
+     * A description of resources that to large degree are decided by Vertex
+     * AI, and require only a modest additional configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + */ + public Builder clearAutomaticResources() { + if (automaticResourcesBuilder_ == null) { + if (predictionResourcesCase_ == 8) { + predictionResourcesCase_ = 0; + predictionResources_ = null; + onChanged(); + } + } else { + if (predictionResourcesCase_ == 8) { + predictionResourcesCase_ = 0; + predictionResources_ = null; + } + automaticResourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A description of resources that to large degree are decided by Vertex
+     * AI, and require only a modest additional configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + */ + public com.google.cloud.vertexai.api.AutomaticResources.Builder getAutomaticResourcesBuilder() { + return getAutomaticResourcesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A description of resources that to large degree are decided by Vertex
+     * AI, and require only a modest additional configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.AutomaticResourcesOrBuilder + getAutomaticResourcesOrBuilder() { + if ((predictionResourcesCase_ == 8) && (automaticResourcesBuilder_ != null)) { + return automaticResourcesBuilder_.getMessageOrBuilder(); + } else { + if (predictionResourcesCase_ == 8) { + return (com.google.cloud.vertexai.api.AutomaticResources) predictionResources_; + } + return com.google.cloud.vertexai.api.AutomaticResources.getDefaultInstance(); + } + } + /** + * + * + *
+     * A description of resources that to large degree are decided by Vertex
+     * AI, and require only a modest additional configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.AutomaticResources, + com.google.cloud.vertexai.api.AutomaticResources.Builder, + com.google.cloud.vertexai.api.AutomaticResourcesOrBuilder> + getAutomaticResourcesFieldBuilder() { + if (automaticResourcesBuilder_ == null) { + if (!(predictionResourcesCase_ == 8)) { + predictionResources_ = + com.google.cloud.vertexai.api.AutomaticResources.getDefaultInstance(); + } + automaticResourcesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.AutomaticResources, + com.google.cloud.vertexai.api.AutomaticResources.Builder, + com.google.cloud.vertexai.api.AutomaticResourcesOrBuilder>( + (com.google.cloud.vertexai.api.AutomaticResources) predictionResources_, + getParentForChildren(), + isClean()); + predictionResources_ = null; + } + predictionResourcesCase_ = 8; + onChanged(); + return automaticResourcesBuilder_; + } + + /** + * + * + *
+     * The resource name of the shared DeploymentResourcePool to deploy on.
+     * Format:
+     * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+     * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sharedResources field is set. + */ + @java.lang.Override + public boolean hasSharedResources() { + return predictionResourcesCase_ == 17; + } + /** + * + * + *
+     * The resource name of the shared DeploymentResourcePool to deploy on.
+     * Format:
+     * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+     * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @return The sharedResources. + */ + @java.lang.Override + public java.lang.String getSharedResources() { + java.lang.Object ref = ""; + if (predictionResourcesCase_ == 17) { + ref = predictionResources_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (predictionResourcesCase_ == 17) { + predictionResources_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the shared DeploymentResourcePool to deploy on.
+     * Format:
+     * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+     * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sharedResources. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSharedResourcesBytes() { + java.lang.Object ref = ""; + if (predictionResourcesCase_ == 17) { + ref = predictionResources_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (predictionResourcesCase_ == 17) { + predictionResources_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the shared DeploymentResourcePool to deploy on.
+     * Format:
+     * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+     * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @param value The sharedResources to set. + * @return This builder for chaining. + */ + public Builder setSharedResources(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + predictionResourcesCase_ = 17; + predictionResources_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the shared DeploymentResourcePool to deploy on.
+     * Format:
+     * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+     * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearSharedResources() { + if (predictionResourcesCase_ == 17) { + predictionResourcesCase_ = 0; + predictionResources_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The resource name of the shared DeploymentResourcePool to deploy on.
+     * Format:
+     * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+     * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for sharedResources to set. + * @return This builder for chaining. + */ + public Builder setSharedResourcesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + predictionResourcesCase_ = 17; + predictionResources_ = value; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * Immutable. The ID of the DeployedModel. If not provided upon deployment,
+     * Vertex AI will generate a value for this ID.
+     *
+     * This value should be 1-10 characters, and valid characters are `/[0-9]/`.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The ID of the DeployedModel. If not provided upon deployment,
+     * Vertex AI will generate a value for this ID.
+     *
+     * This value should be 1-10 characters, and valid characters are `/[0-9]/`.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The ID of the DeployedModel. If not provided upon deployment,
+     * Vertex AI will generate a value for this ID.
+     *
+     * This value should be 1-10 characters, and valid characters are `/[0-9]/`.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The ID of the DeployedModel. If not provided upon deployment,
+     * Vertex AI will generate a value for this ID.
+     *
+     * This value should be 1-10 characters, and valid characters are `/[0-9]/`.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The ID of the DeployedModel. If not provided upon deployment,
+     * Vertex AI will generate a value for this ID.
+     *
+     * This value should be 1-10 characters, and valid characters are `/[0-9]/`.
+     * 
+ * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object model_ = ""; + /** + * + * + *
+     * Required. The resource name of the Model that this is the deployment of.
+     * Note that the Model may be in a different location than the DeployedModel's
+     * Endpoint.
+     *
+     * The resource name may contain version id or version alias to specify the
+     * version.
+     *  Example: `projects/{project}/locations/{location}/models/{model}@2`
+     *              or
+     *            `projects/{project}/locations/{location}/models/{model}@golden`
+     * if no version is specified, the default version will be deployed.
+     * 
+ * + * + * string model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Model that this is the deployment of.
+     * Note that the Model may be in a different location than the DeployedModel's
+     * Endpoint.
+     *
+     * The resource name may contain version id or version alias to specify the
+     * version.
+     *  Example: `projects/{project}/locations/{location}/models/{model}@2`
+     *              or
+     *            `projects/{project}/locations/{location}/models/{model}@golden`
+     * if no version is specified, the default version will be deployed.
+     * 
+ * + * + * string model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for model. + */ + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Model that this is the deployment of.
+     * Note that the Model may be in a different location than the DeployedModel's
+     * Endpoint.
+     *
+     * The resource name may contain version id or version alias to specify the
+     * version.
+     *  Example: `projects/{project}/locations/{location}/models/{model}@2`
+     *              or
+     *            `projects/{project}/locations/{location}/models/{model}@golden`
+     * if no version is specified, the default version will be deployed.
+     * 
+ * + * + * string model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + model_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Model that this is the deployment of.
+     * Note that the Model may be in a different location than the DeployedModel's
+     * Endpoint.
+     *
+     * The resource name may contain version id or version alias to specify the
+     * version.
+     *  Example: `projects/{project}/locations/{location}/models/{model}@2`
+     *              or
+     *            `projects/{project}/locations/{location}/models/{model}@golden`
+     * if no version is specified, the default version will be deployed.
+     * 
+ * + * + * string model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearModel() { + model_ = getDefaultInstance().getModel(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Model that this is the deployment of.
+     * Note that the Model may be in a different location than the DeployedModel's
+     * Endpoint.
+     *
+     * The resource name may contain version id or version alias to specify the
+     * version.
+     *  Example: `projects/{project}/locations/{location}/models/{model}@2`
+     *              or
+     *            `projects/{project}/locations/{location}/models/{model}@golden`
+     * if no version is specified, the default version will be deployed.
+     * 
+ * + * + * string model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + model_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object modelVersionId_ = ""; + /** + * + * + *
+     * Output only. The version ID of the model that is deployed.
+     * 
+ * + * string model_version_id = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The modelVersionId. + */ + public java.lang.String getModelVersionId() { + java.lang.Object ref = modelVersionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelVersionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The version ID of the model that is deployed.
+     * 
+ * + * string model_version_id = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for modelVersionId. + */ + public com.google.protobuf.ByteString getModelVersionIdBytes() { + java.lang.Object ref = modelVersionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelVersionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The version ID of the model that is deployed.
+     * 
+ * + * string model_version_id = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The modelVersionId to set. + * @return This builder for chaining. + */ + public Builder setModelVersionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + modelVersionId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version ID of the model that is deployed.
+     * 
+ * + * string model_version_id = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearModelVersionId() { + modelVersionId_ = getDefaultInstance().getModelVersionId(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version ID of the model that is deployed.
+     * 
+ * + * string model_version_id = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for modelVersionId to set. + * @return This builder for chaining. + */ + public Builder setModelVersionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + modelVersionId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of the DeployedModel. If not provided upon creation,
+     * the Model's display_name is used.
+     * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of the DeployedModel. If not provided upon creation,
+     * the Model's display_name is used.
+     * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of the DeployedModel. If not provided upon creation,
+     * the Model's display_name is used.
+     * 
+ * + * string display_name = 3; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the DeployedModel. If not provided upon creation,
+     * the Model's display_name is used.
+     * 
+ * + * string display_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the DeployedModel. If not provided upon creation,
+     * the Model's display_name is used.
+     * 
+ * + * string display_name = 3; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when the DeployedModel was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Timestamp when the DeployedModel was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when the DeployedModel was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the DeployedModel was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the DeployedModel was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the DeployedModel was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the DeployedModel was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the DeployedModel was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when the DeployedModel was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.cloud.vertexai.api.ExplanationSpec explanationSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationSpec, + com.google.cloud.vertexai.api.ExplanationSpec.Builder, + com.google.cloud.vertexai.api.ExplanationSpecOrBuilder> + explanationSpecBuilder_; + /** + * + * + *
+     * Explanation configuration for this DeployedModel.
+     *
+     * When deploying a Model using
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+     * this value overrides the value of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+     * All fields of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * are optional in the request. If a field of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * is not populated, the value of the same field of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is inherited. If the corresponding
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is not populated, all fields of the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * will be used for the explanation configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + * + * @return Whether the explanationSpec field is set. + */ + public boolean hasExplanationSpec() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Explanation configuration for this DeployedModel.
+     *
+     * When deploying a Model using
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+     * this value overrides the value of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+     * All fields of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * are optional in the request. If a field of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * is not populated, the value of the same field of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is inherited. If the corresponding
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is not populated, all fields of the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * will be used for the explanation configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + * + * @return The explanationSpec. + */ + public com.google.cloud.vertexai.api.ExplanationSpec getExplanationSpec() { + if (explanationSpecBuilder_ == null) { + return explanationSpec_ == null + ? com.google.cloud.vertexai.api.ExplanationSpec.getDefaultInstance() + : explanationSpec_; + } else { + return explanationSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Explanation configuration for this DeployedModel.
+     *
+     * When deploying a Model using
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+     * this value overrides the value of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+     * All fields of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * are optional in the request. If a field of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * is not populated, the value of the same field of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is inherited. If the corresponding
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is not populated, all fields of the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * will be used for the explanation configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + */ + public Builder setExplanationSpec(com.google.cloud.vertexai.api.ExplanationSpec value) { + if (explanationSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explanationSpec_ = value; + } else { + explanationSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Explanation configuration for this DeployedModel.
+     *
+     * When deploying a Model using
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+     * this value overrides the value of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+     * All fields of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * are optional in the request. If a field of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * is not populated, the value of the same field of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is inherited. If the corresponding
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is not populated, all fields of the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * will be used for the explanation configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + */ + public Builder setExplanationSpec( + com.google.cloud.vertexai.api.ExplanationSpec.Builder builderForValue) { + if (explanationSpecBuilder_ == null) { + explanationSpec_ = builderForValue.build(); + } else { + explanationSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Explanation configuration for this DeployedModel.
+     *
+     * When deploying a Model using
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+     * this value overrides the value of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+     * All fields of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * are optional in the request. If a field of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * is not populated, the value of the same field of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is inherited. If the corresponding
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is not populated, all fields of the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * will be used for the explanation configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + */ + public Builder mergeExplanationSpec(com.google.cloud.vertexai.api.ExplanationSpec value) { + if (explanationSpecBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && explanationSpec_ != null + && explanationSpec_ + != com.google.cloud.vertexai.api.ExplanationSpec.getDefaultInstance()) { + getExplanationSpecBuilder().mergeFrom(value); + } else { + explanationSpec_ = value; + } + } else { + explanationSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Explanation configuration for this DeployedModel.
+     *
+     * When deploying a Model using
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+     * this value overrides the value of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+     * All fields of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * are optional in the request. If a field of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * is not populated, the value of the same field of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is inherited. If the corresponding
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is not populated, all fields of the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * will be used for the explanation configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + */ + public Builder clearExplanationSpec() { + bitField0_ = (bitField0_ & ~0x00000100); + explanationSpec_ = null; + if (explanationSpecBuilder_ != null) { + explanationSpecBuilder_.dispose(); + explanationSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Explanation configuration for this DeployedModel.
+     *
+     * When deploying a Model using
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+     * this value overrides the value of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+     * All fields of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * are optional in the request. If a field of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * is not populated, the value of the same field of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is inherited. If the corresponding
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is not populated, all fields of the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * will be used for the explanation configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + */ + public com.google.cloud.vertexai.api.ExplanationSpec.Builder getExplanationSpecBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getExplanationSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Explanation configuration for this DeployedModel.
+     *
+     * When deploying a Model using
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+     * this value overrides the value of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+     * All fields of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * are optional in the request. If a field of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * is not populated, the value of the same field of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is inherited. If the corresponding
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is not populated, all fields of the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * will be used for the explanation configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + */ + public com.google.cloud.vertexai.api.ExplanationSpecOrBuilder getExplanationSpecOrBuilder() { + if (explanationSpecBuilder_ != null) { + return explanationSpecBuilder_.getMessageOrBuilder(); + } else { + return explanationSpec_ == null + ? com.google.cloud.vertexai.api.ExplanationSpec.getDefaultInstance() + : explanationSpec_; + } + } + /** + * + * + *
+     * Explanation configuration for this DeployedModel.
+     *
+     * When deploying a Model using
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+     * this value overrides the value of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+     * All fields of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * are optional in the request. If a field of
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * is not populated, the value of the same field of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is inherited. If the corresponding
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * is not populated, all fields of the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * will be used for the explanation configuration.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationSpec, + com.google.cloud.vertexai.api.ExplanationSpec.Builder, + com.google.cloud.vertexai.api.ExplanationSpecOrBuilder> + getExplanationSpecFieldBuilder() { + if (explanationSpecBuilder_ == null) { + explanationSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationSpec, + com.google.cloud.vertexai.api.ExplanationSpec.Builder, + com.google.cloud.vertexai.api.ExplanationSpecOrBuilder>( + getExplanationSpec(), getParentForChildren(), isClean()); + explanationSpec_ = null; + } + return explanationSpecBuilder_; + } + + private boolean disableExplanations_; + /** + * + * + *
+     * If true, deploy the model without explainable feature, regardless the
+     * existence of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * or
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec].
+     * 
+ * + * bool disable_explanations = 19; + * + * @return The disableExplanations. + */ + @java.lang.Override + public boolean getDisableExplanations() { + return disableExplanations_; + } + /** + * + * + *
+     * If true, deploy the model without explainable feature, regardless the
+     * existence of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * or
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec].
+     * 
+ * + * bool disable_explanations = 19; + * + * @param value The disableExplanations to set. + * @return This builder for chaining. + */ + public Builder setDisableExplanations(boolean value) { + + disableExplanations_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, deploy the model without explainable feature, regardless the
+     * existence of
+     * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+     * or
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec].
+     * 
+ * + * bool disable_explanations = 19; + * + * @return This builder for chaining. + */ + public Builder clearDisableExplanations() { + bitField0_ = (bitField0_ & ~0x00000200); + disableExplanations_ = false; + onChanged(); + return this; + } + + private java.lang.Object serviceAccount_ = ""; + /** + * + * + *
+     * The service account that the DeployedModel's container runs as. Specify the
+     * email address of the service account. If this service account is not
+     * specified, the container runs as a service account that doesn't have access
+     * to the resource project.
+     *
+     * Users deploying the Model must have the `iam.serviceAccounts.actAs`
+     * permission on this service account.
+     * 
+ * + * string service_account = 11; + * + * @return The serviceAccount. + */ + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The service account that the DeployedModel's container runs as. Specify the
+     * email address of the service account. If this service account is not
+     * specified, the container runs as a service account that doesn't have access
+     * to the resource project.
+     *
+     * Users deploying the Model must have the `iam.serviceAccounts.actAs`
+     * permission on this service account.
+     * 
+ * + * string service_account = 11; + * + * @return The bytes for serviceAccount. + */ + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The service account that the DeployedModel's container runs as. Specify the
+     * email address of the service account. If this service account is not
+     * specified, the container runs as a service account that doesn't have access
+     * to the resource project.
+     *
+     * Users deploying the Model must have the `iam.serviceAccounts.actAs`
+     * permission on this service account.
+     * 
+ * + * string service_account = 11; + * + * @param value The serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAccount_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * The service account that the DeployedModel's container runs as. Specify the
+     * email address of the service account. If this service account is not
+     * specified, the container runs as a service account that doesn't have access
+     * to the resource project.
+     *
+     * Users deploying the Model must have the `iam.serviceAccounts.actAs`
+     * permission on this service account.
+     * 
+ * + * string service_account = 11; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccount() { + serviceAccount_ = getDefaultInstance().getServiceAccount(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * The service account that the DeployedModel's container runs as. Specify the
+     * email address of the service account. If this service account is not
+     * specified, the container runs as a service account that doesn't have access
+     * to the resource project.
+     *
+     * Users deploying the Model must have the `iam.serviceAccounts.actAs`
+     * permission on this service account.
+     * 
+ * + * string service_account = 11; + * + * @param value The bytes for serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAccount_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private boolean enableContainerLogging_; + /** + * + * + *
+     * If true, the container of the DeployedModel instances will send `stderr`
+     * and `stdout` streams to Cloud Logging.
+     *
+     * Only supported for custom-trained Models and AutoML Tabular Models.
+     * 
+ * + * bool enable_container_logging = 12; + * + * @return The enableContainerLogging. + */ + @java.lang.Override + public boolean getEnableContainerLogging() { + return enableContainerLogging_; + } + /** + * + * + *
+     * If true, the container of the DeployedModel instances will send `stderr`
+     * and `stdout` streams to Cloud Logging.
+     *
+     * Only supported for custom-trained Models and AutoML Tabular Models.
+     * 
+ * + * bool enable_container_logging = 12; + * + * @param value The enableContainerLogging to set. + * @return This builder for chaining. + */ + public Builder setEnableContainerLogging(boolean value) { + + enableContainerLogging_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, the container of the DeployedModel instances will send `stderr`
+     * and `stdout` streams to Cloud Logging.
+     *
+     * Only supported for custom-trained Models and AutoML Tabular Models.
+     * 
+ * + * bool enable_container_logging = 12; + * + * @return This builder for chaining. + */ + public Builder clearEnableContainerLogging() { + bitField0_ = (bitField0_ & ~0x00000800); + enableContainerLogging_ = false; + onChanged(); + return this; + } + + private boolean enableAccessLogging_; + /** + * + * + *
+     * If true, online prediction access logs are sent to Cloud
+     * Logging.
+     * These logs are like standard server access logs, containing
+     * information like timestamp and latency for each prediction request.
+     *
+     * Note that logs may incur a cost, especially if your project
+     * receives prediction requests at a high queries per second rate (QPS).
+     * Estimate your costs before enabling this option.
+     * 
+ * + * bool enable_access_logging = 13; + * + * @return The enableAccessLogging. + */ + @java.lang.Override + public boolean getEnableAccessLogging() { + return enableAccessLogging_; + } + /** + * + * + *
+     * If true, online prediction access logs are sent to Cloud
+     * Logging.
+     * These logs are like standard server access logs, containing
+     * information like timestamp and latency for each prediction request.
+     *
+     * Note that logs may incur a cost, especially if your project
+     * receives prediction requests at a high queries per second rate (QPS).
+     * Estimate your costs before enabling this option.
+     * 
+ * + * bool enable_access_logging = 13; + * + * @param value The enableAccessLogging to set. + * @return This builder for chaining. + */ + public Builder setEnableAccessLogging(boolean value) { + + enableAccessLogging_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, online prediction access logs are sent to Cloud
+     * Logging.
+     * These logs are like standard server access logs, containing
+     * information like timestamp and latency for each prediction request.
+     *
+     * Note that logs may incur a cost, especially if your project
+     * receives prediction requests at a high queries per second rate (QPS).
+     * Estimate your costs before enabling this option.
+     * 
+ * + * bool enable_access_logging = 13; + * + * @return This builder for chaining. + */ + public Builder clearEnableAccessLogging() { + bitField0_ = (bitField0_ & ~0x00001000); + enableAccessLogging_ = false; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.PrivateEndpoints privateEndpoints_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.PrivateEndpoints, + com.google.cloud.vertexai.api.PrivateEndpoints.Builder, + com.google.cloud.vertexai.api.PrivateEndpointsOrBuilder> + privateEndpointsBuilder_; + /** + * + * + *
+     * Output only. Provide paths for users to send predict/explain/health
+     * requests directly to the deployed model services running on Cloud via
+     * private services access. This field is populated if
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the privateEndpoints field is set. + */ + public boolean hasPrivateEndpoints() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Output only. Provide paths for users to send predict/explain/health
+     * requests directly to the deployed model services running on Cloud via
+     * private services access. This field is populated if
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The privateEndpoints. + */ + public com.google.cloud.vertexai.api.PrivateEndpoints getPrivateEndpoints() { + if (privateEndpointsBuilder_ == null) { + return privateEndpoints_ == null + ? com.google.cloud.vertexai.api.PrivateEndpoints.getDefaultInstance() + : privateEndpoints_; + } else { + return privateEndpointsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Provide paths for users to send predict/explain/health
+     * requests directly to the deployed model services running on Cloud via
+     * private services access. This field is populated if
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPrivateEndpoints(com.google.cloud.vertexai.api.PrivateEndpoints value) { + if (privateEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + privateEndpoints_ = value; + } else { + privateEndpointsBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Provide paths for users to send predict/explain/health
+     * requests directly to the deployed model services running on Cloud via
+     * private services access. This field is populated if
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPrivateEndpoints( + com.google.cloud.vertexai.api.PrivateEndpoints.Builder builderForValue) { + if (privateEndpointsBuilder_ == null) { + privateEndpoints_ = builderForValue.build(); + } else { + privateEndpointsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Provide paths for users to send predict/explain/health
+     * requests directly to the deployed model services running on Cloud via
+     * private services access. This field is populated if
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePrivateEndpoints(com.google.cloud.vertexai.api.PrivateEndpoints value) { + if (privateEndpointsBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && privateEndpoints_ != null + && privateEndpoints_ + != com.google.cloud.vertexai.api.PrivateEndpoints.getDefaultInstance()) { + getPrivateEndpointsBuilder().mergeFrom(value); + } else { + privateEndpoints_ = value; + } + } else { + privateEndpointsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Provide paths for users to send predict/explain/health
+     * requests directly to the deployed model services running on Cloud via
+     * private services access. This field is populated if
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPrivateEndpoints() { + bitField0_ = (bitField0_ & ~0x00002000); + privateEndpoints_ = null; + if (privateEndpointsBuilder_ != null) { + privateEndpointsBuilder_.dispose(); + privateEndpointsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Provide paths for users to send predict/explain/health
+     * requests directly to the deployed model services running on Cloud via
+     * private services access. This field is populated if
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.PrivateEndpoints.Builder getPrivateEndpointsBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getPrivateEndpointsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Provide paths for users to send predict/explain/health
+     * requests directly to the deployed model services running on Cloud via
+     * private services access. This field is populated if
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.PrivateEndpointsOrBuilder getPrivateEndpointsOrBuilder() { + if (privateEndpointsBuilder_ != null) { + return privateEndpointsBuilder_.getMessageOrBuilder(); + } else { + return privateEndpoints_ == null + ? com.google.cloud.vertexai.api.PrivateEndpoints.getDefaultInstance() + : privateEndpoints_; + } + } + /** + * + * + *
+     * Output only. Provide paths for users to send predict/explain/health
+     * requests directly to the deployed model services running on Cloud via
+     * private services access. This field is populated if
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.PrivateEndpoints, + com.google.cloud.vertexai.api.PrivateEndpoints.Builder, + com.google.cloud.vertexai.api.PrivateEndpointsOrBuilder> + getPrivateEndpointsFieldBuilder() { + if (privateEndpointsBuilder_ == null) { + privateEndpointsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.PrivateEndpoints, + com.google.cloud.vertexai.api.PrivateEndpoints.Builder, + com.google.cloud.vertexai.api.PrivateEndpointsOrBuilder>( + getPrivateEndpoints(), getParentForChildren(), isClean()); + privateEndpoints_ = null; + } + return privateEndpointsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DeployedModel) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DeployedModel) + private static final com.google.cloud.vertexai.api.DeployedModel DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DeployedModel(); + } + + public static com.google.cloud.vertexai.api.DeployedModel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeployedModel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployedModelOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployedModelOrBuilder.java new file mode 100644 index 000000000000..a49c14be8952 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DeployedModelOrBuilder.java @@ -0,0 +1,537 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint.proto + +package com.google.cloud.vertexai.api; + +public interface DeployedModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DeployedModel) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A description of resources that are dedicated to the DeployedModel, and
+   * that need a higher degree of manual configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + * + * @return Whether the dedicatedResources field is set. + */ + boolean hasDedicatedResources(); + /** + * + * + *
+   * A description of resources that are dedicated to the DeployedModel, and
+   * that need a higher degree of manual configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + * + * @return The dedicatedResources. + */ + com.google.cloud.vertexai.api.DedicatedResources getDedicatedResources(); + /** + * + * + *
+   * A description of resources that are dedicated to the DeployedModel, and
+   * that need a higher degree of manual configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DedicatedResources dedicated_resources = 7; + */ + com.google.cloud.vertexai.api.DedicatedResourcesOrBuilder getDedicatedResourcesOrBuilder(); + + /** + * + * + *
+   * A description of resources that to large degree are decided by Vertex
+   * AI, and require only a modest additional configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + * + * @return Whether the automaticResources field is set. + */ + boolean hasAutomaticResources(); + /** + * + * + *
+   * A description of resources that to large degree are decided by Vertex
+   * AI, and require only a modest additional configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + * + * @return The automaticResources. + */ + com.google.cloud.vertexai.api.AutomaticResources getAutomaticResources(); + /** + * + * + *
+   * A description of resources that to large degree are decided by Vertex
+   * AI, and require only a modest additional configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.AutomaticResources automatic_resources = 8; + */ + com.google.cloud.vertexai.api.AutomaticResourcesOrBuilder getAutomaticResourcesOrBuilder(); + + /** + * + * + *
+   * The resource name of the shared DeploymentResourcePool to deploy on.
+   * Format:
+   * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+   * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @return Whether the sharedResources field is set. + */ + boolean hasSharedResources(); + /** + * + * + *
+   * The resource name of the shared DeploymentResourcePool to deploy on.
+   * Format:
+   * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+   * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @return The sharedResources. + */ + java.lang.String getSharedResources(); + /** + * + * + *
+   * The resource name of the shared DeploymentResourcePool to deploy on.
+   * Format:
+   * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
+   * 
+ * + * string shared_resources = 17 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for sharedResources. + */ + com.google.protobuf.ByteString getSharedResourcesBytes(); + + /** + * + * + *
+   * Immutable. The ID of the DeployedModel. If not provided upon deployment,
+   * Vertex AI will generate a value for this ID.
+   *
+   * This value should be 1-10 characters, and valid characters are `/[0-9]/`.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Immutable. The ID of the DeployedModel. If not provided upon deployment,
+   * Vertex AI will generate a value for this ID.
+   *
+   * This value should be 1-10 characters, and valid characters are `/[0-9]/`.
+   * 
+ * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Required. The resource name of the Model that this is the deployment of.
+   * Note that the Model may be in a different location than the DeployedModel's
+   * Endpoint.
+   *
+   * The resource name may contain version id or version alias to specify the
+   * version.
+   *  Example: `projects/{project}/locations/{location}/models/{model}@2`
+   *              or
+   *            `projects/{project}/locations/{location}/models/{model}@golden`
+   * if no version is specified, the default version will be deployed.
+   * 
+ * + * + * string model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * Required. The resource name of the Model that this is the deployment of.
+   * Note that the Model may be in a different location than the DeployedModel's
+   * Endpoint.
+   *
+   * The resource name may contain version id or version alias to specify the
+   * version.
+   *  Example: `projects/{project}/locations/{location}/models/{model}@2`
+   *              or
+   *            `projects/{project}/locations/{location}/models/{model}@golden`
+   * if no version is specified, the default version will be deployed.
+   * 
+ * + * + * string model = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); + + /** + * + * + *
+   * Output only. The version ID of the model that is deployed.
+   * 
+ * + * string model_version_id = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The modelVersionId. + */ + java.lang.String getModelVersionId(); + /** + * + * + *
+   * Output only. The version ID of the model that is deployed.
+   * 
+ * + * string model_version_id = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for modelVersionId. + */ + com.google.protobuf.ByteString getModelVersionIdBytes(); + + /** + * + * + *
+   * The display name of the DeployedModel. If not provided upon creation,
+   * the Model's display_name is used.
+   * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The display name of the DeployedModel. If not provided upon creation,
+   * the Model's display_name is used.
+   * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. Timestamp when the DeployedModel was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the DeployedModel was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the DeployedModel was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Explanation configuration for this DeployedModel.
+   *
+   * When deploying a Model using
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+   * this value overrides the value of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+   * All fields of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * are optional in the request. If a field of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * is not populated, the value of the same field of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is inherited. If the corresponding
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is not populated, all fields of the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * will be used for the explanation configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + * + * @return Whether the explanationSpec field is set. + */ + boolean hasExplanationSpec(); + /** + * + * + *
+   * Explanation configuration for this DeployedModel.
+   *
+   * When deploying a Model using
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+   * this value overrides the value of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+   * All fields of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * are optional in the request. If a field of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * is not populated, the value of the same field of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is inherited. If the corresponding
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is not populated, all fields of the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * will be used for the explanation configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + * + * @return The explanationSpec. + */ + com.google.cloud.vertexai.api.ExplanationSpec getExplanationSpec(); + /** + * + * + *
+   * Explanation configuration for this DeployedModel.
+   *
+   * When deploying a Model using
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel],
+   * this value overrides the value of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec].
+   * All fields of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * are optional in the request. If a field of
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * is not populated, the value of the same field of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is inherited. If the corresponding
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * is not populated, all fields of the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * will be used for the explanation configuration.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpec explanation_spec = 9; + */ + com.google.cloud.vertexai.api.ExplanationSpecOrBuilder getExplanationSpecOrBuilder(); + + /** + * + * + *
+   * If true, deploy the model without explainable feature, regardless the
+   * existence of
+   * [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]
+   * or
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec].
+   * 
+ * + * bool disable_explanations = 19; + * + * @return The disableExplanations. + */ + boolean getDisableExplanations(); + + /** + * + * + *
+   * The service account that the DeployedModel's container runs as. Specify the
+   * email address of the service account. If this service account is not
+   * specified, the container runs as a service account that doesn't have access
+   * to the resource project.
+   *
+   * Users deploying the Model must have the `iam.serviceAccounts.actAs`
+   * permission on this service account.
+   * 
+ * + * string service_account = 11; + * + * @return The serviceAccount. + */ + java.lang.String getServiceAccount(); + /** + * + * + *
+   * The service account that the DeployedModel's container runs as. Specify the
+   * email address of the service account. If this service account is not
+   * specified, the container runs as a service account that doesn't have access
+   * to the resource project.
+   *
+   * Users deploying the Model must have the `iam.serviceAccounts.actAs`
+   * permission on this service account.
+   * 
+ * + * string service_account = 11; + * + * @return The bytes for serviceAccount. + */ + com.google.protobuf.ByteString getServiceAccountBytes(); + + /** + * + * + *
+   * If true, the container of the DeployedModel instances will send `stderr`
+   * and `stdout` streams to Cloud Logging.
+   *
+   * Only supported for custom-trained Models and AutoML Tabular Models.
+   * 
+ * + * bool enable_container_logging = 12; + * + * @return The enableContainerLogging. + */ + boolean getEnableContainerLogging(); + + /** + * + * + *
+   * If true, online prediction access logs are sent to Cloud
+   * Logging.
+   * These logs are like standard server access logs, containing
+   * information like timestamp and latency for each prediction request.
+   *
+   * Note that logs may incur a cost, especially if your project
+   * receives prediction requests at a high queries per second rate (QPS).
+   * Estimate your costs before enabling this option.
+   * 
+ * + * bool enable_access_logging = 13; + * + * @return The enableAccessLogging. + */ + boolean getEnableAccessLogging(); + + /** + * + * + *
+   * Output only. Provide paths for users to send predict/explain/health
+   * requests directly to the deployed model services running on Cloud via
+   * private services access. This field is populated if
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the privateEndpoints field is set. + */ + boolean hasPrivateEndpoints(); + /** + * + * + *
+   * Output only. Provide paths for users to send predict/explain/health
+   * requests directly to the deployed model services running on Cloud via
+   * private services access. This field is populated if
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The privateEndpoints. + */ + com.google.cloud.vertexai.api.PrivateEndpoints getPrivateEndpoints(); + /** + * + * + *
+   * Output only. Provide paths for users to send predict/explain/health
+   * requests directly to the deployed model services running on Cloud via
+   * private services access. This field is populated if
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PrivateEndpoints private_endpoints = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.PrivateEndpointsOrBuilder getPrivateEndpointsOrBuilder(); + + com.google.cloud.vertexai.api.DeployedModel.PredictionResourcesCase getPredictionResourcesCase(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictRequest.java new file mode 100644 index 000000000000..47ad36d028b4 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictRequest.java @@ -0,0 +1,1410 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [PredictionService.DirectPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectPredict].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DirectPredictRequest} + */ +public final class DirectPredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DirectPredictRequest) + DirectPredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DirectPredictRequest.newBuilder() to construct. + private DirectPredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DirectPredictRequest() { + endpoint_ = ""; + inputs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DirectPredictRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectPredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DirectPredictRequest.class, + com.google.cloud.vertexai.api.DirectPredictRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List inputs_; + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + @java.lang.Override + public java.util.List getInputsList() { + return inputs_; + } + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + @java.lang.Override + public java.util.List + getInputsOrBuilderList() { + return inputs_; + } + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + @java.lang.Override + public int getInputsCount() { + return inputs_.size(); + } + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getInputs(int index) { + return inputs_.get(index); + } + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.TensorOrBuilder getInputsOrBuilder(int index) { + return inputs_.get(index); + } + + public static final int PARAMETERS_FIELD_NUMBER = 3; + private com.google.cloud.vertexai.api.Tensor parameters_; + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getParameters() { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder() { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + for (int i = 0; i < inputs_.size(); i++) { + output.writeMessage(2, inputs_.get(i)); + } + if (parameters_ != null) { + output.writeMessage(3, getParameters()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + for (int i = 0; i < inputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, inputs_.get(i)); + } + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getParameters()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DirectPredictRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DirectPredictRequest other = + (com.google.cloud.vertexai.api.DirectPredictRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (!getInputsList().equals(other.getInputsList())) return false; + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + if (getInputsCount() > 0) { + hash = (37 * hash) + INPUTS_FIELD_NUMBER; + hash = (53 * hash) + getInputsList().hashCode(); + } + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.DirectPredictRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [PredictionService.DirectPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectPredict].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DirectPredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DirectPredictRequest) + com.google.cloud.vertexai.api.DirectPredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectPredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DirectPredictRequest.class, + com.google.cloud.vertexai.api.DirectPredictRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DirectPredictRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + if (inputsBuilder_ == null) { + inputs_ = java.util.Collections.emptyList(); + } else { + inputs_ = null; + inputsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectPredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectPredictRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DirectPredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectPredictRequest build() { + com.google.cloud.vertexai.api.DirectPredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectPredictRequest buildPartial() { + com.google.cloud.vertexai.api.DirectPredictRequest result = + new com.google.cloud.vertexai.api.DirectPredictRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.DirectPredictRequest result) { + if (inputsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + inputs_ = java.util.Collections.unmodifiableList(inputs_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.inputs_ = inputs_; + } else { + result.inputs_ = inputsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.DirectPredictRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.parameters_ = parametersBuilder_ == null ? parameters_ : parametersBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DirectPredictRequest) { + return mergeFrom((com.google.cloud.vertexai.api.DirectPredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DirectPredictRequest other) { + if (other == com.google.cloud.vertexai.api.DirectPredictRequest.getDefaultInstance()) + return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (inputsBuilder_ == null) { + if (!other.inputs_.isEmpty()) { + if (inputs_.isEmpty()) { + inputs_ = other.inputs_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInputsIsMutable(); + inputs_.addAll(other.inputs_); + } + onChanged(); + } + } else { + if (!other.inputs_.isEmpty()) { + if (inputsBuilder_.isEmpty()) { + inputsBuilder_.dispose(); + inputsBuilder_ = null; + inputs_ = other.inputs_; + bitField0_ = (bitField0_ & ~0x00000002); + inputsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInputsFieldBuilder() + : null; + } else { + inputsBuilder_.addAllMessages(other.inputs_); + } + } + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.vertexai.api.Tensor m = + input.readMessage( + com.google.cloud.vertexai.api.Tensor.parser(), extensionRegistry); + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(m); + } else { + inputsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + input.readMessage(getParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List inputs_ = + java.util.Collections.emptyList(); + + private void ensureInputsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + inputs_ = new java.util.ArrayList(inputs_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + inputsBuilder_; + + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public java.util.List getInputsList() { + if (inputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(inputs_); + } else { + return inputsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public int getInputsCount() { + if (inputsBuilder_ == null) { + return inputs_.size(); + } else { + return inputsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public com.google.cloud.vertexai.api.Tensor getInputs(int index) { + if (inputsBuilder_ == null) { + return inputs_.get(index); + } else { + return inputsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder setInputs(int index, com.google.cloud.vertexai.api.Tensor value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.set(index, value); + onChanged(); + } else { + inputsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder setInputs( + int index, com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.set(index, builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder addInputs(com.google.cloud.vertexai.api.Tensor value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.add(value); + onChanged(); + } else { + inputsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder addInputs(int index, com.google.cloud.vertexai.api.Tensor value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.add(index, value); + onChanged(); + } else { + inputsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder addInputs(com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder addInputs( + int index, com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(index, builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder addAllInputs( + java.lang.Iterable values) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inputs_); + onChanged(); + } else { + inputsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder clearInputs() { + if (inputsBuilder_ == null) { + inputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + inputsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder removeInputs(int index) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.remove(index); + onChanged(); + } else { + inputsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public com.google.cloud.vertexai.api.Tensor.Builder getInputsBuilder(int index) { + return getInputsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public com.google.cloud.vertexai.api.TensorOrBuilder getInputsOrBuilder(int index) { + if (inputsBuilder_ == null) { + return inputs_.get(index); + } else { + return inputsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public java.util.List + getInputsOrBuilderList() { + if (inputsBuilder_ != null) { + return inputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inputs_); + } + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public com.google.cloud.vertexai.api.Tensor.Builder addInputsBuilder() { + return getInputsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public com.google.cloud.vertexai.api.Tensor.Builder addInputsBuilder(int index) { + return getInputsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public java.util.List getInputsBuilderList() { + return getInputsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + getInputsFieldBuilder() { + if (inputsBuilder_ == null) { + inputsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder>( + inputs_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + inputs_ = null; + } + return inputsBuilder_; + } + + private com.google.cloud.vertexai.api.Tensor parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return The parameters. + */ + public com.google.cloud.vertexai.api.Tensor getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public Builder setParameters(com.google.cloud.vertexai.api.Tensor value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + } else { + parametersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public Builder setParameters(com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public Builder mergeParameters(com.google.cloud.vertexai.api.Tensor value) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && parameters_ != null + && parameters_ != com.google.cloud.vertexai.api.Tensor.getDefaultInstance()) { + getParametersBuilder().mergeFrom(value); + } else { + parameters_ = value; + } + } else { + parametersBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public Builder clearParameters() { + bitField0_ = (bitField0_ & ~0x00000004); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public com.google.cloud.vertexai.api.Tensor.Builder getParametersBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DirectPredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DirectPredictRequest) + private static final com.google.cloud.vertexai.api.DirectPredictRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DirectPredictRequest(); + } + + public static com.google.cloud.vertexai.api.DirectPredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DirectPredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectPredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictRequestOrBuilder.java new file mode 100644 index 000000000000..90fd8c8e91b2 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface DirectPredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DirectPredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + java.util.List getInputsList(); + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + com.google.cloud.vertexai.api.Tensor getInputs(int index); + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + int getInputsCount(); + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + java.util.List getInputsOrBuilderList(); + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + com.google.cloud.vertexai.api.TensorOrBuilder getInputsOrBuilder(int index); + + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return The parameters. + */ + com.google.cloud.vertexai.api.Tensor getParameters(); + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictResponse.java new file mode 100644 index 000000000000..26fdac4a32cf --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictResponse.java @@ -0,0 +1,1200 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [PredictionService.DirectPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectPredict].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DirectPredictResponse} + */ +public final class DirectPredictResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DirectPredictResponse) + DirectPredictResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use DirectPredictResponse.newBuilder() to construct. + private DirectPredictResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DirectPredictResponse() { + outputs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DirectPredictResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectPredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectPredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DirectPredictResponse.class, + com.google.cloud.vertexai.api.DirectPredictResponse.Builder.class); + } + + public static final int OUTPUTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List outputs_; + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + @java.lang.Override + public java.util.List getOutputsList() { + return outputs_; + } + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + @java.lang.Override + public java.util.List + getOutputsOrBuilderList() { + return outputs_; + } + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + @java.lang.Override + public int getOutputsCount() { + return outputs_.size(); + } + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getOutputs(int index) { + return outputs_.get(index); + } + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.TensorOrBuilder getOutputsOrBuilder(int index) { + return outputs_.get(index); + } + + public static final int PARAMETERS_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.Tensor parameters_; + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getParameters() { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder() { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < outputs_.size(); i++) { + output.writeMessage(1, outputs_.get(i)); + } + if (parameters_ != null) { + output.writeMessage(2, getParameters()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < outputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, outputs_.get(i)); + } + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getParameters()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DirectPredictResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DirectPredictResponse other = + (com.google.cloud.vertexai.api.DirectPredictResponse) obj; + + if (!getOutputsList().equals(other.getOutputsList())) return false; + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOutputsCount() > 0) { + hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getOutputsList().hashCode(); + } + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.DirectPredictResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [PredictionService.DirectPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectPredict].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DirectPredictResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DirectPredictResponse) + com.google.cloud.vertexai.api.DirectPredictResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectPredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectPredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DirectPredictResponse.class, + com.google.cloud.vertexai.api.DirectPredictResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DirectPredictResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + } else { + outputs_ = null; + outputsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectPredictResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectPredictResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DirectPredictResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectPredictResponse build() { + com.google.cloud.vertexai.api.DirectPredictResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectPredictResponse buildPartial() { + com.google.cloud.vertexai.api.DirectPredictResponse result = + new com.google.cloud.vertexai.api.DirectPredictResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.DirectPredictResponse result) { + if (outputsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.outputs_ = outputs_; + } else { + result.outputs_ = outputsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.DirectPredictResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parameters_ = parametersBuilder_ == null ? parameters_ : parametersBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DirectPredictResponse) { + return mergeFrom((com.google.cloud.vertexai.api.DirectPredictResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DirectPredictResponse other) { + if (other == com.google.cloud.vertexai.api.DirectPredictResponse.getDefaultInstance()) + return this; + if (outputsBuilder_ == null) { + if (!other.outputs_.isEmpty()) { + if (outputs_.isEmpty()) { + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOutputsIsMutable(); + outputs_.addAll(other.outputs_); + } + onChanged(); + } + } else { + if (!other.outputs_.isEmpty()) { + if (outputsBuilder_.isEmpty()) { + outputsBuilder_.dispose(); + outputsBuilder_ = null; + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000001); + outputsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOutputsFieldBuilder() + : null; + } else { + outputsBuilder_.addAllMessages(other.outputs_); + } + } + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vertexai.api.Tensor m = + input.readMessage( + com.google.cloud.vertexai.api.Tensor.parser(), extensionRegistry); + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(m); + } else { + outputsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage(getParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List outputs_ = + java.util.Collections.emptyList(); + + private void ensureOutputsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + outputs_ = new java.util.ArrayList(outputs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + outputsBuilder_; + + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public java.util.List getOutputsList() { + if (outputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(outputs_); + } else { + return outputsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public int getOutputsCount() { + if (outputsBuilder_ == null) { + return outputs_.size(); + } else { + return outputsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public com.google.cloud.vertexai.api.Tensor getOutputs(int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); + } else { + return outputsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder setOutputs(int index, com.google.cloud.vertexai.api.Tensor value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.set(index, value); + onChanged(); + } else { + outputsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder setOutputs( + int index, com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.set(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder addOutputs(com.google.cloud.vertexai.api.Tensor value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(value); + onChanged(); + } else { + outputsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder addOutputs(int index, com.google.cloud.vertexai.api.Tensor value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(index, value); + onChanged(); + } else { + outputsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder addOutputs(com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder addOutputs( + int index, com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder addAllOutputs( + java.lang.Iterable values) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, outputs_); + onChanged(); + } else { + outputsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder clearOutputs() { + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + outputsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder removeOutputs(int index) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.remove(index); + onChanged(); + } else { + outputsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public com.google.cloud.vertexai.api.Tensor.Builder getOutputsBuilder(int index) { + return getOutputsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public com.google.cloud.vertexai.api.TensorOrBuilder getOutputsOrBuilder(int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); + } else { + return outputsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public java.util.List + getOutputsOrBuilderList() { + if (outputsBuilder_ != null) { + return outputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outputs_); + } + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public com.google.cloud.vertexai.api.Tensor.Builder addOutputsBuilder() { + return getOutputsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public com.google.cloud.vertexai.api.Tensor.Builder addOutputsBuilder(int index) { + return getOutputsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public java.util.List getOutputsBuilderList() { + return getOutputsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + getOutputsFieldBuilder() { + if (outputsBuilder_ == null) { + outputsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder>( + outputs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + outputs_ = null; + } + return outputsBuilder_; + } + + private com.google.cloud.vertexai.api.Tensor parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return The parameters. + */ + public com.google.cloud.vertexai.api.Tensor getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public Builder setParameters(com.google.cloud.vertexai.api.Tensor value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + } else { + parametersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public Builder setParameters(com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public Builder mergeParameters(com.google.cloud.vertexai.api.Tensor value) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && parameters_ != null + && parameters_ != com.google.cloud.vertexai.api.Tensor.getDefaultInstance()) { + getParametersBuilder().mergeFrom(value); + } else { + parameters_ = value; + } + } else { + parametersBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public Builder clearParameters() { + bitField0_ = (bitField0_ & ~0x00000002); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public com.google.cloud.vertexai.api.Tensor.Builder getParametersBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DirectPredictResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DirectPredictResponse) + private static final com.google.cloud.vertexai.api.DirectPredictResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DirectPredictResponse(); + } + + public static com.google.cloud.vertexai.api.DirectPredictResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DirectPredictResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectPredictResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictResponseOrBuilder.java new file mode 100644 index 000000000000..5a1e30d62786 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectPredictResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface DirectPredictResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DirectPredictResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + java.util.List getOutputsList(); + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + com.google.cloud.vertexai.api.Tensor getOutputs(int index); + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + int getOutputsCount(); + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + java.util.List getOutputsOrBuilderList(); + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + com.google.cloud.vertexai.api.TensorOrBuilder getOutputsOrBuilder(int index); + + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return The parameters. + */ + com.google.cloud.vertexai.api.Tensor getParameters(); + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictRequest.java new file mode 100644 index 000000000000..c4c7b736652f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictRequest.java @@ -0,0 +1,975 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [PredictionService.DirectRawPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectRawPredict].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DirectRawPredictRequest} + */ +public final class DirectRawPredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DirectRawPredictRequest) + DirectRawPredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DirectRawPredictRequest.newBuilder() to construct. + private DirectRawPredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DirectRawPredictRequest() { + endpoint_ = ""; + methodName_ = ""; + input_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DirectRawPredictRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DirectRawPredictRequest.class, + com.google.cloud.vertexai.api.DirectRawPredictRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METHOD_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object methodName_ = ""; + /** + * + * + *
+   * Fully qualified name of the API method being invoked to perform
+   * predictions.
+   *
+   * Format:
+   * `/namespace.Service/Method/`
+   * Example:
+   * `/tensorflow.serving.PredictionService/Predict`
+   * 
+ * + * string method_name = 2; + * + * @return The methodName. + */ + @java.lang.Override + public java.lang.String getMethodName() { + java.lang.Object ref = methodName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + methodName_ = s; + return s; + } + } + /** + * + * + *
+   * Fully qualified name of the API method being invoked to perform
+   * predictions.
+   *
+   * Format:
+   * `/namespace.Service/Method/`
+   * Example:
+   * `/tensorflow.serving.PredictionService/Predict`
+   * 
+ * + * string method_name = 2; + * + * @return The bytes for methodName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString input_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * bytes input = 3; + * + * @return The input. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInput() { + return input_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(methodName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, methodName_); + } + if (!input_.isEmpty()) { + output.writeBytes(3, input_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(methodName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, methodName_); + } + if (!input_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, input_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DirectRawPredictRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DirectRawPredictRequest other = + (com.google.cloud.vertexai.api.DirectRawPredictRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (!getMethodName().equals(other.getMethodName())) return false; + if (!getInput().equals(other.getInput())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + hash = (37 * hash) + METHOD_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMethodName().hashCode(); + hash = (37 * hash) + INPUT_FIELD_NUMBER; + hash = (53 * hash) + getInput().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.DirectRawPredictRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [PredictionService.DirectRawPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectRawPredict].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DirectRawPredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DirectRawPredictRequest) + com.google.cloud.vertexai.api.DirectRawPredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DirectRawPredictRequest.class, + com.google.cloud.vertexai.api.DirectRawPredictRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DirectRawPredictRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + methodName_ = ""; + input_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectRawPredictRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DirectRawPredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectRawPredictRequest build() { + com.google.cloud.vertexai.api.DirectRawPredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectRawPredictRequest buildPartial() { + com.google.cloud.vertexai.api.DirectRawPredictRequest result = + new com.google.cloud.vertexai.api.DirectRawPredictRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.DirectRawPredictRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.methodName_ = methodName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.input_ = input_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DirectRawPredictRequest) { + return mergeFrom((com.google.cloud.vertexai.api.DirectRawPredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DirectRawPredictRequest other) { + if (other == com.google.cloud.vertexai.api.DirectRawPredictRequest.getDefaultInstance()) + return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getMethodName().isEmpty()) { + methodName_ = other.methodName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getInput() != com.google.protobuf.ByteString.EMPTY) { + setInput(other.getInput()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + methodName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input_ = input.readBytes(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object methodName_ = ""; + /** + * + * + *
+     * Fully qualified name of the API method being invoked to perform
+     * predictions.
+     *
+     * Format:
+     * `/namespace.Service/Method/`
+     * Example:
+     * `/tensorflow.serving.PredictionService/Predict`
+     * 
+ * + * string method_name = 2; + * + * @return The methodName. + */ + public java.lang.String getMethodName() { + java.lang.Object ref = methodName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + methodName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Fully qualified name of the API method being invoked to perform
+     * predictions.
+     *
+     * Format:
+     * `/namespace.Service/Method/`
+     * Example:
+     * `/tensorflow.serving.PredictionService/Predict`
+     * 
+ * + * string method_name = 2; + * + * @return The bytes for methodName. + */ + public com.google.protobuf.ByteString getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Fully qualified name of the API method being invoked to perform
+     * predictions.
+     *
+     * Format:
+     * `/namespace.Service/Method/`
+     * Example:
+     * `/tensorflow.serving.PredictionService/Predict`
+     * 
+ * + * string method_name = 2; + * + * @param value The methodName to set. + * @return This builder for chaining. + */ + public Builder setMethodName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + methodName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Fully qualified name of the API method being invoked to perform
+     * predictions.
+     *
+     * Format:
+     * `/namespace.Service/Method/`
+     * Example:
+     * `/tensorflow.serving.PredictionService/Predict`
+     * 
+ * + * string method_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearMethodName() { + methodName_ = getDefaultInstance().getMethodName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Fully qualified name of the API method being invoked to perform
+     * predictions.
+     *
+     * Format:
+     * `/namespace.Service/Method/`
+     * Example:
+     * `/tensorflow.serving.PredictionService/Predict`
+     * 
+ * + * string method_name = 2; + * + * @param value The bytes for methodName to set. + * @return This builder for chaining. + */ + public Builder setMethodNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + methodName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString input_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * bytes input = 3; + * + * @return The input. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInput() { + return input_; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * bytes input = 3; + * + * @param value The input to set. + * @return This builder for chaining. + */ + public Builder setInput(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * bytes input = 3; + * + * @return This builder for chaining. + */ + public Builder clearInput() { + bitField0_ = (bitField0_ & ~0x00000004); + input_ = getDefaultInstance().getInput(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DirectRawPredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DirectRawPredictRequest) + private static final com.google.cloud.vertexai.api.DirectRawPredictRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DirectRawPredictRequest(); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DirectRawPredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectRawPredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictRequestOrBuilder.java new file mode 100644 index 000000000000..f00c220d5957 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictRequestOrBuilder.java @@ -0,0 +1,108 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface DirectRawPredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DirectRawPredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * Fully qualified name of the API method being invoked to perform
+   * predictions.
+   *
+   * Format:
+   * `/namespace.Service/Method/`
+   * Example:
+   * `/tensorflow.serving.PredictionService/Predict`
+   * 
+ * + * string method_name = 2; + * + * @return The methodName. + */ + java.lang.String getMethodName(); + /** + * + * + *
+   * Fully qualified name of the API method being invoked to perform
+   * predictions.
+   *
+   * Format:
+   * `/namespace.Service/Method/`
+   * Example:
+   * `/tensorflow.serving.PredictionService/Predict`
+   * 
+ * + * string method_name = 2; + * + * @return The bytes for methodName. + */ + com.google.protobuf.ByteString getMethodNameBytes(); + + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * bytes input = 3; + * + * @return The input. + */ + com.google.protobuf.ByteString getInput(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictResponse.java new file mode 100644 index 000000000000..22423e77ce79 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictResponse.java @@ -0,0 +1,541 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [PredictionService.DirectRawPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectRawPredict].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DirectRawPredictResponse} + */ +public final class DirectRawPredictResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DirectRawPredictResponse) + DirectRawPredictResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use DirectRawPredictResponse.newBuilder() to construct. + private DirectRawPredictResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DirectRawPredictResponse() { + output_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DirectRawPredictResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DirectRawPredictResponse.class, + com.google.cloud.vertexai.api.DirectRawPredictResponse.Builder.class); + } + + public static final int OUTPUT_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString output_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * bytes output = 1; + * + * @return The output. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutput() { + return output_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!output_.isEmpty()) { + output.writeBytes(1, output_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!output_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, output_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DirectRawPredictResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DirectRawPredictResponse other = + (com.google.cloud.vertexai.api.DirectRawPredictResponse) obj; + + if (!getOutput().equals(other.getOutput())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getOutput().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.DirectRawPredictResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [PredictionService.DirectRawPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectRawPredict].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DirectRawPredictResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DirectRawPredictResponse) + com.google.cloud.vertexai.api.DirectRawPredictResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DirectRawPredictResponse.class, + com.google.cloud.vertexai.api.DirectRawPredictResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DirectRawPredictResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + output_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectRawPredictResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DirectRawPredictResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectRawPredictResponse build() { + com.google.cloud.vertexai.api.DirectRawPredictResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectRawPredictResponse buildPartial() { + com.google.cloud.vertexai.api.DirectRawPredictResponse result = + new com.google.cloud.vertexai.api.DirectRawPredictResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.DirectRawPredictResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.output_ = output_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DirectRawPredictResponse) { + return mergeFrom((com.google.cloud.vertexai.api.DirectRawPredictResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DirectRawPredictResponse other) { + if (other == com.google.cloud.vertexai.api.DirectRawPredictResponse.getDefaultInstance()) + return this; + if (other.getOutput() != com.google.protobuf.ByteString.EMPTY) { + setOutput(other.getOutput()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + output_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString output_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * bytes output = 1; + * + * @return The output. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutput() { + return output_; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * bytes output = 1; + * + * @param value The output to set. + * @return This builder for chaining. + */ + public Builder setOutput(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + output_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * bytes output = 1; + * + * @return This builder for chaining. + */ + public Builder clearOutput() { + bitField0_ = (bitField0_ & ~0x00000001); + output_ = getDefaultInstance().getOutput(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DirectRawPredictResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DirectRawPredictResponse) + private static final com.google.cloud.vertexai.api.DirectRawPredictResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DirectRawPredictResponse(); + } + + public static com.google.cloud.vertexai.api.DirectRawPredictResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DirectRawPredictResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DirectRawPredictResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictResponseOrBuilder.java new file mode 100644 index 000000000000..2bdfa6fcec86 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DirectRawPredictResponseOrBuilder.java @@ -0,0 +1,38 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface DirectRawPredictResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DirectRawPredictResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * bytes output = 1; + * + * @return The output. + */ + com.google.protobuf.ByteString getOutput(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DiskSpec.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DiskSpec.java new file mode 100644 index 000000000000..f10b0c3a2b0e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DiskSpec.java @@ -0,0 +1,729 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Represents the spec of disk options.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DiskSpec} + */ +public final class DiskSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DiskSpec) + DiskSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use DiskSpec.newBuilder() to construct. + private DiskSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DiskSpec() { + bootDiskType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DiskSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_DiskSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_DiskSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DiskSpec.class, + com.google.cloud.vertexai.api.DiskSpec.Builder.class); + } + + public static final int BOOT_DISK_TYPE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object bootDiskType_ = ""; + /** + * + * + *
+   * Type of the boot disk (default is "pd-ssd").
+   * Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or
+   * "pd-standard" (Persistent Disk Hard Disk Drive).
+   * 
+ * + * string boot_disk_type = 1; + * + * @return The bootDiskType. + */ + @java.lang.Override + public java.lang.String getBootDiskType() { + java.lang.Object ref = bootDiskType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bootDiskType_ = s; + return s; + } + } + /** + * + * + *
+   * Type of the boot disk (default is "pd-ssd").
+   * Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or
+   * "pd-standard" (Persistent Disk Hard Disk Drive).
+   * 
+ * + * string boot_disk_type = 1; + * + * @return The bytes for bootDiskType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBootDiskTypeBytes() { + java.lang.Object ref = bootDiskType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bootDiskType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOT_DISK_SIZE_GB_FIELD_NUMBER = 2; + private int bootDiskSizeGb_ = 0; + /** + * + * + *
+   * Size in GB of the boot disk (default is 100GB).
+   * 
+ * + * int32 boot_disk_size_gb = 2; + * + * @return The bootDiskSizeGb. + */ + @java.lang.Override + public int getBootDiskSizeGb() { + return bootDiskSizeGb_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bootDiskType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bootDiskType_); + } + if (bootDiskSizeGb_ != 0) { + output.writeInt32(2, bootDiskSizeGb_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bootDiskType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bootDiskType_); + } + if (bootDiskSizeGb_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, bootDiskSizeGb_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DiskSpec)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DiskSpec other = (com.google.cloud.vertexai.api.DiskSpec) obj; + + if (!getBootDiskType().equals(other.getBootDiskType())) return false; + if (getBootDiskSizeGb() != other.getBootDiskSizeGb()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BOOT_DISK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getBootDiskType().hashCode(); + hash = (37 * hash) + BOOT_DISK_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + getBootDiskSizeGb(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DiskSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DiskSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.DiskSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the spec of disk options.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DiskSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DiskSpec) + com.google.cloud.vertexai.api.DiskSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_DiskSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_DiskSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DiskSpec.class, + com.google.cloud.vertexai.api.DiskSpec.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DiskSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bootDiskType_ = ""; + bootDiskSizeGb_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_DiskSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DiskSpec getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DiskSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DiskSpec build() { + com.google.cloud.vertexai.api.DiskSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DiskSpec buildPartial() { + com.google.cloud.vertexai.api.DiskSpec result = + new com.google.cloud.vertexai.api.DiskSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.DiskSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.bootDiskType_ = bootDiskType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.bootDiskSizeGb_ = bootDiskSizeGb_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DiskSpec) { + return mergeFrom((com.google.cloud.vertexai.api.DiskSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DiskSpec other) { + if (other == com.google.cloud.vertexai.api.DiskSpec.getDefaultInstance()) return this; + if (!other.getBootDiskType().isEmpty()) { + bootDiskType_ = other.bootDiskType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getBootDiskSizeGb() != 0) { + setBootDiskSizeGb(other.getBootDiskSizeGb()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + bootDiskType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + bootDiskSizeGb_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object bootDiskType_ = ""; + /** + * + * + *
+     * Type of the boot disk (default is "pd-ssd").
+     * Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or
+     * "pd-standard" (Persistent Disk Hard Disk Drive).
+     * 
+ * + * string boot_disk_type = 1; + * + * @return The bootDiskType. + */ + public java.lang.String getBootDiskType() { + java.lang.Object ref = bootDiskType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bootDiskType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Type of the boot disk (default is "pd-ssd").
+     * Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or
+     * "pd-standard" (Persistent Disk Hard Disk Drive).
+     * 
+ * + * string boot_disk_type = 1; + * + * @return The bytes for bootDiskType. + */ + public com.google.protobuf.ByteString getBootDiskTypeBytes() { + java.lang.Object ref = bootDiskType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bootDiskType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Type of the boot disk (default is "pd-ssd").
+     * Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or
+     * "pd-standard" (Persistent Disk Hard Disk Drive).
+     * 
+ * + * string boot_disk_type = 1; + * + * @param value The bootDiskType to set. + * @return This builder for chaining. + */ + public Builder setBootDiskType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bootDiskType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the boot disk (default is "pd-ssd").
+     * Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or
+     * "pd-standard" (Persistent Disk Hard Disk Drive).
+     * 
+ * + * string boot_disk_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearBootDiskType() { + bootDiskType_ = getDefaultInstance().getBootDiskType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the boot disk (default is "pd-ssd").
+     * Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or
+     * "pd-standard" (Persistent Disk Hard Disk Drive).
+     * 
+ * + * string boot_disk_type = 1; + * + * @param value The bytes for bootDiskType to set. + * @return This builder for chaining. + */ + public Builder setBootDiskTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bootDiskType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int bootDiskSizeGb_; + /** + * + * + *
+     * Size in GB of the boot disk (default is 100GB).
+     * 
+ * + * int32 boot_disk_size_gb = 2; + * + * @return The bootDiskSizeGb. + */ + @java.lang.Override + public int getBootDiskSizeGb() { + return bootDiskSizeGb_; + } + /** + * + * + *
+     * Size in GB of the boot disk (default is 100GB).
+     * 
+ * + * int32 boot_disk_size_gb = 2; + * + * @param value The bootDiskSizeGb to set. + * @return This builder for chaining. + */ + public Builder setBootDiskSizeGb(int value) { + + bootDiskSizeGb_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Size in GB of the boot disk (default is 100GB).
+     * 
+ * + * int32 boot_disk_size_gb = 2; + * + * @return This builder for chaining. + */ + public Builder clearBootDiskSizeGb() { + bitField0_ = (bitField0_ & ~0x00000002); + bootDiskSizeGb_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DiskSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DiskSpec) + private static final com.google.cloud.vertexai.api.DiskSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DiskSpec(); + } + + public static com.google.cloud.vertexai.api.DiskSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DiskSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DiskSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DiskSpecOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DiskSpecOrBuilder.java new file mode 100644 index 000000000000..40ac9f31dc65 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DiskSpecOrBuilder.java @@ -0,0 +1,67 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +public interface DiskSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DiskSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Type of the boot disk (default is "pd-ssd").
+   * Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or
+   * "pd-standard" (Persistent Disk Hard Disk Drive).
+   * 
+ * + * string boot_disk_type = 1; + * + * @return The bootDiskType. + */ + java.lang.String getBootDiskType(); + /** + * + * + *
+   * Type of the boot disk (default is "pd-ssd").
+   * Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or
+   * "pd-standard" (Persistent Disk Hard Disk Drive).
+   * 
+ * + * string boot_disk_type = 1; + * + * @return The bytes for bootDiskType. + */ + com.google.protobuf.ByteString getBootDiskTypeBytes(); + + /** + * + * + *
+   * Size in GB of the boot disk (default is 100GB).
+   * 
+ * + * int32 boot_disk_size_gb = 2; + * + * @return The bootDiskSizeGb. + */ + int getBootDiskSizeGb(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DoubleArray.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DoubleArray.java new file mode 100644 index 000000000000..29d43e148001 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DoubleArray.java @@ -0,0 +1,682 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A list of double values.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DoubleArray} + */ +public final class DoubleArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.DoubleArray) + DoubleArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use DoubleArray.newBuilder() to construct. + private DoubleArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DoubleArray() { + values_ = emptyDoubleList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DoubleArray(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_DoubleArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_DoubleArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DoubleArray.class, + com.google.cloud.vertexai.api.DoubleArray.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList values_; + /** + * + * + *
+   * A list of double values.
+   * 
+ * + * repeated double values = 1; + * + * @return A list containing the values. + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * A list of double values.
+   * 
+ * + * repeated double values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * A list of double values.
+   * 
+ * + * repeated double values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public double getValues(int index) { + return values_.getDouble(index); + } + + private int valuesMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (getValuesList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valuesMemoizedSerializedSize); + } + for (int i = 0; i < values_.size(); i++) { + output.writeDoubleNoTag(values_.getDouble(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 8 * getValuesList().size(); + size += dataSize; + if (!getValuesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + valuesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.DoubleArray)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.DoubleArray other = + (com.google.cloud.vertexai.api.DoubleArray) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.DoubleArray parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.DoubleArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.DoubleArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A list of double values.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.DoubleArray} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.DoubleArray) + com.google.cloud.vertexai.api.DoubleArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_DoubleArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_DoubleArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.DoubleArray.class, + com.google.cloud.vertexai.api.DoubleArray.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.DoubleArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + values_ = emptyDoubleList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_DoubleArray_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DoubleArray getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.DoubleArray.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DoubleArray build() { + com.google.cloud.vertexai.api.DoubleArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DoubleArray buildPartial() { + com.google.cloud.vertexai.api.DoubleArray result = + new com.google.cloud.vertexai.api.DoubleArray(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.DoubleArray result) { + if (((bitField0_ & 0x00000001) != 0)) { + values_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } + + private void buildPartial0(com.google.cloud.vertexai.api.DoubleArray result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.DoubleArray) { + return mergeFrom((com.google.cloud.vertexai.api.DoubleArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.DoubleArray other) { + if (other == com.google.cloud.vertexai.api.DoubleArray.getDefaultInstance()) return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + double v = input.readDouble(); + ensureValuesIsMutable(); + values_.addDouble(v); + break; + } // case 9 + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValuesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + values_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.DoubleList values_ = emptyDoubleList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = mutableCopy(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A list of double values.
+     * 
+ * + * repeated double values = 1; + * + * @return A list containing the values. + */ + public java.util.List getValuesList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(values_) + : values_; + } + /** + * + * + *
+     * A list of double values.
+     * 
+ * + * repeated double values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * A list of double values.
+     * 
+ * + * repeated double values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public double getValues(int index) { + return values_.getDouble(index); + } + /** + * + * + *
+     * A list of double values.
+     * 
+ * + * repeated double values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, double value) { + + ensureValuesIsMutable(); + values_.setDouble(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of double values.
+     * 
+ * + * repeated double values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(double value) { + + ensureValuesIsMutable(); + values_.addDouble(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of double values.
+     * 
+ * + * repeated double values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of double values.
+     * 
+ * + * repeated double values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.DoubleArray) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.DoubleArray) + private static final com.google.cloud.vertexai.api.DoubleArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DoubleArray(); + } + + public static com.google.cloud.vertexai.api.DoubleArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DoubleArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.DoubleArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DoubleArrayOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DoubleArrayOrBuilder.java new file mode 100644 index 000000000000..fb02a5fbf995 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/DoubleArrayOrBuilder.java @@ -0,0 +1,63 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +public interface DoubleArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.DoubleArray) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of double values.
+   * 
+ * + * repeated double values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * A list of double values.
+   * 
+ * + * repeated double values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * A list of double values.
+   * 
+ * + * repeated double values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + double getValues(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EncryptionSpec.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EncryptionSpec.java new file mode 100644 index 000000000000..9b467c9260d6 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EncryptionSpec.java @@ -0,0 +1,653 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/encryption_spec.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Represents a customer-managed encryption key spec that can be applied to
+ * a top-level resource.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.EncryptionSpec} + */ +public final class EncryptionSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.EncryptionSpec) + EncryptionSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use EncryptionSpec.newBuilder() to construct. + private EncryptionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EncryptionSpec() { + kmsKeyName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EncryptionSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EncryptionSpecProto + .internal_static_google_cloud_vertexai_v1beta1_EncryptionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EncryptionSpecProto + .internal_static_google_cloud_vertexai_v1beta1_EncryptionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.EncryptionSpec.class, + com.google.cloud.vertexai.api.EncryptionSpec.Builder.class); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+   * Required. The Cloud KMS resource identifier of the customer managed
+   * encryption key used to protect a resource. Has the form:
+   * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+   * The key needs to be in the same region as where the compute resource is
+   * created.
+   * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Cloud KMS resource identifier of the customer managed
+   * encryption key used to protect a resource. Has the form:
+   * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+   * The key needs to be in the same region as where the compute resource is
+   * created.
+   * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kmsKeyName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kmsKeyName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.EncryptionSpec)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.EncryptionSpec other = + (com.google.cloud.vertexai.api.EncryptionSpec) obj; + + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.EncryptionSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a customer-managed encryption key spec that can be applied to
+   * a top-level resource.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.EncryptionSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.EncryptionSpec) + com.google.cloud.vertexai.api.EncryptionSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EncryptionSpecProto + .internal_static_google_cloud_vertexai_v1beta1_EncryptionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EncryptionSpecProto + .internal_static_google_cloud_vertexai_v1beta1_EncryptionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.EncryptionSpec.class, + com.google.cloud.vertexai.api.EncryptionSpec.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.EncryptionSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + kmsKeyName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EncryptionSpecProto + .internal_static_google_cloud_vertexai_v1beta1_EncryptionSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.EncryptionSpec getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.EncryptionSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.EncryptionSpec build() { + com.google.cloud.vertexai.api.EncryptionSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.EncryptionSpec buildPartial() { + com.google.cloud.vertexai.api.EncryptionSpec result = + new com.google.cloud.vertexai.api.EncryptionSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.EncryptionSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.EncryptionSpec) { + return mergeFrom((com.google.cloud.vertexai.api.EncryptionSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.EncryptionSpec other) { + if (other == com.google.cloud.vertexai.api.EncryptionSpec.getDefaultInstance()) return this; + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * Required. The Cloud KMS resource identifier of the customer managed
+     * encryption key used to protect a resource. Has the form:
+     * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+     * The key needs to be in the same region as where the compute resource is
+     * created.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Cloud KMS resource identifier of the customer managed
+     * encryption key used to protect a resource. Has the form:
+     * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+     * The key needs to be in the same region as where the compute resource is
+     * created.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Cloud KMS resource identifier of the customer managed
+     * encryption key used to protect a resource. Has the form:
+     * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+     * The key needs to be in the same region as where the compute resource is
+     * created.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Cloud KMS resource identifier of the customer managed
+     * encryption key used to protect a resource. Has the form:
+     * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+     * The key needs to be in the same region as where the compute resource is
+     * created.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Cloud KMS resource identifier of the customer managed
+     * encryption key used to protect a resource. Has the form:
+     * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+     * The key needs to be in the same region as where the compute resource is
+     * created.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.EncryptionSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.EncryptionSpec) + private static final com.google.cloud.vertexai.api.EncryptionSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.EncryptionSpec(); + } + + public static com.google.cloud.vertexai.api.EncryptionSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.EncryptionSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EncryptionSpecOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EncryptionSpecOrBuilder.java new file mode 100644 index 000000000000..c1cf0c9c0662 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EncryptionSpecOrBuilder.java @@ -0,0 +1,58 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/encryption_spec.proto + +package com.google.cloud.vertexai.api; + +public interface EncryptionSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.EncryptionSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Cloud KMS resource identifier of the customer managed
+   * encryption key used to protect a resource. Has the form:
+   * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+   * The key needs to be in the same region as where the compute resource is
+   * created.
+   * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * Required. The Cloud KMS resource identifier of the customer managed
+   * encryption key used to protect a resource. Has the form:
+   * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+   * The key needs to be in the same region as where the compute resource is
+   * created.
+   * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EncryptionSpecProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EncryptionSpecProto.java new file mode 100644 index 000000000000..df6c52e145aa --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EncryptionSpecProto.java @@ -0,0 +1,77 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/encryption_spec.proto + +package com.google.cloud.vertexai.api; + +public final class EncryptionSpecProto { + private EncryptionSpecProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_EncryptionSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_EncryptionSpec_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/vertexai/v1beta1/encrypti" + + "on_spec.proto\022\035google.cloud.vertexai.v1b" + + "eta1\032\037google/api/field_behavior.proto\",\n" + + "\016EncryptionSpec\022\032\n\014kms_key_name\030\001 \001(\tB\004\342" + + "A\001\002B\330\001\n\035com.google.cloud.vertexai.apiB\023E" + + "ncryptionSpecProtoP\001Z=cloud.google.com/g" + + "o/vertexai/apiv1beta1/vertexaipb;vertexa" + + "ipb\252\002\035Google.Cloud.VertexAI.V1Beta1\312\002\035Go" + + "ogle\\Cloud\\VertexAI\\V1beta1\352\002 Google::Cl" + + "oud::VertexAI::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_EncryptionSpec_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_EncryptionSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_EncryptionSpec_descriptor, + new java.lang.String[] { + "KmsKeyName", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Endpoint.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Endpoint.java new file mode 100644 index 000000000000..20f98b04f2fb --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Endpoint.java @@ -0,0 +1,4446 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Models are deployed into it, and afterwards Endpoint is called to obtain
+ * predictions and explanations.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Endpoint} + */ +public final class Endpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Endpoint) + EndpointOrBuilder { + private static final long serialVersionUID = 0L; + // Use Endpoint.newBuilder() to construct. + private Endpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Endpoint() { + name_ = ""; + displayName_ = ""; + description_ = ""; + deployedModels_ = java.util.Collections.emptyList(); + etag_ = ""; + network_ = ""; + modelDeploymentMonitoringJob_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Endpoint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_Endpoint_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetTrafficSplit(); + case 7: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_Endpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Endpoint.class, + com.google.cloud.vertexai.api.Endpoint.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The resource name of the Endpoint.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the Endpoint.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Required. The display name of the Endpoint.
+   * The name can be up to 128 characters long and can consist of any UTF-8
+   * characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The display name of the Endpoint.
+   * The name can be up to 128 characters long and can consist of any UTF-8
+   * characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * The description of the Endpoint.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * The description of the Endpoint.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPLOYED_MODELS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List deployedModels_; + /** + * + * + *
+   * Output only. The models deployed in this Endpoint.
+   * To add or remove DeployedModels use
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+   * and
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+   * respectively.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getDeployedModelsList() { + return deployedModels_; + } + /** + * + * + *
+   * Output only. The models deployed in this Endpoint.
+   * To add or remove DeployedModels use
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+   * and
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+   * respectively.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDeployedModelsOrBuilderList() { + return deployedModels_; + } + /** + * + * + *
+   * Output only. The models deployed in this Endpoint.
+   * To add or remove DeployedModels use
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+   * and
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+   * respectively.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDeployedModelsCount() { + return deployedModels_.size(); + } + /** + * + * + *
+   * Output only. The models deployed in this Endpoint.
+   * To add or remove DeployedModels use
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+   * and
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+   * respectively.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModel getDeployedModels(int index) { + return deployedModels_.get(index); + } + /** + * + * + *
+   * Output only. The models deployed in this Endpoint.
+   * To add or remove DeployedModels use
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+   * and
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+   * respectively.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelsOrBuilder( + int index) { + return deployedModels_.get(index); + } + + public static final int TRAFFIC_SPLIT_FIELD_NUMBER = 5; + + private static final class TrafficSplitDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_Endpoint_TrafficSplitEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField trafficSplit_; + + private com.google.protobuf.MapField + internalGetTrafficSplit() { + if (trafficSplit_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TrafficSplitDefaultEntryHolder.defaultEntry); + } + return trafficSplit_; + } + + public int getTrafficSplitCount() { + return internalGetTrafficSplit().getMap().size(); + } + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * If a DeployedModel's ID is not listed in this map, then it receives no
+   * traffic.
+   *
+   * The traffic percentage values must add up to 100, or map must be empty if
+   * the Endpoint is to not accept any traffic at a moment.
+   * 
+ * + * map<string, int32> traffic_split = 5; + */ + @java.lang.Override + public boolean containsTrafficSplit(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTrafficSplit().getMap().containsKey(key); + } + /** Use {@link #getTrafficSplitMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTrafficSplit() { + return getTrafficSplitMap(); + } + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * If a DeployedModel's ID is not listed in this map, then it receives no
+   * traffic.
+   *
+   * The traffic percentage values must add up to 100, or map must be empty if
+   * the Endpoint is to not accept any traffic at a moment.
+   * 
+ * + * map<string, int32> traffic_split = 5; + */ + @java.lang.Override + public java.util.Map getTrafficSplitMap() { + return internalGetTrafficSplit().getMap(); + } + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * If a DeployedModel's ID is not listed in this map, then it receives no
+   * traffic.
+   *
+   * The traffic percentage values must add up to 100, or map must be empty if
+   * the Endpoint is to not accept any traffic at a moment.
+   * 
+ * + * map<string, int32> traffic_split = 5; + */ + @java.lang.Override + public int getTrafficSplitOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * If a DeployedModel's ID is not listed in this map, then it receives no
+   * traffic.
+   *
+   * The traffic percentage values must add up to 100, or map must be empty if
+   * the Endpoint is to not accept any traffic at a moment.
+   * 
+ * + * map<string, int32> traffic_split = 5; + */ + @java.lang.Override + public int getTrafficSplitOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ETAG_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Used to perform consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 6; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Used to perform consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 6; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 7; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_Endpoint_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * The labels with user-defined metadata to organize your Endpoints.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * The labels with user-defined metadata to organize your Endpoints.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * The labels with user-defined metadata to organize your Endpoints.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The labels with user-defined metadata to organize your Endpoints.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int ENCRYPTION_SPEC_FIELD_NUMBER = 10; + private com.google.cloud.vertexai.api.EncryptionSpec encryptionSpec_; + /** + * + * + *
+   * Customer-managed encryption key spec for an Endpoint. If set, this
+   * Endpoint and all sub-resources of this Endpoint will be secured by
+   * this key.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + * + * @return Whether the encryptionSpec field is set. + */ + @java.lang.Override + public boolean hasEncryptionSpec() { + return encryptionSpec_ != null; + } + /** + * + * + *
+   * Customer-managed encryption key spec for an Endpoint. If set, this
+   * Endpoint and all sub-resources of this Endpoint will be secured by
+   * this key.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + * + * @return The encryptionSpec. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.EncryptionSpec getEncryptionSpec() { + return encryptionSpec_ == null + ? com.google.cloud.vertexai.api.EncryptionSpec.getDefaultInstance() + : encryptionSpec_; + } + /** + * + * + *
+   * Customer-managed encryption key spec for an Endpoint. If set, this
+   * Endpoint and all sub-resources of this Endpoint will be secured by
+   * this key.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.EncryptionSpecOrBuilder getEncryptionSpecOrBuilder() { + return encryptionSpec_ == null + ? com.google.cloud.vertexai.api.EncryptionSpec.getDefaultInstance() + : encryptionSpec_; + } + + public static final int NETWORK_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * Optional. The full name of the Google Compute Engine
+   * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks)
+   * to which the Endpoint should be peered.
+   *
+   * Private services access must already be configured for the network. If left
+   * unspecified, the Endpoint is not peered with any network.
+   *
+   * Only one of the fields,
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+   * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+   * can be set.
+   *
+   * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert):
+   * `projects/{project}/global/networks/{network}`.
+   * Where `{project}` is a project number, as in `12345`, and `{network}` is
+   * network name.
+   * 
+ * + * + * string network = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The full name of the Google Compute Engine
+   * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks)
+   * to which the Endpoint should be peered.
+   *
+   * Private services access must already be configured for the network. If left
+   * unspecified, the Endpoint is not peered with any network.
+   *
+   * Only one of the fields,
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+   * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+   * can be set.
+   *
+   * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert):
+   * `projects/{project}/global/networks/{network}`.
+   * Where `{project}` is a project number, as in `12345`, and `{network}` is
+   * network name.
+   * 
+ * + * + * string network = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_PRIVATE_SERVICE_CONNECT_FIELD_NUMBER = 17; + private boolean enablePrivateServiceConnect_ = false; + /** + * + * + *
+   * Deprecated: If true, expose the Endpoint via private service connect.
+   *
+   * Only one of the fields,
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+   * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+   * can be set.
+   * 
+ * + * bool enable_private_service_connect = 17 [deprecated = true]; + * + * @deprecated google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect is + * deprecated. See google/cloud/vertexai/v1beta1/endpoint.proto;l=126 + * @return The enablePrivateServiceConnect. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getEnablePrivateServiceConnect() { + return enablePrivateServiceConnect_; + } + + public static final int MODEL_DEPLOYMENT_MONITORING_JOB_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object modelDeploymentMonitoringJob_ = ""; + /** + * + * + *
+   * Output only. Resource name of the Model Monitoring job associated with this
+   * Endpoint if monitoring is enabled by
+   * [JobService.CreateModelDeploymentMonitoringJob][google.cloud.vertexai.v1beta1.JobService.CreateModelDeploymentMonitoringJob].
+   * Format:
+   * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
+   * 
+ * + * + * string model_deployment_monitoring_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The modelDeploymentMonitoringJob. + */ + @java.lang.Override + public java.lang.String getModelDeploymentMonitoringJob() { + java.lang.Object ref = modelDeploymentMonitoringJob_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelDeploymentMonitoringJob_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Resource name of the Model Monitoring job associated with this
+   * Endpoint if monitoring is enabled by
+   * [JobService.CreateModelDeploymentMonitoringJob][google.cloud.vertexai.v1beta1.JobService.CreateModelDeploymentMonitoringJob].
+   * Format:
+   * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
+   * 
+ * + * + * string model_deployment_monitoring_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for modelDeploymentMonitoringJob. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelDeploymentMonitoringJobBytes() { + java.lang.Object ref = modelDeploymentMonitoringJob_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelDeploymentMonitoringJob_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREDICT_REQUEST_RESPONSE_LOGGING_CONFIG_FIELD_NUMBER = 18; + private com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + predictRequestResponseLoggingConfig_; + /** + * + * + *
+   * Configures the request-response logging for online prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + * + * @return Whether the predictRequestResponseLoggingConfig field is set. + */ + @java.lang.Override + public boolean hasPredictRequestResponseLoggingConfig() { + return predictRequestResponseLoggingConfig_ != null; + } + /** + * + * + *
+   * Configures the request-response logging for online prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + * + * @return The predictRequestResponseLoggingConfig. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + getPredictRequestResponseLoggingConfig() { + return predictRequestResponseLoggingConfig_ == null + ? com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.getDefaultInstance() + : predictRequestResponseLoggingConfig_; + } + /** + * + * + *
+   * Configures the request-response logging for online prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfigOrBuilder + getPredictRequestResponseLoggingConfigOrBuilder() { + return predictRequestResponseLoggingConfig_ == null + ? com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.getDefaultInstance() + : predictRequestResponseLoggingConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + for (int i = 0; i < deployedModels_.size(); i++) { + output.writeMessage(4, deployedModels_.get(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetTrafficSplit(), TrafficSplitDefaultEntryHolder.defaultEntry, 5); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7); + if (createTime_ != null) { + output.writeMessage(8, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(9, getUpdateTime()); + } + if (encryptionSpec_ != null) { + output.writeMessage(10, getEncryptionSpec()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelDeploymentMonitoringJob_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, modelDeploymentMonitoringJob_); + } + if (enablePrivateServiceConnect_ != false) { + output.writeBool(17, enablePrivateServiceConnect_); + } + if (predictRequestResponseLoggingConfig_ != null) { + output.writeMessage(18, getPredictRequestResponseLoggingConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + for (int i = 0; i < deployedModels_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, deployedModels_.get(i)); + } + for (java.util.Map.Entry entry : + internalGetTrafficSplit().getMap().entrySet()) { + com.google.protobuf.MapEntry trafficSplit__ = + TrafficSplitDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, trafficSplit__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, etag_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getUpdateTime()); + } + if (encryptionSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getEncryptionSpec()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, network_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelDeploymentMonitoringJob_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 14, modelDeploymentMonitoringJob_); + } + if (enablePrivateServiceConnect_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(17, enablePrivateServiceConnect_); + } + if (predictRequestResponseLoggingConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 18, getPredictRequestResponseLoggingConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Endpoint)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Endpoint other = (com.google.cloud.vertexai.api.Endpoint) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getDeployedModelsList().equals(other.getDeployedModelsList())) return false; + if (!internalGetTrafficSplit().equals(other.internalGetTrafficSplit())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasEncryptionSpec() != other.hasEncryptionSpec()) return false; + if (hasEncryptionSpec()) { + if (!getEncryptionSpec().equals(other.getEncryptionSpec())) return false; + } + if (!getNetwork().equals(other.getNetwork())) return false; + if (getEnablePrivateServiceConnect() != other.getEnablePrivateServiceConnect()) return false; + if (!getModelDeploymentMonitoringJob().equals(other.getModelDeploymentMonitoringJob())) + return false; + if (hasPredictRequestResponseLoggingConfig() != other.hasPredictRequestResponseLoggingConfig()) + return false; + if (hasPredictRequestResponseLoggingConfig()) { + if (!getPredictRequestResponseLoggingConfig() + .equals(other.getPredictRequestResponseLoggingConfig())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getDeployedModelsCount() > 0) { + hash = (37 * hash) + DEPLOYED_MODELS_FIELD_NUMBER; + hash = (53 * hash) + getDeployedModelsList().hashCode(); + } + if (!internalGetTrafficSplit().getMap().isEmpty()) { + hash = (37 * hash) + TRAFFIC_SPLIT_FIELD_NUMBER; + hash = (53 * hash) + internalGetTrafficSplit().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasEncryptionSpec()) { + hash = (37 * hash) + ENCRYPTION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionSpec().hashCode(); + } + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + ENABLE_PRIVATE_SERVICE_CONNECT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnablePrivateServiceConnect()); + hash = (37 * hash) + MODEL_DEPLOYMENT_MONITORING_JOB_FIELD_NUMBER; + hash = (53 * hash) + getModelDeploymentMonitoringJob().hashCode(); + if (hasPredictRequestResponseLoggingConfig()) { + hash = (37 * hash) + PREDICT_REQUEST_RESPONSE_LOGGING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPredictRequestResponseLoggingConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Endpoint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Endpoint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Endpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Endpoint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Endpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Endpoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Endpoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Endpoint parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Endpoint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Endpoint parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Endpoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Endpoint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Endpoint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Models are deployed into it, and afterwards Endpoint is called to obtain
+   * predictions and explanations.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Endpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Endpoint) + com.google.cloud.vertexai.api.EndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_Endpoint_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetTrafficSplit(); + case 7: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableTrafficSplit(); + case 7: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_Endpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Endpoint.class, + com.google.cloud.vertexai.api.Endpoint.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Endpoint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + description_ = ""; + if (deployedModelsBuilder_ == null) { + deployedModels_ = java.util.Collections.emptyList(); + } else { + deployedModels_ = null; + deployedModelsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableTrafficSplit().clear(); + etag_ = ""; + internalGetMutableLabels().clear(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + encryptionSpec_ = null; + if (encryptionSpecBuilder_ != null) { + encryptionSpecBuilder_.dispose(); + encryptionSpecBuilder_ = null; + } + network_ = ""; + enablePrivateServiceConnect_ = false; + modelDeploymentMonitoringJob_ = ""; + predictRequestResponseLoggingConfig_ = null; + if (predictRequestResponseLoggingConfigBuilder_ != null) { + predictRequestResponseLoggingConfigBuilder_.dispose(); + predictRequestResponseLoggingConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_Endpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Endpoint getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Endpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Endpoint build() { + com.google.cloud.vertexai.api.Endpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Endpoint buildPartial() { + com.google.cloud.vertexai.api.Endpoint result = + new com.google.cloud.vertexai.api.Endpoint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.Endpoint result) { + if (deployedModelsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + deployedModels_ = java.util.Collections.unmodifiableList(deployedModels_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.deployedModels_ = deployedModels_; + } else { + result.deployedModels_ = deployedModelsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.Endpoint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.trafficSplit_ = internalGetTrafficSplit(); + result.trafficSplit_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.encryptionSpec_ = + encryptionSpecBuilder_ == null ? encryptionSpec_ : encryptionSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.enablePrivateServiceConnect_ = enablePrivateServiceConnect_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.modelDeploymentMonitoringJob_ = modelDeploymentMonitoringJob_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.predictRequestResponseLoggingConfig_ = + predictRequestResponseLoggingConfigBuilder_ == null + ? predictRequestResponseLoggingConfig_ + : predictRequestResponseLoggingConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Endpoint) { + return mergeFrom((com.google.cloud.vertexai.api.Endpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Endpoint other) { + if (other == com.google.cloud.vertexai.api.Endpoint.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (deployedModelsBuilder_ == null) { + if (!other.deployedModels_.isEmpty()) { + if (deployedModels_.isEmpty()) { + deployedModels_ = other.deployedModels_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureDeployedModelsIsMutable(); + deployedModels_.addAll(other.deployedModels_); + } + onChanged(); + } + } else { + if (!other.deployedModels_.isEmpty()) { + if (deployedModelsBuilder_.isEmpty()) { + deployedModelsBuilder_.dispose(); + deployedModelsBuilder_ = null; + deployedModels_ = other.deployedModels_; + bitField0_ = (bitField0_ & ~0x00000008); + deployedModelsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDeployedModelsFieldBuilder() + : null; + } else { + deployedModelsBuilder_.addAllMessages(other.deployedModels_); + } + } + } + internalGetMutableTrafficSplit().mergeFrom(other.internalGetTrafficSplit()); + bitField0_ |= 0x00000010; + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000020; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000040; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasEncryptionSpec()) { + mergeEncryptionSpec(other.getEncryptionSpec()); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.getEnablePrivateServiceConnect() != false) { + setEnablePrivateServiceConnect(other.getEnablePrivateServiceConnect()); + } + if (!other.getModelDeploymentMonitoringJob().isEmpty()) { + modelDeploymentMonitoringJob_ = other.modelDeploymentMonitoringJob_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (other.hasPredictRequestResponseLoggingConfig()) { + mergePredictRequestResponseLoggingConfig(other.getPredictRequestResponseLoggingConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.cloud.vertexai.api.DeployedModel m = + input.readMessage( + com.google.cloud.vertexai.api.DeployedModel.parser(), extensionRegistry); + if (deployedModelsBuilder_ == null) { + ensureDeployedModelsIsMutable(); + deployedModels_.add(m); + } else { + deployedModelsBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry trafficSplit__ = + input.readMessage( + TrafficSplitDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableTrafficSplit() + .getMutableMap() + .put(trafficSplit__.getKey(), trafficSplit__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage(getEncryptionSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 106: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 106 + case 114: + { + modelDeploymentMonitoringJob_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 114 + case 136: + { + enablePrivateServiceConnect_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 136 + case 146: + { + input.readMessage( + getPredictRequestResponseLoggingConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 146 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the Endpoint.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Endpoint.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Endpoint.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Endpoint.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Endpoint.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The display name of the Endpoint.
+     * The name can be up to 128 characters long and can consist of any UTF-8
+     * characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The display name of the Endpoint.
+     * The name can be up to 128 characters long and can consist of any UTF-8
+     * characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The display name of the Endpoint.
+     * The name can be up to 128 characters long and can consist of any UTF-8
+     * characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the Endpoint.
+     * The name can be up to 128 characters long and can consist of any UTF-8
+     * characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the Endpoint.
+     * The name can be up to 128 characters long and can consist of any UTF-8
+     * characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The description of the Endpoint.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The description of the Endpoint.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The description of the Endpoint.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the Endpoint.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the Endpoint.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List deployedModels_ = + java.util.Collections.emptyList(); + + private void ensureDeployedModelsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + deployedModels_ = + new java.util.ArrayList(deployedModels_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder> + deployedModelsBuilder_; + + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getDeployedModelsList() { + if (deployedModelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(deployedModels_); + } else { + return deployedModelsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDeployedModelsCount() { + if (deployedModelsBuilder_ == null) { + return deployedModels_.size(); + } else { + return deployedModelsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.DeployedModel getDeployedModels(int index) { + if (deployedModelsBuilder_ == null) { + return deployedModels_.get(index); + } else { + return deployedModelsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeployedModels(int index, com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeployedModelsIsMutable(); + deployedModels_.set(index, value); + onChanged(); + } else { + deployedModelsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeployedModels( + int index, com.google.cloud.vertexai.api.DeployedModel.Builder builderForValue) { + if (deployedModelsBuilder_ == null) { + ensureDeployedModelsIsMutable(); + deployedModels_.set(index, builderForValue.build()); + onChanged(); + } else { + deployedModelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDeployedModels(com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeployedModelsIsMutable(); + deployedModels_.add(value); + onChanged(); + } else { + deployedModelsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDeployedModels(int index, com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeployedModelsIsMutable(); + deployedModels_.add(index, value); + onChanged(); + } else { + deployedModelsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDeployedModels( + com.google.cloud.vertexai.api.DeployedModel.Builder builderForValue) { + if (deployedModelsBuilder_ == null) { + ensureDeployedModelsIsMutable(); + deployedModels_.add(builderForValue.build()); + onChanged(); + } else { + deployedModelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDeployedModels( + int index, com.google.cloud.vertexai.api.DeployedModel.Builder builderForValue) { + if (deployedModelsBuilder_ == null) { + ensureDeployedModelsIsMutable(); + deployedModels_.add(index, builderForValue.build()); + onChanged(); + } else { + deployedModelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDeployedModels( + java.lang.Iterable values) { + if (deployedModelsBuilder_ == null) { + ensureDeployedModelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deployedModels_); + onChanged(); + } else { + deployedModelsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeployedModels() { + if (deployedModelsBuilder_ == null) { + deployedModels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + deployedModelsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDeployedModels(int index) { + if (deployedModelsBuilder_ == null) { + ensureDeployedModelsIsMutable(); + deployedModels_.remove(index); + onChanged(); + } else { + deployedModelsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.DeployedModel.Builder getDeployedModelsBuilder(int index) { + return getDeployedModelsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelsOrBuilder( + int index) { + if (deployedModelsBuilder_ == null) { + return deployedModels_.get(index); + } else { + return deployedModelsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDeployedModelsOrBuilderList() { + if (deployedModelsBuilder_ != null) { + return deployedModelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deployedModels_); + } + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.DeployedModel.Builder addDeployedModelsBuilder() { + return getDeployedModelsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.DeployedModel.Builder addDeployedModelsBuilder(int index) { + return getDeployedModelsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The models deployed in this Endpoint.
+     * To add or remove DeployedModels use
+     * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+     * and
+     * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+     * respectively.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDeployedModelsBuilderList() { + return getDeployedModelsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder> + getDeployedModelsFieldBuilder() { + if (deployedModelsBuilder_ == null) { + deployedModelsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder>( + deployedModels_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + deployedModels_ = null; + } + return deployedModelsBuilder_; + } + + private com.google.protobuf.MapField trafficSplit_; + + private com.google.protobuf.MapField + internalGetTrafficSplit() { + if (trafficSplit_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TrafficSplitDefaultEntryHolder.defaultEntry); + } + return trafficSplit_; + } + + private com.google.protobuf.MapField + internalGetMutableTrafficSplit() { + if (trafficSplit_ == null) { + trafficSplit_ = + com.google.protobuf.MapField.newMapField(TrafficSplitDefaultEntryHolder.defaultEntry); + } + if (!trafficSplit_.isMutable()) { + trafficSplit_ = trafficSplit_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return trafficSplit_; + } + + public int getTrafficSplitCount() { + return internalGetTrafficSplit().getMap().size(); + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * If a DeployedModel's ID is not listed in this map, then it receives no
+     * traffic.
+     *
+     * The traffic percentage values must add up to 100, or map must be empty if
+     * the Endpoint is to not accept any traffic at a moment.
+     * 
+ * + * map<string, int32> traffic_split = 5; + */ + @java.lang.Override + public boolean containsTrafficSplit(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTrafficSplit().getMap().containsKey(key); + } + /** Use {@link #getTrafficSplitMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTrafficSplit() { + return getTrafficSplitMap(); + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * If a DeployedModel's ID is not listed in this map, then it receives no
+     * traffic.
+     *
+     * The traffic percentage values must add up to 100, or map must be empty if
+     * the Endpoint is to not accept any traffic at a moment.
+     * 
+ * + * map<string, int32> traffic_split = 5; + */ + @java.lang.Override + public java.util.Map getTrafficSplitMap() { + return internalGetTrafficSplit().getMap(); + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * If a DeployedModel's ID is not listed in this map, then it receives no
+     * traffic.
+     *
+     * The traffic percentage values must add up to 100, or map must be empty if
+     * the Endpoint is to not accept any traffic at a moment.
+     * 
+ * + * map<string, int32> traffic_split = 5; + */ + @java.lang.Override + public int getTrafficSplitOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * If a DeployedModel's ID is not listed in this map, then it receives no
+     * traffic.
+     *
+     * The traffic percentage values must add up to 100, or map must be empty if
+     * the Endpoint is to not accept any traffic at a moment.
+     * 
+ * + * map<string, int32> traffic_split = 5; + */ + @java.lang.Override + public int getTrafficSplitOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTrafficSplit() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableTrafficSplit().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * If a DeployedModel's ID is not listed in this map, then it receives no
+     * traffic.
+     *
+     * The traffic percentage values must add up to 100, or map must be empty if
+     * the Endpoint is to not accept any traffic at a moment.
+     * 
+ * + * map<string, int32> traffic_split = 5; + */ + public Builder removeTrafficSplit(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTrafficSplit().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableTrafficSplit() { + bitField0_ |= 0x00000010; + return internalGetMutableTrafficSplit().getMutableMap(); + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * If a DeployedModel's ID is not listed in this map, then it receives no
+     * traffic.
+     *
+     * The traffic percentage values must add up to 100, or map must be empty if
+     * the Endpoint is to not accept any traffic at a moment.
+     * 
+ * + * map<string, int32> traffic_split = 5; + */ + public Builder putTrafficSplit(java.lang.String key, int value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableTrafficSplit().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * A map from a DeployedModel's ID to the percentage of this Endpoint's
+     * traffic that should be forwarded to that DeployedModel.
+     *
+     * If a DeployedModel's ID is not listed in this map, then it receives no
+     * traffic.
+     *
+     * The traffic percentage values must add up to 100, or map must be empty if
+     * the Endpoint is to not accept any traffic at a moment.
+     * 
+ * + * map<string, int32> traffic_split = 5; + */ + public Builder putAllTrafficSplit(java.util.Map values) { + internalGetMutableTrafficSplit().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Used to perform consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 6; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Used to perform consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 6; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Used to perform consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 6; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Used to perform consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 6; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Used to perform consistent read-modify-write updates. If not set, a blind
+     * "overwrite" update happens.
+     * 
+ * + * string etag = 6; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * The labels with user-defined metadata to organize your Endpoints.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * The labels with user-defined metadata to organize your Endpoints.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * The labels with user-defined metadata to organize your Endpoints.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The labels with user-defined metadata to organize your Endpoints.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 7; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The labels with user-defined metadata to organize your Endpoints.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * The labels with user-defined metadata to organize your Endpoints.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * The labels with user-defined metadata to organize your Endpoints.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 7; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000100); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when this Endpoint was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.cloud.vertexai.api.EncryptionSpec encryptionSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.EncryptionSpec, + com.google.cloud.vertexai.api.EncryptionSpec.Builder, + com.google.cloud.vertexai.api.EncryptionSpecOrBuilder> + encryptionSpecBuilder_; + /** + * + * + *
+     * Customer-managed encryption key spec for an Endpoint. If set, this
+     * Endpoint and all sub-resources of this Endpoint will be secured by
+     * this key.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + * + * @return Whether the encryptionSpec field is set. + */ + public boolean hasEncryptionSpec() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Customer-managed encryption key spec for an Endpoint. If set, this
+     * Endpoint and all sub-resources of this Endpoint will be secured by
+     * this key.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + * + * @return The encryptionSpec. + */ + public com.google.cloud.vertexai.api.EncryptionSpec getEncryptionSpec() { + if (encryptionSpecBuilder_ == null) { + return encryptionSpec_ == null + ? com.google.cloud.vertexai.api.EncryptionSpec.getDefaultInstance() + : encryptionSpec_; + } else { + return encryptionSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Customer-managed encryption key spec for an Endpoint. If set, this
+     * Endpoint and all sub-resources of this Endpoint will be secured by
+     * this key.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + */ + public Builder setEncryptionSpec(com.google.cloud.vertexai.api.EncryptionSpec value) { + if (encryptionSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionSpec_ = value; + } else { + encryptionSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Customer-managed encryption key spec for an Endpoint. If set, this
+     * Endpoint and all sub-resources of this Endpoint will be secured by
+     * this key.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + */ + public Builder setEncryptionSpec( + com.google.cloud.vertexai.api.EncryptionSpec.Builder builderForValue) { + if (encryptionSpecBuilder_ == null) { + encryptionSpec_ = builderForValue.build(); + } else { + encryptionSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Customer-managed encryption key spec for an Endpoint. If set, this
+     * Endpoint and all sub-resources of this Endpoint will be secured by
+     * this key.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + */ + public Builder mergeEncryptionSpec(com.google.cloud.vertexai.api.EncryptionSpec value) { + if (encryptionSpecBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && encryptionSpec_ != null + && encryptionSpec_ + != com.google.cloud.vertexai.api.EncryptionSpec.getDefaultInstance()) { + getEncryptionSpecBuilder().mergeFrom(value); + } else { + encryptionSpec_ = value; + } + } else { + encryptionSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Customer-managed encryption key spec for an Endpoint. If set, this
+     * Endpoint and all sub-resources of this Endpoint will be secured by
+     * this key.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + */ + public Builder clearEncryptionSpec() { + bitField0_ = (bitField0_ & ~0x00000200); + encryptionSpec_ = null; + if (encryptionSpecBuilder_ != null) { + encryptionSpecBuilder_.dispose(); + encryptionSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Customer-managed encryption key spec for an Endpoint. If set, this
+     * Endpoint and all sub-resources of this Endpoint will be secured by
+     * this key.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + */ + public com.google.cloud.vertexai.api.EncryptionSpec.Builder getEncryptionSpecBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getEncryptionSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Customer-managed encryption key spec for an Endpoint. If set, this
+     * Endpoint and all sub-resources of this Endpoint will be secured by
+     * this key.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + */ + public com.google.cloud.vertexai.api.EncryptionSpecOrBuilder getEncryptionSpecOrBuilder() { + if (encryptionSpecBuilder_ != null) { + return encryptionSpecBuilder_.getMessageOrBuilder(); + } else { + return encryptionSpec_ == null + ? com.google.cloud.vertexai.api.EncryptionSpec.getDefaultInstance() + : encryptionSpec_; + } + } + /** + * + * + *
+     * Customer-managed encryption key spec for an Endpoint. If set, this
+     * Endpoint and all sub-resources of this Endpoint will be secured by
+     * this key.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.EncryptionSpec, + com.google.cloud.vertexai.api.EncryptionSpec.Builder, + com.google.cloud.vertexai.api.EncryptionSpecOrBuilder> + getEncryptionSpecFieldBuilder() { + if (encryptionSpecBuilder_ == null) { + encryptionSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.EncryptionSpec, + com.google.cloud.vertexai.api.EncryptionSpec.Builder, + com.google.cloud.vertexai.api.EncryptionSpecOrBuilder>( + getEncryptionSpec(), getParentForChildren(), isClean()); + encryptionSpec_ = null; + } + return encryptionSpecBuilder_; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * Optional. The full name of the Google Compute Engine
+     * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks)
+     * to which the Endpoint should be peered.
+     *
+     * Private services access must already be configured for the network. If left
+     * unspecified, the Endpoint is not peered with any network.
+     *
+     * Only one of the fields,
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+     * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+     * can be set.
+     *
+     * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert):
+     * `projects/{project}/global/networks/{network}`.
+     * Where `{project}` is a project number, as in `12345`, and `{network}` is
+     * network name.
+     * 
+ * + * + * string network = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The full name of the Google Compute Engine
+     * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks)
+     * to which the Endpoint should be peered.
+     *
+     * Private services access must already be configured for the network. If left
+     * unspecified, the Endpoint is not peered with any network.
+     *
+     * Only one of the fields,
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+     * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+     * can be set.
+     *
+     * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert):
+     * `projects/{project}/global/networks/{network}`.
+     * Where `{project}` is a project number, as in `12345`, and `{network}` is
+     * network name.
+     * 
+ * + * + * string network = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The full name of the Google Compute Engine
+     * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks)
+     * to which the Endpoint should be peered.
+     *
+     * Private services access must already be configured for the network. If left
+     * unspecified, the Endpoint is not peered with any network.
+     *
+     * Only one of the fields,
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+     * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+     * can be set.
+     *
+     * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert):
+     * `projects/{project}/global/networks/{network}`.
+     * Where `{project}` is a project number, as in `12345`, and `{network}` is
+     * network name.
+     * 
+ * + * + * string network = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The full name of the Google Compute Engine
+     * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks)
+     * to which the Endpoint should be peered.
+     *
+     * Private services access must already be configured for the network. If left
+     * unspecified, the Endpoint is not peered with any network.
+     *
+     * Only one of the fields,
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+     * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+     * can be set.
+     *
+     * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert):
+     * `projects/{project}/global/networks/{network}`.
+     * Where `{project}` is a project number, as in `12345`, and `{network}` is
+     * network name.
+     * 
+ * + * + * string network = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The full name of the Google Compute Engine
+     * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks)
+     * to which the Endpoint should be peered.
+     *
+     * Private services access must already be configured for the network. If left
+     * unspecified, the Endpoint is not peered with any network.
+     *
+     * Only one of the fields,
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+     * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+     * can be set.
+     *
+     * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert):
+     * `projects/{project}/global/networks/{network}`.
+     * Where `{project}` is a project number, as in `12345`, and `{network}` is
+     * network name.
+     * 
+ * + * + * string network = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private boolean enablePrivateServiceConnect_; + /** + * + * + *
+     * Deprecated: If true, expose the Endpoint via private service connect.
+     *
+     * Only one of the fields,
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+     * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+     * can be set.
+     * 
+ * + * bool enable_private_service_connect = 17 [deprecated = true]; + * + * @deprecated google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect is + * deprecated. See google/cloud/vertexai/v1beta1/endpoint.proto;l=126 + * @return The enablePrivateServiceConnect. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getEnablePrivateServiceConnect() { + return enablePrivateServiceConnect_; + } + /** + * + * + *
+     * Deprecated: If true, expose the Endpoint via private service connect.
+     *
+     * Only one of the fields,
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+     * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+     * can be set.
+     * 
+ * + * bool enable_private_service_connect = 17 [deprecated = true]; + * + * @deprecated google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect is + * deprecated. See google/cloud/vertexai/v1beta1/endpoint.proto;l=126 + * @param value The enablePrivateServiceConnect to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setEnablePrivateServiceConnect(boolean value) { + + enablePrivateServiceConnect_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Deprecated: If true, expose the Endpoint via private service connect.
+     *
+     * Only one of the fields,
+     * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+     * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+     * can be set.
+     * 
+ * + * bool enable_private_service_connect = 17 [deprecated = true]; + * + * @deprecated google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect is + * deprecated. See google/cloud/vertexai/v1beta1/endpoint.proto;l=126 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearEnablePrivateServiceConnect() { + bitField0_ = (bitField0_ & ~0x00000800); + enablePrivateServiceConnect_ = false; + onChanged(); + return this; + } + + private java.lang.Object modelDeploymentMonitoringJob_ = ""; + /** + * + * + *
+     * Output only. Resource name of the Model Monitoring job associated with this
+     * Endpoint if monitoring is enabled by
+     * [JobService.CreateModelDeploymentMonitoringJob][google.cloud.vertexai.v1beta1.JobService.CreateModelDeploymentMonitoringJob].
+     * Format:
+     * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
+     * 
+ * + * + * string model_deployment_monitoring_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The modelDeploymentMonitoringJob. + */ + public java.lang.String getModelDeploymentMonitoringJob() { + java.lang.Object ref = modelDeploymentMonitoringJob_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelDeploymentMonitoringJob_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Resource name of the Model Monitoring job associated with this
+     * Endpoint if monitoring is enabled by
+     * [JobService.CreateModelDeploymentMonitoringJob][google.cloud.vertexai.v1beta1.JobService.CreateModelDeploymentMonitoringJob].
+     * Format:
+     * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
+     * 
+ * + * + * string model_deployment_monitoring_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for modelDeploymentMonitoringJob. + */ + public com.google.protobuf.ByteString getModelDeploymentMonitoringJobBytes() { + java.lang.Object ref = modelDeploymentMonitoringJob_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelDeploymentMonitoringJob_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Resource name of the Model Monitoring job associated with this
+     * Endpoint if monitoring is enabled by
+     * [JobService.CreateModelDeploymentMonitoringJob][google.cloud.vertexai.v1beta1.JobService.CreateModelDeploymentMonitoringJob].
+     * Format:
+     * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
+     * 
+ * + * + * string model_deployment_monitoring_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The modelDeploymentMonitoringJob to set. + * @return This builder for chaining. + */ + public Builder setModelDeploymentMonitoringJob(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + modelDeploymentMonitoringJob_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Resource name of the Model Monitoring job associated with this
+     * Endpoint if monitoring is enabled by
+     * [JobService.CreateModelDeploymentMonitoringJob][google.cloud.vertexai.v1beta1.JobService.CreateModelDeploymentMonitoringJob].
+     * Format:
+     * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
+     * 
+ * + * + * string model_deployment_monitoring_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearModelDeploymentMonitoringJob() { + modelDeploymentMonitoringJob_ = getDefaultInstance().getModelDeploymentMonitoringJob(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Resource name of the Model Monitoring job associated with this
+     * Endpoint if monitoring is enabled by
+     * [JobService.CreateModelDeploymentMonitoringJob][google.cloud.vertexai.v1beta1.JobService.CreateModelDeploymentMonitoringJob].
+     * Format:
+     * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
+     * 
+ * + * + * string model_deployment_monitoring_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for modelDeploymentMonitoringJob to set. + * @return This builder for chaining. + */ + public Builder setModelDeploymentMonitoringJobBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + modelDeploymentMonitoringJob_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + predictRequestResponseLoggingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig, + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.Builder, + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfigOrBuilder> + predictRequestResponseLoggingConfigBuilder_; + /** + * + * + *
+     * Configures the request-response logging for online prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + * + * @return Whether the predictRequestResponseLoggingConfig field is set. + */ + public boolean hasPredictRequestResponseLoggingConfig() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Configures the request-response logging for online prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + * + * @return The predictRequestResponseLoggingConfig. + */ + public com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + getPredictRequestResponseLoggingConfig() { + if (predictRequestResponseLoggingConfigBuilder_ == null) { + return predictRequestResponseLoggingConfig_ == null + ? com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.getDefaultInstance() + : predictRequestResponseLoggingConfig_; + } else { + return predictRequestResponseLoggingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configures the request-response logging for online prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + */ + public Builder setPredictRequestResponseLoggingConfig( + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig value) { + if (predictRequestResponseLoggingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + predictRequestResponseLoggingConfig_ = value; + } else { + predictRequestResponseLoggingConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configures the request-response logging for online prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + */ + public Builder setPredictRequestResponseLoggingConfig( + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.Builder builderForValue) { + if (predictRequestResponseLoggingConfigBuilder_ == null) { + predictRequestResponseLoggingConfig_ = builderForValue.build(); + } else { + predictRequestResponseLoggingConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configures the request-response logging for online prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + */ + public Builder mergePredictRequestResponseLoggingConfig( + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig value) { + if (predictRequestResponseLoggingConfigBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && predictRequestResponseLoggingConfig_ != null + && predictRequestResponseLoggingConfig_ + != com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + .getDefaultInstance()) { + getPredictRequestResponseLoggingConfigBuilder().mergeFrom(value); + } else { + predictRequestResponseLoggingConfig_ = value; + } + } else { + predictRequestResponseLoggingConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Configures the request-response logging for online prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + */ + public Builder clearPredictRequestResponseLoggingConfig() { + bitField0_ = (bitField0_ & ~0x00002000); + predictRequestResponseLoggingConfig_ = null; + if (predictRequestResponseLoggingConfigBuilder_ != null) { + predictRequestResponseLoggingConfigBuilder_.dispose(); + predictRequestResponseLoggingConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Configures the request-response logging for online prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + */ + public com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.Builder + getPredictRequestResponseLoggingConfigBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getPredictRequestResponseLoggingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configures the request-response logging for online prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + */ + public com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfigOrBuilder + getPredictRequestResponseLoggingConfigOrBuilder() { + if (predictRequestResponseLoggingConfigBuilder_ != null) { + return predictRequestResponseLoggingConfigBuilder_.getMessageOrBuilder(); + } else { + return predictRequestResponseLoggingConfig_ == null + ? com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.getDefaultInstance() + : predictRequestResponseLoggingConfig_; + } + } + /** + * + * + *
+     * Configures the request-response logging for online prediction.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig, + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.Builder, + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfigOrBuilder> + getPredictRequestResponseLoggingConfigFieldBuilder() { + if (predictRequestResponseLoggingConfigBuilder_ == null) { + predictRequestResponseLoggingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig, + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.Builder, + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfigOrBuilder>( + getPredictRequestResponseLoggingConfig(), getParentForChildren(), isClean()); + predictRequestResponseLoggingConfig_ = null; + } + return predictRequestResponseLoggingConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Endpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Endpoint) + private static final com.google.cloud.vertexai.api.Endpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Endpoint(); + } + + public static com.google.cloud.vertexai.api.Endpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Endpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Endpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointName.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointName.java new file mode 100644 index 000000000000..bd2891376c4d --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointName.java @@ -0,0 +1,381 @@ +/* + * 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.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class EndpointName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_ENDPOINT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/endpoints/{endpoint}"); + private static final PathTemplate PROJECT_LOCATION_PUBLISHER_MODEL = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/publishers/{publisher}/models/{model}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String endpoint; + private final String publisher; + private final String model; + + @Deprecated + protected EndpointName() { + project = null; + location = null; + endpoint = null; + publisher = null; + model = null; + } + + private EndpointName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + endpoint = Preconditions.checkNotNull(builder.getEndpoint()); + publisher = null; + model = null; + pathTemplate = PROJECT_LOCATION_ENDPOINT; + } + + private EndpointName(ProjectLocationPublisherModelBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + publisher = Preconditions.checkNotNull(builder.getPublisher()); + model = Preconditions.checkNotNull(builder.getModel()); + endpoint = null; + pathTemplate = PROJECT_LOCATION_PUBLISHER_MODEL; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getEndpoint() { + return endpoint; + } + + public String getPublisher() { + return publisher; + } + + public String getModel() { + return model; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationEndpointBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationPublisherModelBuilder newProjectLocationPublisherModelBuilder() { + return new ProjectLocationPublisherModelBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static EndpointName of(String project, String location, String endpoint) { + return newBuilder().setProject(project).setLocation(location).setEndpoint(endpoint).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static EndpointName ofProjectLocationEndpointName( + String project, String location, String endpoint) { + return newBuilder().setProject(project).setLocation(location).setEndpoint(endpoint).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static EndpointName ofProjectLocationPublisherModelName( + String project, String location, String publisher, String model) { + return newProjectLocationPublisherModelBuilder() + .setProject(project) + .setLocation(location) + .setPublisher(publisher) + .setModel(model) + .build(); + } + + public static String format(String project, String location, String endpoint) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setEndpoint(endpoint) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationEndpointName( + String project, String location, String endpoint) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setEndpoint(endpoint) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationPublisherModelName( + String project, String location, String publisher, String model) { + return newProjectLocationPublisherModelBuilder() + .setProject(project) + .setLocation(location) + .setPublisher(publisher) + .setModel(model) + .build() + .toString(); + } + + public static EndpointName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_ENDPOINT.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_ENDPOINT.match(formattedString); + return ofProjectLocationEndpointName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("endpoint")); + } else if (PROJECT_LOCATION_PUBLISHER_MODEL.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_PUBLISHER_MODEL.match(formattedString); + return ofProjectLocationPublisherModelName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("publisher"), + matchMap.get("model")); + } + throw new ValidationException("EndpointName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (EndpointName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_ENDPOINT.matches(formattedString) + || PROJECT_LOCATION_PUBLISHER_MODEL.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (endpoint != null) { + fieldMapBuilder.put("endpoint", endpoint); + } + if (publisher != null) { + fieldMapBuilder.put("publisher", publisher); + } + if (model != null) { + fieldMapBuilder.put("model", model); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + EndpointName that = ((EndpointName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.endpoint, that.endpoint) + && Objects.equals(this.publisher, that.publisher) + && Objects.equals(this.model, that.model); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(endpoint); + h *= 1000003; + h ^= Objects.hashCode(publisher); + h *= 1000003; + h ^= Objects.hashCode(model); + return h; + } + + /** Builder for projects/{project}/locations/{location}/endpoints/{endpoint}. */ + public static class Builder { + private String project; + private String location; + private String endpoint; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getEndpoint() { + return endpoint; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + private Builder(EndpointName endpointName) { + Preconditions.checkArgument( + Objects.equals(endpointName.pathTemplate, PROJECT_LOCATION_ENDPOINT), + "toBuilder is only supported when EndpointName has the pattern of projects/{project}/locations/{location}/endpoints/{endpoint}"); + this.project = endpointName.project; + this.location = endpointName.location; + this.endpoint = endpointName.endpoint; + } + + public EndpointName build() { + return new EndpointName(this); + } + } + + /** Builder for projects/{project}/locations/{location}/publishers/{publisher}/models/{model}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationPublisherModelBuilder { + private String project; + private String location; + private String publisher; + private String model; + + protected ProjectLocationPublisherModelBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPublisher() { + return publisher; + } + + public String getModel() { + return model; + } + + public ProjectLocationPublisherModelBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationPublisherModelBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationPublisherModelBuilder setPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + public ProjectLocationPublisherModelBuilder setModel(String model) { + this.model = model; + return this; + } + + public EndpointName build() { + return new EndpointName(this); + } + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointOrBuilder.java new file mode 100644 index 000000000000..ea7464fc08fd --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointOrBuilder.java @@ -0,0 +1,672 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint.proto + +package com.google.cloud.vertexai.api; + +public interface EndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Endpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the Endpoint.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the Endpoint.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The display name of the Endpoint.
+   * The name can be up to 128 characters long and can consist of any UTF-8
+   * characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The display name of the Endpoint.
+   * The name can be up to 128 characters long and can consist of any UTF-8
+   * characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The description of the Endpoint.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of the Endpoint.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The models deployed in this Endpoint.
+   * To add or remove DeployedModels use
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+   * and
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+   * respectively.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDeployedModelsList(); + /** + * + * + *
+   * Output only. The models deployed in this Endpoint.
+   * To add or remove DeployedModels use
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+   * and
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+   * respectively.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.DeployedModel getDeployedModels(int index); + /** + * + * + *
+   * Output only. The models deployed in this Endpoint.
+   * To add or remove DeployedModels use
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+   * and
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+   * respectively.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDeployedModelsCount(); + /** + * + * + *
+   * Output only. The models deployed in this Endpoint.
+   * To add or remove DeployedModels use
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+   * and
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+   * respectively.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDeployedModelsOrBuilderList(); + /** + * + * + *
+   * Output only. The models deployed in this Endpoint.
+   * To add or remove DeployedModels use
+   * [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]
+   * and
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]
+   * respectively.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.DeployedModel deployed_models = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelsOrBuilder(int index); + + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * If a DeployedModel's ID is not listed in this map, then it receives no
+   * traffic.
+   *
+   * The traffic percentage values must add up to 100, or map must be empty if
+   * the Endpoint is to not accept any traffic at a moment.
+   * 
+ * + * map<string, int32> traffic_split = 5; + */ + int getTrafficSplitCount(); + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * If a DeployedModel's ID is not listed in this map, then it receives no
+   * traffic.
+   *
+   * The traffic percentage values must add up to 100, or map must be empty if
+   * the Endpoint is to not accept any traffic at a moment.
+   * 
+ * + * map<string, int32> traffic_split = 5; + */ + boolean containsTrafficSplit(java.lang.String key); + /** Use {@link #getTrafficSplitMap()} instead. */ + @java.lang.Deprecated + java.util.Map getTrafficSplit(); + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * If a DeployedModel's ID is not listed in this map, then it receives no
+   * traffic.
+   *
+   * The traffic percentage values must add up to 100, or map must be empty if
+   * the Endpoint is to not accept any traffic at a moment.
+   * 
+ * + * map<string, int32> traffic_split = 5; + */ + java.util.Map getTrafficSplitMap(); + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * If a DeployedModel's ID is not listed in this map, then it receives no
+   * traffic.
+   *
+   * The traffic percentage values must add up to 100, or map must be empty if
+   * the Endpoint is to not accept any traffic at a moment.
+   * 
+ * + * map<string, int32> traffic_split = 5; + */ + int getTrafficSplitOrDefault(java.lang.String key, int defaultValue); + /** + * + * + *
+   * A map from a DeployedModel's ID to the percentage of this Endpoint's
+   * traffic that should be forwarded to that DeployedModel.
+   *
+   * If a DeployedModel's ID is not listed in this map, then it receives no
+   * traffic.
+   *
+   * The traffic percentage values must add up to 100, or map must be empty if
+   * the Endpoint is to not accept any traffic at a moment.
+   * 
+ * + * map<string, int32> traffic_split = 5; + */ + int getTrafficSplitOrThrow(java.lang.String key); + + /** + * + * + *
+   * Used to perform consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 6; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Used to perform consistent read-modify-write updates. If not set, a blind
+   * "overwrite" update happens.
+   * 
+ * + * string etag = 6; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Endpoints.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 7; + */ + int getLabelsCount(); + /** + * + * + *
+   * The labels with user-defined metadata to organize your Endpoints.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 7; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * The labels with user-defined metadata to organize your Endpoints.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 7; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * The labels with user-defined metadata to organize your Endpoints.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 7; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The labels with user-defined metadata to organize your Endpoints.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 7; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when this Endpoint was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Customer-managed encryption key spec for an Endpoint. If set, this
+   * Endpoint and all sub-resources of this Endpoint will be secured by
+   * this key.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + * + * @return Whether the encryptionSpec field is set. + */ + boolean hasEncryptionSpec(); + /** + * + * + *
+   * Customer-managed encryption key spec for an Endpoint. If set, this
+   * Endpoint and all sub-resources of this Endpoint will be secured by
+   * this key.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + * + * @return The encryptionSpec. + */ + com.google.cloud.vertexai.api.EncryptionSpec getEncryptionSpec(); + /** + * + * + *
+   * Customer-managed encryption key spec for an Endpoint. If set, this
+   * Endpoint and all sub-resources of this Endpoint will be secured by
+   * this key.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.EncryptionSpec encryption_spec = 10; + */ + com.google.cloud.vertexai.api.EncryptionSpecOrBuilder getEncryptionSpecOrBuilder(); + + /** + * + * + *
+   * Optional. The full name of the Google Compute Engine
+   * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks)
+   * to which the Endpoint should be peered.
+   *
+   * Private services access must already be configured for the network. If left
+   * unspecified, the Endpoint is not peered with any network.
+   *
+   * Only one of the fields,
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+   * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+   * can be set.
+   *
+   * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert):
+   * `projects/{project}/global/networks/{network}`.
+   * Where `{project}` is a project number, as in `12345`, and `{network}` is
+   * network name.
+   * 
+ * + * + * string network = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Optional. The full name of the Google Compute Engine
+   * [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks)
+   * to which the Endpoint should be peered.
+   *
+   * Private services access must already be configured for the network. If left
+   * unspecified, the Endpoint is not peered with any network.
+   *
+   * Only one of the fields,
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+   * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+   * can be set.
+   *
+   * [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert):
+   * `projects/{project}/global/networks/{network}`.
+   * Where `{project}` is a project number, as in `12345`, and `{network}` is
+   * network name.
+   * 
+ * + * + * string network = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * Deprecated: If true, expose the Endpoint via private service connect.
+   *
+   * Only one of the fields,
+   * [network][google.cloud.vertexai.v1beta1.Endpoint.network] or
+   * [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect],
+   * can be set.
+   * 
+ * + * bool enable_private_service_connect = 17 [deprecated = true]; + * + * @deprecated google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect is + * deprecated. See google/cloud/vertexai/v1beta1/endpoint.proto;l=126 + * @return The enablePrivateServiceConnect. + */ + @java.lang.Deprecated + boolean getEnablePrivateServiceConnect(); + + /** + * + * + *
+   * Output only. Resource name of the Model Monitoring job associated with this
+   * Endpoint if monitoring is enabled by
+   * [JobService.CreateModelDeploymentMonitoringJob][google.cloud.vertexai.v1beta1.JobService.CreateModelDeploymentMonitoringJob].
+   * Format:
+   * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
+   * 
+ * + * + * string model_deployment_monitoring_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The modelDeploymentMonitoringJob. + */ + java.lang.String getModelDeploymentMonitoringJob(); + /** + * + * + *
+   * Output only. Resource name of the Model Monitoring job associated with this
+   * Endpoint if monitoring is enabled by
+   * [JobService.CreateModelDeploymentMonitoringJob][google.cloud.vertexai.v1beta1.JobService.CreateModelDeploymentMonitoringJob].
+   * Format:
+   * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`
+   * 
+ * + * + * string model_deployment_monitoring_job = 14 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for modelDeploymentMonitoringJob. + */ + com.google.protobuf.ByteString getModelDeploymentMonitoringJobBytes(); + + /** + * + * + *
+   * Configures the request-response logging for online prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + * + * @return Whether the predictRequestResponseLoggingConfig field is set. + */ + boolean hasPredictRequestResponseLoggingConfig(); + /** + * + * + *
+   * Configures the request-response logging for online prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + * + * @return The predictRequestResponseLoggingConfig. + */ + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + getPredictRequestResponseLoggingConfig(); + /** + * + * + *
+   * Configures the request-response logging for online prediction.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + * + */ + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfigOrBuilder + getPredictRequestResponseLoggingConfigOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointProto.java new file mode 100644 index 000000000000..0be1df263934 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/EndpointProto.java @@ -0,0 +1,238 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint.proto + +package com.google.cloud.vertexai.api; + +public final class EndpointProto { + private EndpointProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Endpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Endpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Endpoint_TrafficSplitEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Endpoint_TrafficSplitEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Endpoint_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Endpoint_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_DeployedModel_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_DeployedModel_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_PrivateEndpoints_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_PrivateEndpoints_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_PredictRequestResponseLoggingConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_PredictRequestResponseLoggingConfig_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n,google/cloud/vertexai/v1beta1/endpoint" + + ".proto\022\035google.cloud.vertexai.v1beta1\032\037g" + + "oogle/api/field_behavior.proto\032\031google/a" + + "pi/resource.proto\0323google/cloud/vertexai" + + "/v1beta1/encryption_spec.proto\032/google/c" + + "loud/vertexai/v1beta1/explanation.proto\032" + + "&google/cloud/vertexai/v1beta1/io.proto\032" + + "5google/cloud/vertexai/v1beta1/machine_r" + + "esources.proto\032\037google/protobuf/timestam" + + "p.proto\"\330\010\n\010Endpoint\022\022\n\004name\030\001 \001(\tB\004\342A\001\003" + + "\022\032\n\014display_name\030\002 \001(\tB\004\342A\001\002\022\023\n\013descript" + + "ion\030\003 \001(\t\022K\n\017deployed_models\030\004 \003(\0132,.goo" + + "gle.cloud.vertexai.v1beta1.DeployedModel" + + "B\004\342A\001\003\022P\n\rtraffic_split\030\005 \003(\01329.google.c" + + "loud.vertexai.v1beta1.Endpoint.TrafficSp" + + "litEntry\022\014\n\004etag\030\006 \001(\t\022C\n\006labels\030\007 \003(\01323" + + ".google.cloud.vertexai.v1beta1.Endpoint." + + "LabelsEntry\0225\n\013create_time\030\010 \001(\0132\032.googl" + + "e.protobuf.TimestampB\004\342A\001\003\0225\n\013update_tim" + + "e\030\t \001(\0132\032.google.protobuf.TimestampB\004\342A\001" + + "\003\022F\n\017encryption_spec\030\n \001(\0132-.google.clou" + + "d.vertexai.v1beta1.EncryptionSpec\0228\n\007net" + + "work\030\r \001(\tB\'\342A\001\001\372A \n\036compute.googleapis." + + "com/Network\022*\n\036enable_private_service_co" + + "nnect\030\021 \001(\010B\002\030\001\022h\n\037model_deployment_moni" + + "toring_job\030\016 \001(\tB?\342A\001\003\372A8\n6aiplatform.go" + + "ogleapis.com/ModelDeploymentMonitoringJo" + + "b\022s\n\'predict_request_response_logging_co" + + "nfig\030\022 \001(\0132B.google.cloud.vertexai.v1bet" + + "a1.PredictRequestResponseLoggingConfig\0323" + + "\n\021TrafficSplitEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + + "e\030\002 \001(\005:\0028\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022" + + "\r\n\005value\030\002 \001(\t:\0028\001:\265\001\352A\261\001\n\"aiplatform.go" + + "ogleapis.com/Endpoint\022\"2/v1beta1/{parent=projects/*/location" + + "s/*}/endpoints:\010endpoint\022\254\001\n\013GetEndpoint" + + "\0221.google.cloud.vertexai.v1beta1.GetEndp" + + "ointRequest\032\'.google.cloud.vertexai.v1be" + + "ta1.Endpoint\"A\332A\004name\202\323\344\223\0024\0222/v1beta1/{n" + + "ame=projects/*/locations/*/endpoints/*}\022" + + "\277\001\n\rListEndpoints\0223.google.cloud.vertexa" + + "i.v1beta1.ListEndpointsRequest\0324.google." + + "cloud.vertexai.v1beta1.ListEndpointsResp" + + "onse\"C\332A\006parent\202\323\344\223\0024\0222/v1beta1/{parent=" + + "projects/*/locations/*}/endpoints\022\325\001\n\016Up" + + "dateEndpoint\0224.google.cloud.vertexai.v1b" + + "eta1.UpdateEndpointRequest\032\'.google.clou" + + "d.vertexai.v1beta1.Endpoint\"d\332A\024endpoint" + + ",update_mask\202\323\344\223\002G2;/v1beta1/{endpoint.n" + + "ame=projects/*/locations/*/endpoints/*}:" + + "\010endpoint\022\333\001\n\016DeleteEndpoint\0224.google.cl" + + "oud.vertexai.v1beta1.DeleteEndpointReque" + + "st\032\035.google.longrunning.Operation\"t\312A0\n\025" + + "google.protobuf.Empty\022\027DeleteOperationMe" + + "tadata\332A\004name\202\323\344\223\0024*2/v1beta1/{name=proj" + + "ects/*/locations/*/endpoints/*}\022\215\002\n\013Depl" + + "oyModel\0221.google.cloud.vertexai.v1beta1." + + "DeployModelRequest\032\035.google.longrunning." + + "Operation\"\253\001\312A3\n\023DeployModelResponse\022\034De" + + "ployModelOperationMetadata\332A%endpoint,de" + + "ployed_model,traffic_split\202\323\344\223\002G\"B/v1bet" + + "a1/{endpoint=projects/*/locations/*/endp" + + "oints/*}:deployModel:\001*\022\232\002\n\rUndeployMode" + + "l\0223.google.cloud.vertexai.v1beta1.Undepl" + + "oyModelRequest\032\035.google.longrunning.Oper" + + "ation\"\264\001\312A7\n\025UndeployModelResponse\022\036Unde" + + "ployModelOperationMetadata\332A(endpoint,de" + + "ployed_model_id,traffic_split\202\323\344\223\002I\"D/v1" + + "beta1/{endpoint=projects/*/locations/*/e" + + "ndpoints/*}:undeployModel:\001*\022\263\002\n\023MutateD" + + "eployedModel\0229.google.cloud.vertexai.v1b" + + "eta1.MutateDeployedModelRequest\032\035.google" + + ".longrunning.Operation\"\301\001\312AC\n\033MutateDepl" + + "oyedModelResponse\022$MutateDeployedModelOp" + + "erationMetadata\332A#endpoint,deployed_mode" + + "l,update_mask\202\323\344\223\002O\"J/v1beta1/{endpoint=" + + "projects/*/locations/*/endpoints/*}:muta" + + "teDeployedModel:\001*\032M\312A\031aiplatform.google" + + "apis.com\322A.https://www.googleapis.com/au" + + "th/cloud-platformB\331\001\n\035com.google.cloud.v" + + "ertexai.apiB\024EndpointServiceProtoP\001Z=clo" + + "ud.google.com/go/vertexai/apiv1beta1/ver" + + "texaipb;vertexaipb\252\002\035Google.Cloud.Vertex" + + "AI.V1Beta1\312\002\035Google\\Cloud\\VertexAI\\V1bet" + + "a1\352\002 Google::Cloud::VertexAI::V1beta1b\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.vertexai.api.EndpointProto.getDescriptor(), + com.google.cloud.vertexai.api.OperationProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_CreateEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_CreateEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_CreateEndpointRequest_descriptor, + new java.lang.String[] { + "Parent", "Endpoint", "EndpointId", + }); + internal_static_google_cloud_vertexai_v1beta1_CreateEndpointOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vertexai_v1beta1_CreateEndpointOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_CreateEndpointOperationMetadata_descriptor, + new java.lang.String[] { + "GenericMetadata", + }); + internal_static_google_cloud_vertexai_v1beta1_GetEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vertexai_v1beta1_GetEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_GetEndpointRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_vertexai_v1beta1_ListEndpointsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vertexai_v1beta1_ListEndpointsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ListEndpointsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", "ReadMask", + }); + internal_static_google_cloud_vertexai_v1beta1_ListEndpointsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vertexai_v1beta1_ListEndpointsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ListEndpointsResponse_descriptor, + new java.lang.String[] { + "Endpoints", "NextPageToken", + }); + internal_static_google_cloud_vertexai_v1beta1_UpdateEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vertexai_v1beta1_UpdateEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_UpdateEndpointRequest_descriptor, + new java.lang.String[] { + "Endpoint", "UpdateMask", + }); + internal_static_google_cloud_vertexai_v1beta1_DeleteEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_vertexai_v1beta1_DeleteEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DeleteEndpointRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_descriptor, + new java.lang.String[] { + "Endpoint", "DeployedModel", "TrafficSplit", + }); + internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_TrafficSplitEntry_descriptor = + internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_TrafficSplitEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DeployModelRequest_TrafficSplitEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_vertexai_v1beta1_DeployModelResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_vertexai_v1beta1_DeployModelResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DeployModelResponse_descriptor, + new java.lang.String[] { + "DeployedModel", + }); + internal_static_google_cloud_vertexai_v1beta1_DeployModelOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_vertexai_v1beta1_DeployModelOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DeployModelOperationMetadata_descriptor, + new java.lang.String[] { + "GenericMetadata", + }); + internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_descriptor, + new java.lang.String[] { + "Endpoint", "DeployedModelId", "TrafficSplit", + }); + internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_TrafficSplitEntry_descriptor = + internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_TrafficSplitEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_TrafficSplitEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_vertexai_v1beta1_UndeployModelResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_vertexai_v1beta1_UndeployModelResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_UndeployModelResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_vertexai_v1beta1_UndeployModelOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_vertexai_v1beta1_UndeployModelOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_UndeployModelOperationMetadata_descriptor, + new java.lang.String[] { + "GenericMetadata", + }); + internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelRequest_descriptor, + new java.lang.String[] { + "Endpoint", "DeployedModel", "UpdateMask", + }); + internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelResponse_descriptor, + new java.lang.String[] { + "DeployedModel", + }); + internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelOperationMetadata_descriptor, + new java.lang.String[] { + "GenericMetadata", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.vertexai.api.EndpointProto.getDescriptor(); + com.google.cloud.vertexai.api.OperationProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Examples.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Examples.java new file mode 100644 index 000000000000..7721e7227e5a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Examples.java @@ -0,0 +1,2975 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Example-based explainability that returns the nearest neighbors from the
+ * provided dataset.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Examples} + */ +public final class Examples extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Examples) + ExamplesOrBuilder { + private static final long serialVersionUID = 0L; + // Use Examples.newBuilder() to construct. + private Examples(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Examples() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Examples(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Examples_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Examples_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Examples.class, + com.google.cloud.vertexai.api.Examples.Builder.class); + } + + public interface ExampleGcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The format in which instances are given, if not specified, assume it's
+     * JSONL format. Currently only JSONL format is supported.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + int getDataFormatValue(); + /** + * + * + *
+     * The format in which instances are given, if not specified, assume it's
+     * JSONL format. Currently only JSONL format is supported.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @return The dataFormat. + */ + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat getDataFormat(); + + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + com.google.cloud.vertexai.api.GcsSource getGcsSource(); + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + */ + com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder(); + } + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource} + */ + public static final class ExampleGcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource) + ExampleGcsSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExampleGcsSource.newBuilder() to construct. + private ExampleGcsSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExampleGcsSource() { + dataFormat_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExampleGcsSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Examples_ExampleGcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Examples_ExampleGcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.class, + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.Builder.class); + } + + /** + * + * + *
+     * The format of the input example instances.
+     * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat} + */ + public enum DataFormat implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Format unspecified, used when unset.
+       * 
+ * + * DATA_FORMAT_UNSPECIFIED = 0; + */ + DATA_FORMAT_UNSPECIFIED(0), + /** + * + * + *
+       * Examples are stored in JSONL files.
+       * 
+ * + * JSONL = 1; + */ + JSONL(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Format unspecified, used when unset.
+       * 
+ * + * DATA_FORMAT_UNSPECIFIED = 0; + */ + public static final int DATA_FORMAT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Examples are stored in JSONL files.
+       * 
+ * + * JSONL = 1; + */ + public static final int JSONL_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataFormat valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DataFormat forNumber(int value) { + switch (value) { + case 0: + return DATA_FORMAT_UNSPECIFIED; + case 1: + return JSONL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DataFormat findValueByNumber(int number) { + return DataFormat.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.Examples.ExampleGcsSource.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final DataFormat[] VALUES = values(); + + public static DataFormat valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DataFormat(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat) + } + + public static final int DATA_FORMAT_FIELD_NUMBER = 1; + private int dataFormat_ = 0; + /** + * + * + *
+     * The format in which instances are given, if not specified, assume it's
+     * JSONL format. Currently only JSONL format is supported.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + @java.lang.Override + public int getDataFormatValue() { + return dataFormat_; + } + /** + * + * + *
+     * The format in which instances are given, if not specified, assume it's
+     * JSONL format. Currently only JSONL format is supported.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @return The dataFormat. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat getDataFormat() { + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat result = + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat.forNumber(dataFormat_); + return result == null + ? com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat.UNRECOGNIZED + : result; + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.GcsSource gcsSource_; + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return gcsSource_ != null; + } + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSource getGcsSource() { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder() { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (dataFormat_ + != com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat + .DATA_FORMAT_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, dataFormat_); + } + if (gcsSource_ != null) { + output.writeMessage(2, getGcsSource()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dataFormat_ + != com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat + .DATA_FORMAT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, dataFormat_); + } + if (gcsSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getGcsSource()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Examples.ExampleGcsSource)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Examples.ExampleGcsSource other = + (com.google.cloud.vertexai.api.Examples.ExampleGcsSource) obj; + + if (dataFormat_ != other.dataFormat_) return false; + if (hasGcsSource() != other.hasGcsSource()) return false; + if (hasGcsSource()) { + if (!getGcsSource().equals(other.getGcsSource())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATA_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + dataFormat_; + if (hasGcsSource()) { + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.Examples.ExampleGcsSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource) + com.google.cloud.vertexai.api.Examples.ExampleGcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Examples_ExampleGcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Examples_ExampleGcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.class, + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Examples.ExampleGcsSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dataFormat_ = 0; + gcsSource_ = null; + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.dispose(); + gcsSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Examples_ExampleGcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Examples.ExampleGcsSource getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Examples.ExampleGcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Examples.ExampleGcsSource build() { + com.google.cloud.vertexai.api.Examples.ExampleGcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Examples.ExampleGcsSource buildPartial() { + com.google.cloud.vertexai.api.Examples.ExampleGcsSource result = + new com.google.cloud.vertexai.api.Examples.ExampleGcsSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Examples.ExampleGcsSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dataFormat_ = dataFormat_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.gcsSource_ = gcsSourceBuilder_ == null ? gcsSource_ : gcsSourceBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Examples.ExampleGcsSource) { + return mergeFrom((com.google.cloud.vertexai.api.Examples.ExampleGcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Examples.ExampleGcsSource other) { + if (other == com.google.cloud.vertexai.api.Examples.ExampleGcsSource.getDefaultInstance()) + return this; + if (other.dataFormat_ != 0) { + setDataFormatValue(other.getDataFormatValue()); + } + if (other.hasGcsSource()) { + mergeGcsSource(other.getGcsSource()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + dataFormat_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getGcsSourceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int dataFormat_ = 0; + /** + * + * + *
+       * The format in which instances are given, if not specified, assume it's
+       * JSONL format. Currently only JSONL format is supported.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @return The enum numeric value on the wire for dataFormat. + */ + @java.lang.Override + public int getDataFormatValue() { + return dataFormat_; + } + /** + * + * + *
+       * The format in which instances are given, if not specified, assume it's
+       * JSONL format. Currently only JSONL format is supported.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @param value The enum numeric value on the wire for dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormatValue(int value) { + dataFormat_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The format in which instances are given, if not specified, assume it's
+       * JSONL format. Currently only JSONL format is supported.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @return The dataFormat. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat getDataFormat() { + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat result = + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat.forNumber( + dataFormat_); + return result == null + ? com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The format in which instances are given, if not specified, assume it's
+       * JSONL format. Currently only JSONL format is supported.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @param value The dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormat( + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.DataFormat value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + dataFormat_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The format in which instances are given, if not specified, assume it's
+       * JSONL format. Currently only JSONL format is supported.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearDataFormat() { + bitField0_ = (bitField0_ & ~0x00000001); + dataFormat_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.GcsSource gcsSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + public boolean hasGcsSource() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + public com.google.cloud.vertexai.api.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } else { + return gcsSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.vertexai.api.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcsSource_ = value; + } else { + gcsSourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.vertexai.api.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + gcsSource_ = builderForValue.build(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + */ + public Builder mergeGcsSource(com.google.cloud.vertexai.api.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && gcsSource_ != null + && gcsSource_ != com.google.cloud.vertexai.api.GcsSource.getDefaultInstance()) { + getGcsSourceBuilder().mergeFrom(value); + } else { + gcsSource_ = value; + } + } else { + gcsSourceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + */ + public Builder clearGcsSource() { + bitField0_ = (bitField0_ & ~0x00000002); + gcsSource_ = null; + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.dispose(); + gcsSourceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + */ + public com.google.cloud.vertexai.api.GcsSource.Builder getGcsSourceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + */ + public com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (gcsSourceBuilder_ != null) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder>( + getGcsSource(), getParentForChildren(), isClean()); + gcsSource_ = null; + } + return gcsSourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource) + private static final com.google.cloud.vertexai.api.Examples.ExampleGcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Examples.ExampleGcsSource(); + } + + public static com.google.cloud.vertexai.api.Examples.ExampleGcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExampleGcsSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Examples.ExampleGcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int sourceCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXAMPLE_GCS_SOURCE(5), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 5: + return EXAMPLE_GCS_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + private int configCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object config_; + + public enum ConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + NEAREST_NEIGHBOR_SEARCH_CONFIG(2), + PRESETS(4), + CONFIG_NOT_SET(0); + private final int value; + + private ConfigCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConfigCase valueOf(int value) { + return forNumber(value); + } + + public static ConfigCase forNumber(int value) { + switch (value) { + case 2: + return NEAREST_NEIGHBOR_SEARCH_CONFIG; + case 4: + return PRESETS; + case 0: + return CONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConfigCase getConfigCase() { + return ConfigCase.forNumber(configCase_); + } + + public static final int EXAMPLE_GCS_SOURCE_FIELD_NUMBER = 5; + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + * + * @return Whether the exampleGcsSource field is set. + */ + @java.lang.Override + public boolean hasExampleGcsSource() { + return sourceCase_ == 5; + } + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + * + * @return The exampleGcsSource. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Examples.ExampleGcsSource getExampleGcsSource() { + if (sourceCase_ == 5) { + return (com.google.cloud.vertexai.api.Examples.ExampleGcsSource) source_; + } + return com.google.cloud.vertexai.api.Examples.ExampleGcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Examples.ExampleGcsSourceOrBuilder + getExampleGcsSourceOrBuilder() { + if (sourceCase_ == 5) { + return (com.google.cloud.vertexai.api.Examples.ExampleGcsSource) source_; + } + return com.google.cloud.vertexai.api.Examples.ExampleGcsSource.getDefaultInstance(); + } + + public static final int NEAREST_NEIGHBOR_SEARCH_CONFIG_FIELD_NUMBER = 2; + /** + * + * + *
+   * The full configuration for the generated index, the semantics are the
+   * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+   * should match
+   * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+   * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + * + * @return Whether the nearestNeighborSearchConfig field is set. + */ + @java.lang.Override + public boolean hasNearestNeighborSearchConfig() { + return configCase_ == 2; + } + /** + * + * + *
+   * The full configuration for the generated index, the semantics are the
+   * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+   * should match
+   * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+   * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + * + * @return The nearestNeighborSearchConfig. + */ + @java.lang.Override + public com.google.protobuf.Value getNearestNeighborSearchConfig() { + if (configCase_ == 2) { + return (com.google.protobuf.Value) config_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } + /** + * + * + *
+   * The full configuration for the generated index, the semantics are the
+   * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+   * should match
+   * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+   * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getNearestNeighborSearchConfigOrBuilder() { + if (configCase_ == 2) { + return (com.google.protobuf.Value) config_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } + + public static final int PRESETS_FIELD_NUMBER = 4; + /** + * + * + *
+   * Simplified preset configuration, which automatically sets configuration
+   * values based on the desired query speed-precision trade-off and modality.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + * + * @return Whether the presets field is set. + */ + @java.lang.Override + public boolean hasPresets() { + return configCase_ == 4; + } + /** + * + * + *
+   * Simplified preset configuration, which automatically sets configuration
+   * values based on the desired query speed-precision trade-off and modality.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + * + * @return The presets. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Presets getPresets() { + if (configCase_ == 4) { + return (com.google.cloud.vertexai.api.Presets) config_; + } + return com.google.cloud.vertexai.api.Presets.getDefaultInstance(); + } + /** + * + * + *
+   * Simplified preset configuration, which automatically sets configuration
+   * values based on the desired query speed-precision trade-off and modality.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.PresetsOrBuilder getPresetsOrBuilder() { + if (configCase_ == 4) { + return (com.google.cloud.vertexai.api.Presets) config_; + } + return com.google.cloud.vertexai.api.Presets.getDefaultInstance(); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.GcsSource gcsSource_; + /** + * + * + *
+   * The Cloud Storage locations that contain the instances to be
+   * indexed for approximate nearest neighbor search.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return gcsSource_ != null; + } + /** + * + * + *
+   * The Cloud Storage locations that contain the instances to be
+   * indexed for approximate nearest neighbor search.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSource getGcsSource() { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + /** + * + * + *
+   * The Cloud Storage locations that contain the instances to be
+   * indexed for approximate nearest neighbor search.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder() { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + + public static final int NEIGHBOR_COUNT_FIELD_NUMBER = 3; + private int neighborCount_ = 0; + /** + * + * + *
+   * The number of neighbors to return when querying for examples.
+   * 
+ * + * int32 neighbor_count = 3; + * + * @return The neighborCount. + */ + @java.lang.Override + public int getNeighborCount() { + return neighborCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gcsSource_ != null) { + output.writeMessage(1, getGcsSource()); + } + if (configCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Value) config_); + } + if (neighborCount_ != 0) { + output.writeInt32(3, neighborCount_); + } + if (configCase_ == 4) { + output.writeMessage(4, (com.google.cloud.vertexai.api.Presets) config_); + } + if (sourceCase_ == 5) { + output.writeMessage(5, (com.google.cloud.vertexai.api.Examples.ExampleGcsSource) source_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gcsSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcsSource()); + } + if (configCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Value) config_); + } + if (neighborCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, neighborCount_); + } + if (configCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.vertexai.api.Presets) config_); + } + if (sourceCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.vertexai.api.Examples.ExampleGcsSource) source_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Examples)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Examples other = (com.google.cloud.vertexai.api.Examples) obj; + + if (hasGcsSource() != other.hasGcsSource()) return false; + if (hasGcsSource()) { + if (!getGcsSource().equals(other.getGcsSource())) return false; + } + if (getNeighborCount() != other.getNeighborCount()) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 5: + if (!getExampleGcsSource().equals(other.getExampleGcsSource())) return false; + break; + case 0: + default: + } + if (!getConfigCase().equals(other.getConfigCase())) return false; + switch (configCase_) { + case 2: + if (!getNearestNeighborSearchConfig().equals(other.getNearestNeighborSearchConfig())) + return false; + break; + case 4: + if (!getPresets().equals(other.getPresets())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGcsSource()) { + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + } + hash = (37 * hash) + NEIGHBOR_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNeighborCount(); + switch (sourceCase_) { + case 5: + hash = (37 * hash) + EXAMPLE_GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getExampleGcsSource().hashCode(); + break; + case 0: + default: + } + switch (configCase_) { + case 2: + hash = (37 * hash) + NEAREST_NEIGHBOR_SEARCH_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getNearestNeighborSearchConfig().hashCode(); + break; + case 4: + hash = (37 * hash) + PRESETS_FIELD_NUMBER; + hash = (53 * hash) + getPresets().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Examples parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Examples parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Examples parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Examples parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Examples parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Examples parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Examples parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Examples parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Examples parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Examples parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Examples parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Examples parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Examples prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Example-based explainability that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Examples} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Examples) + com.google.cloud.vertexai.api.ExamplesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Examples_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Examples_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Examples.class, + com.google.cloud.vertexai.api.Examples.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Examples.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (exampleGcsSourceBuilder_ != null) { + exampleGcsSourceBuilder_.clear(); + } + if (nearestNeighborSearchConfigBuilder_ != null) { + nearestNeighborSearchConfigBuilder_.clear(); + } + if (presetsBuilder_ != null) { + presetsBuilder_.clear(); + } + gcsSource_ = null; + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.dispose(); + gcsSourceBuilder_ = null; + } + neighborCount_ = 0; + sourceCase_ = 0; + source_ = null; + configCase_ = 0; + config_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Examples_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Examples getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Examples.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Examples build() { + com.google.cloud.vertexai.api.Examples result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Examples buildPartial() { + com.google.cloud.vertexai.api.Examples result = + new com.google.cloud.vertexai.api.Examples(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Examples result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.gcsSource_ = gcsSourceBuilder_ == null ? gcsSource_ : gcsSourceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.neighborCount_ = neighborCount_; + } + } + + private void buildPartialOneofs(com.google.cloud.vertexai.api.Examples result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 5 && exampleGcsSourceBuilder_ != null) { + result.source_ = exampleGcsSourceBuilder_.build(); + } + result.configCase_ = configCase_; + result.config_ = this.config_; + if (configCase_ == 2 && nearestNeighborSearchConfigBuilder_ != null) { + result.config_ = nearestNeighborSearchConfigBuilder_.build(); + } + if (configCase_ == 4 && presetsBuilder_ != null) { + result.config_ = presetsBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Examples) { + return mergeFrom((com.google.cloud.vertexai.api.Examples) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Examples other) { + if (other == com.google.cloud.vertexai.api.Examples.getDefaultInstance()) return this; + if (other.hasGcsSource()) { + mergeGcsSource(other.getGcsSource()); + } + if (other.getNeighborCount() != 0) { + setNeighborCount(other.getNeighborCount()); + } + switch (other.getSourceCase()) { + case EXAMPLE_GCS_SOURCE: + { + mergeExampleGcsSource(other.getExampleGcsSource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + switch (other.getConfigCase()) { + case NEAREST_NEIGHBOR_SEARCH_CONFIG: + { + mergeNearestNeighborSearchConfig(other.getNearestNeighborSearchConfig()); + break; + } + case PRESETS: + { + mergePresets(other.getPresets()); + break; + } + case CONFIG_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGcsSourceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 10 + case 18: + { + input.readMessage( + getNearestNeighborSearchConfigFieldBuilder().getBuilder(), extensionRegistry); + configCase_ = 2; + break; + } // case 18 + case 24: + { + neighborCount_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 24 + case 34: + { + input.readMessage(getPresetsFieldBuilder().getBuilder(), extensionRegistry); + configCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getExampleGcsSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 5; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private int configCase_ = 0; + private java.lang.Object config_; + + public ConfigCase getConfigCase() { + return ConfigCase.forNumber(configCase_); + } + + public Builder clearConfig() { + configCase_ = 0; + config_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Examples.ExampleGcsSource, + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.Builder, + com.google.cloud.vertexai.api.Examples.ExampleGcsSourceOrBuilder> + exampleGcsSourceBuilder_; + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + * + * @return Whether the exampleGcsSource field is set. + */ + @java.lang.Override + public boolean hasExampleGcsSource() { + return sourceCase_ == 5; + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + * + * @return The exampleGcsSource. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Examples.ExampleGcsSource getExampleGcsSource() { + if (exampleGcsSourceBuilder_ == null) { + if (sourceCase_ == 5) { + return (com.google.cloud.vertexai.api.Examples.ExampleGcsSource) source_; + } + return com.google.cloud.vertexai.api.Examples.ExampleGcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 5) { + return exampleGcsSourceBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.Examples.ExampleGcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + public Builder setExampleGcsSource( + com.google.cloud.vertexai.api.Examples.ExampleGcsSource value) { + if (exampleGcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + exampleGcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 5; + return this; + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + public Builder setExampleGcsSource( + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.Builder builderForValue) { + if (exampleGcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + exampleGcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 5; + return this; + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + public Builder mergeExampleGcsSource( + com.google.cloud.vertexai.api.Examples.ExampleGcsSource value) { + if (exampleGcsSourceBuilder_ == null) { + if (sourceCase_ == 5 + && source_ + != com.google.cloud.vertexai.api.Examples.ExampleGcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.newBuilder( + (com.google.cloud.vertexai.api.Examples.ExampleGcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 5) { + exampleGcsSourceBuilder_.mergeFrom(value); + } else { + exampleGcsSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 5; + return this; + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + public Builder clearExampleGcsSource() { + if (exampleGcsSourceBuilder_ == null) { + if (sourceCase_ == 5) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 5) { + sourceCase_ = 0; + source_ = null; + } + exampleGcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + public com.google.cloud.vertexai.api.Examples.ExampleGcsSource.Builder + getExampleGcsSourceBuilder() { + return getExampleGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Examples.ExampleGcsSourceOrBuilder + getExampleGcsSourceOrBuilder() { + if ((sourceCase_ == 5) && (exampleGcsSourceBuilder_ != null)) { + return exampleGcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 5) { + return (com.google.cloud.vertexai.api.Examples.ExampleGcsSource) source_; + } + return com.google.cloud.vertexai.api.Examples.ExampleGcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Examples.ExampleGcsSource, + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.Builder, + com.google.cloud.vertexai.api.Examples.ExampleGcsSourceOrBuilder> + getExampleGcsSourceFieldBuilder() { + if (exampleGcsSourceBuilder_ == null) { + if (!(sourceCase_ == 5)) { + source_ = com.google.cloud.vertexai.api.Examples.ExampleGcsSource.getDefaultInstance(); + } + exampleGcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Examples.ExampleGcsSource, + com.google.cloud.vertexai.api.Examples.ExampleGcsSource.Builder, + com.google.cloud.vertexai.api.Examples.ExampleGcsSourceOrBuilder>( + (com.google.cloud.vertexai.api.Examples.ExampleGcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 5; + onChanged(); + return exampleGcsSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + nearestNeighborSearchConfigBuilder_; + /** + * + * + *
+     * The full configuration for the generated index, the semantics are the
+     * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+     * should match
+     * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+     * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + * + * @return Whether the nearestNeighborSearchConfig field is set. + */ + @java.lang.Override + public boolean hasNearestNeighborSearchConfig() { + return configCase_ == 2; + } + /** + * + * + *
+     * The full configuration for the generated index, the semantics are the
+     * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+     * should match
+     * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+     * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + * + * @return The nearestNeighborSearchConfig. + */ + @java.lang.Override + public com.google.protobuf.Value getNearestNeighborSearchConfig() { + if (nearestNeighborSearchConfigBuilder_ == null) { + if (configCase_ == 2) { + return (com.google.protobuf.Value) config_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } else { + if (configCase_ == 2) { + return nearestNeighborSearchConfigBuilder_.getMessage(); + } + return com.google.protobuf.Value.getDefaultInstance(); + } + } + /** + * + * + *
+     * The full configuration for the generated index, the semantics are the
+     * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+     * should match
+     * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+     * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + */ + public Builder setNearestNeighborSearchConfig(com.google.protobuf.Value value) { + if (nearestNeighborSearchConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + nearestNeighborSearchConfigBuilder_.setMessage(value); + } + configCase_ = 2; + return this; + } + /** + * + * + *
+     * The full configuration for the generated index, the semantics are the
+     * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+     * should match
+     * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+     * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + */ + public Builder setNearestNeighborSearchConfig( + com.google.protobuf.Value.Builder builderForValue) { + if (nearestNeighborSearchConfigBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + nearestNeighborSearchConfigBuilder_.setMessage(builderForValue.build()); + } + configCase_ = 2; + return this; + } + /** + * + * + *
+     * The full configuration for the generated index, the semantics are the
+     * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+     * should match
+     * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+     * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + */ + public Builder mergeNearestNeighborSearchConfig(com.google.protobuf.Value value) { + if (nearestNeighborSearchConfigBuilder_ == null) { + if (configCase_ == 2 && config_ != com.google.protobuf.Value.getDefaultInstance()) { + config_ = + com.google.protobuf.Value.newBuilder((com.google.protobuf.Value) config_) + .mergeFrom(value) + .buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + if (configCase_ == 2) { + nearestNeighborSearchConfigBuilder_.mergeFrom(value); + } else { + nearestNeighborSearchConfigBuilder_.setMessage(value); + } + } + configCase_ = 2; + return this; + } + /** + * + * + *
+     * The full configuration for the generated index, the semantics are the
+     * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+     * should match
+     * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+     * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + */ + public Builder clearNearestNeighborSearchConfig() { + if (nearestNeighborSearchConfigBuilder_ == null) { + if (configCase_ == 2) { + configCase_ = 0; + config_ = null; + onChanged(); + } + } else { + if (configCase_ == 2) { + configCase_ = 0; + config_ = null; + } + nearestNeighborSearchConfigBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The full configuration for the generated index, the semantics are the
+     * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+     * should match
+     * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+     * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + */ + public com.google.protobuf.Value.Builder getNearestNeighborSearchConfigBuilder() { + return getNearestNeighborSearchConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The full configuration for the generated index, the semantics are the
+     * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+     * should match
+     * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+     * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getNearestNeighborSearchConfigOrBuilder() { + if ((configCase_ == 2) && (nearestNeighborSearchConfigBuilder_ != null)) { + return nearestNeighborSearchConfigBuilder_.getMessageOrBuilder(); + } else { + if (configCase_ == 2) { + return (com.google.protobuf.Value) config_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } + } + /** + * + * + *
+     * The full configuration for the generated index, the semantics are the
+     * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+     * should match
+     * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+     * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getNearestNeighborSearchConfigFieldBuilder() { + if (nearestNeighborSearchConfigBuilder_ == null) { + if (!(configCase_ == 2)) { + config_ = com.google.protobuf.Value.getDefaultInstance(); + } + nearestNeighborSearchConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + (com.google.protobuf.Value) config_, getParentForChildren(), isClean()); + config_ = null; + } + configCase_ = 2; + onChanged(); + return nearestNeighborSearchConfigBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Presets, + com.google.cloud.vertexai.api.Presets.Builder, + com.google.cloud.vertexai.api.PresetsOrBuilder> + presetsBuilder_; + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + * + * @return Whether the presets field is set. + */ + @java.lang.Override + public boolean hasPresets() { + return configCase_ == 4; + } + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + * + * @return The presets. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Presets getPresets() { + if (presetsBuilder_ == null) { + if (configCase_ == 4) { + return (com.google.cloud.vertexai.api.Presets) config_; + } + return com.google.cloud.vertexai.api.Presets.getDefaultInstance(); + } else { + if (configCase_ == 4) { + return presetsBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.Presets.getDefaultInstance(); + } + } + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + */ + public Builder setPresets(com.google.cloud.vertexai.api.Presets value) { + if (presetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + presetsBuilder_.setMessage(value); + } + configCase_ = 4; + return this; + } + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + */ + public Builder setPresets(com.google.cloud.vertexai.api.Presets.Builder builderForValue) { + if (presetsBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + presetsBuilder_.setMessage(builderForValue.build()); + } + configCase_ = 4; + return this; + } + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + */ + public Builder mergePresets(com.google.cloud.vertexai.api.Presets value) { + if (presetsBuilder_ == null) { + if (configCase_ == 4 + && config_ != com.google.cloud.vertexai.api.Presets.getDefaultInstance()) { + config_ = + com.google.cloud.vertexai.api.Presets.newBuilder( + (com.google.cloud.vertexai.api.Presets) config_) + .mergeFrom(value) + .buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + if (configCase_ == 4) { + presetsBuilder_.mergeFrom(value); + } else { + presetsBuilder_.setMessage(value); + } + } + configCase_ = 4; + return this; + } + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + */ + public Builder clearPresets() { + if (presetsBuilder_ == null) { + if (configCase_ == 4) { + configCase_ = 0; + config_ = null; + onChanged(); + } + } else { + if (configCase_ == 4) { + configCase_ = 0; + config_ = null; + } + presetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + */ + public com.google.cloud.vertexai.api.Presets.Builder getPresetsBuilder() { + return getPresetsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.PresetsOrBuilder getPresetsOrBuilder() { + if ((configCase_ == 4) && (presetsBuilder_ != null)) { + return presetsBuilder_.getMessageOrBuilder(); + } else { + if (configCase_ == 4) { + return (com.google.cloud.vertexai.api.Presets) config_; + } + return com.google.cloud.vertexai.api.Presets.getDefaultInstance(); + } + } + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Presets, + com.google.cloud.vertexai.api.Presets.Builder, + com.google.cloud.vertexai.api.PresetsOrBuilder> + getPresetsFieldBuilder() { + if (presetsBuilder_ == null) { + if (!(configCase_ == 4)) { + config_ = com.google.cloud.vertexai.api.Presets.getDefaultInstance(); + } + presetsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Presets, + com.google.cloud.vertexai.api.Presets.Builder, + com.google.cloud.vertexai.api.PresetsOrBuilder>( + (com.google.cloud.vertexai.api.Presets) config_, getParentForChildren(), isClean()); + config_ = null; + } + configCase_ = 4; + onChanged(); + return presetsBuilder_; + } + + private com.google.cloud.vertexai.api.GcsSource gcsSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * The Cloud Storage locations that contain the instances to be
+     * indexed for approximate nearest neighbor search.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. + */ + public boolean hasGcsSource() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The Cloud Storage locations that contain the instances to be
+     * indexed for approximate nearest neighbor search.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + public com.google.cloud.vertexai.api.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } else { + return gcsSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Cloud Storage locations that contain the instances to be
+     * indexed for approximate nearest neighbor search.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.vertexai.api.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcsSource_ = value; + } else { + gcsSourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud Storage locations that contain the instances to be
+     * indexed for approximate nearest neighbor search.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + */ + public Builder setGcsSource(com.google.cloud.vertexai.api.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + gcsSource_ = builderForValue.build(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud Storage locations that contain the instances to be
+     * indexed for approximate nearest neighbor search.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + */ + public Builder mergeGcsSource(com.google.cloud.vertexai.api.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && gcsSource_ != null + && gcsSource_ != com.google.cloud.vertexai.api.GcsSource.getDefaultInstance()) { + getGcsSourceBuilder().mergeFrom(value); + } else { + gcsSource_ = value; + } + } else { + gcsSourceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud Storage locations that contain the instances to be
+     * indexed for approximate nearest neighbor search.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + */ + public Builder clearGcsSource() { + bitField0_ = (bitField0_ & ~0x00000008); + gcsSource_ = null; + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.dispose(); + gcsSourceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud Storage locations that contain the instances to be
+     * indexed for approximate nearest neighbor search.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vertexai.api.GcsSource.Builder getGcsSourceBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Cloud Storage locations that contain the instances to be
+     * indexed for approximate nearest neighbor search.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + */ + public com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (gcsSourceBuilder_ != null) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + return gcsSource_ == null + ? com.google.cloud.vertexai.api.GcsSource.getDefaultInstance() + : gcsSource_; + } + } + /** + * + * + *
+     * The Cloud Storage locations that contain the instances to be
+     * indexed for approximate nearest neighbor search.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsSource, + com.google.cloud.vertexai.api.GcsSource.Builder, + com.google.cloud.vertexai.api.GcsSourceOrBuilder>( + getGcsSource(), getParentForChildren(), isClean()); + gcsSource_ = null; + } + return gcsSourceBuilder_; + } + + private int neighborCount_; + /** + * + * + *
+     * The number of neighbors to return when querying for examples.
+     * 
+ * + * int32 neighbor_count = 3; + * + * @return The neighborCount. + */ + @java.lang.Override + public int getNeighborCount() { + return neighborCount_; + } + /** + * + * + *
+     * The number of neighbors to return when querying for examples.
+     * 
+ * + * int32 neighbor_count = 3; + * + * @param value The neighborCount to set. + * @return This builder for chaining. + */ + public Builder setNeighborCount(int value) { + + neighborCount_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of neighbors to return when querying for examples.
+     * 
+ * + * int32 neighbor_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearNeighborCount() { + bitField0_ = (bitField0_ & ~0x00000010); + neighborCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Examples) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Examples) + private static final com.google.cloud.vertexai.api.Examples DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Examples(); + } + + public static com.google.cloud.vertexai.api.Examples getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Examples parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Examples getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesOrBuilder.java new file mode 100644 index 000000000000..c827efdb6be7 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesOrBuilder.java @@ -0,0 +1,197 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface ExamplesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Examples) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + * + * @return Whether the exampleGcsSource field is set. + */ + boolean hasExampleGcsSource(); + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + * + * @return The exampleGcsSource. + */ + com.google.cloud.vertexai.api.Examples.ExampleGcsSource getExampleGcsSource(); + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + com.google.cloud.vertexai.api.Examples.ExampleGcsSourceOrBuilder getExampleGcsSourceOrBuilder(); + + /** + * + * + *
+   * The full configuration for the generated index, the semantics are the
+   * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+   * should match
+   * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+   * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + * + * @return Whether the nearestNeighborSearchConfig field is set. + */ + boolean hasNearestNeighborSearchConfig(); + /** + * + * + *
+   * The full configuration for the generated index, the semantics are the
+   * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+   * should match
+   * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+   * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + * + * @return The nearestNeighborSearchConfig. + */ + com.google.protobuf.Value getNearestNeighborSearchConfig(); + /** + * + * + *
+   * The full configuration for the generated index, the semantics are the
+   * same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and
+   * should match
+   * [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config).
+   * 
+ * + * .google.protobuf.Value nearest_neighbor_search_config = 2; + */ + com.google.protobuf.ValueOrBuilder getNearestNeighborSearchConfigOrBuilder(); + + /** + * + * + *
+   * Simplified preset configuration, which automatically sets configuration
+   * values based on the desired query speed-precision trade-off and modality.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + * + * @return Whether the presets field is set. + */ + boolean hasPresets(); + /** + * + * + *
+   * Simplified preset configuration, which automatically sets configuration
+   * values based on the desired query speed-precision trade-off and modality.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + * + * @return The presets. + */ + com.google.cloud.vertexai.api.Presets getPresets(); + /** + * + * + *
+   * Simplified preset configuration, which automatically sets configuration
+   * values based on the desired query speed-precision trade-off and modality.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Presets presets = 4; + */ + com.google.cloud.vertexai.api.PresetsOrBuilder getPresetsOrBuilder(); + + /** + * + * + *
+   * The Cloud Storage locations that contain the instances to be
+   * indexed for approximate nearest neighbor search.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * The Cloud Storage locations that contain the instances to be
+   * indexed for approximate nearest neighbor search.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + * + * @return The gcsSource. + */ + com.google.cloud.vertexai.api.GcsSource getGcsSource(); + /** + * + * + *
+   * The Cloud Storage locations that contain the instances to be
+   * indexed for approximate nearest neighbor search.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GcsSource gcs_source = 1; + */ + com.google.cloud.vertexai.api.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * The number of neighbors to return when querying for examples.
+   * 
+ * + * int32 neighbor_count = 3; + * + * @return The neighborCount. + */ + int getNeighborCount(); + + com.google.cloud.vertexai.api.Examples.SourceCase getSourceCase(); + + com.google.cloud.vertexai.api.Examples.ConfigCase getConfigCase(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesOverride.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesOverride.java new file mode 100644 index 000000000000..ed7ac27d96ad --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesOverride.java @@ -0,0 +1,1570 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Overrides for example-based explanations.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExamplesOverride} + */ +public final class ExamplesOverride extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExamplesOverride) + ExamplesOverrideOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExamplesOverride.newBuilder() to construct. + private ExamplesOverride(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExamplesOverride() { + restrictions_ = java.util.Collections.emptyList(); + dataFormat_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExamplesOverride(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExamplesOverride_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExamplesOverride_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExamplesOverride.class, + com.google.cloud.vertexai.api.ExamplesOverride.Builder.class); + } + + /** + * + * + *
+   * Data format enum.
+   * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat} + */ + public enum DataFormat implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified format. Must not be used.
+     * 
+ * + * DATA_FORMAT_UNSPECIFIED = 0; + */ + DATA_FORMAT_UNSPECIFIED(0), + /** + * + * + *
+     * Provided data is a set of model inputs.
+     * 
+ * + * INSTANCES = 1; + */ + INSTANCES(1), + /** + * + * + *
+     * Provided data is a set of embeddings.
+     * 
+ * + * EMBEDDINGS = 2; + */ + EMBEDDINGS(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified format. Must not be used.
+     * 
+ * + * DATA_FORMAT_UNSPECIFIED = 0; + */ + public static final int DATA_FORMAT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Provided data is a set of model inputs.
+     * 
+ * + * INSTANCES = 1; + */ + public static final int INSTANCES_VALUE = 1; + /** + * + * + *
+     * Provided data is a set of embeddings.
+     * 
+ * + * EMBEDDINGS = 2; + */ + public static final int EMBEDDINGS_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataFormat valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DataFormat forNumber(int value) { + switch (value) { + case 0: + return DATA_FORMAT_UNSPECIFIED; + case 1: + return INSTANCES; + case 2: + return EMBEDDINGS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DataFormat findValueByNumber(int number) { + return DataFormat.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExamplesOverride.getDescriptor().getEnumTypes().get(0); + } + + private static final DataFormat[] VALUES = values(); + + public static DataFormat valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DataFormat(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat) + } + + public static final int NEIGHBOR_COUNT_FIELD_NUMBER = 1; + private int neighborCount_ = 0; + /** + * + * + *
+   * The number of neighbors to return.
+   * 
+ * + * int32 neighbor_count = 1; + * + * @return The neighborCount. + */ + @java.lang.Override + public int getNeighborCount() { + return neighborCount_; + } + + public static final int CROWDING_COUNT_FIELD_NUMBER = 2; + private int crowdingCount_ = 0; + /** + * + * + *
+   * The number of neighbors to return that have the same crowding tag.
+   * 
+ * + * int32 crowding_count = 2; + * + * @return The crowdingCount. + */ + @java.lang.Override + public int getCrowdingCount() { + return crowdingCount_; + } + + public static final int RESTRICTIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List restrictions_; + /** + * + * + *
+   * Restrict the resulting nearest neighbors to respect these constraints.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + @java.lang.Override + public java.util.List + getRestrictionsList() { + return restrictions_; + } + /** + * + * + *
+   * Restrict the resulting nearest neighbors to respect these constraints.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.vertexai.api.ExamplesRestrictionsNamespaceOrBuilder> + getRestrictionsOrBuilderList() { + return restrictions_; + } + /** + * + * + *
+   * Restrict the resulting nearest neighbors to respect these constraints.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + @java.lang.Override + public int getRestrictionsCount() { + return restrictions_.size(); + } + /** + * + * + *
+   * Restrict the resulting nearest neighbors to respect these constraints.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace getRestrictions(int index) { + return restrictions_.get(index); + } + /** + * + * + *
+   * Restrict the resulting nearest neighbors to respect these constraints.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespaceOrBuilder + getRestrictionsOrBuilder(int index) { + return restrictions_.get(index); + } + + public static final int RETURN_EMBEDDINGS_FIELD_NUMBER = 4; + private boolean returnEmbeddings_ = false; + /** + * + * + *
+   * If true, return the embeddings instead of neighbors.
+   * 
+ * + * bool return_embeddings = 4; + * + * @return The returnEmbeddings. + */ + @java.lang.Override + public boolean getReturnEmbeddings() { + return returnEmbeddings_; + } + + public static final int DATA_FORMAT_FIELD_NUMBER = 5; + private int dataFormat_ = 0; + /** + * + * + *
+   * The format of the data being provided with each call.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat data_format = 5; + * + * @return The enum numeric value on the wire for dataFormat. + */ + @java.lang.Override + public int getDataFormatValue() { + return dataFormat_; + } + /** + * + * + *
+   * The format of the data being provided with each call.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat data_format = 5; + * + * @return The dataFormat. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesOverride.DataFormat getDataFormat() { + com.google.cloud.vertexai.api.ExamplesOverride.DataFormat result = + com.google.cloud.vertexai.api.ExamplesOverride.DataFormat.forNumber(dataFormat_); + return result == null + ? com.google.cloud.vertexai.api.ExamplesOverride.DataFormat.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (neighborCount_ != 0) { + output.writeInt32(1, neighborCount_); + } + if (crowdingCount_ != 0) { + output.writeInt32(2, crowdingCount_); + } + for (int i = 0; i < restrictions_.size(); i++) { + output.writeMessage(3, restrictions_.get(i)); + } + if (returnEmbeddings_ != false) { + output.writeBool(4, returnEmbeddings_); + } + if (dataFormat_ + != com.google.cloud.vertexai.api.ExamplesOverride.DataFormat.DATA_FORMAT_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, dataFormat_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (neighborCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, neighborCount_); + } + if (crowdingCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, crowdingCount_); + } + for (int i = 0; i < restrictions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, restrictions_.get(i)); + } + if (returnEmbeddings_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, returnEmbeddings_); + } + if (dataFormat_ + != com.google.cloud.vertexai.api.ExamplesOverride.DataFormat.DATA_FORMAT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, dataFormat_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExamplesOverride)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExamplesOverride other = + (com.google.cloud.vertexai.api.ExamplesOverride) obj; + + if (getNeighborCount() != other.getNeighborCount()) return false; + if (getCrowdingCount() != other.getCrowdingCount()) return false; + if (!getRestrictionsList().equals(other.getRestrictionsList())) return false; + if (getReturnEmbeddings() != other.getReturnEmbeddings()) return false; + if (dataFormat_ != other.dataFormat_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NEIGHBOR_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNeighborCount(); + hash = (37 * hash) + CROWDING_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCrowdingCount(); + if (getRestrictionsCount() > 0) { + hash = (37 * hash) + RESTRICTIONS_FIELD_NUMBER; + hash = (53 * hash) + getRestrictionsList().hashCode(); + } + hash = (37 * hash) + RETURN_EMBEDDINGS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReturnEmbeddings()); + hash = (37 * hash) + DATA_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + dataFormat_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ExamplesOverride prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Overrides for example-based explanations.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExamplesOverride} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExamplesOverride) + com.google.cloud.vertexai.api.ExamplesOverrideOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExamplesOverride_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExamplesOverride_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExamplesOverride.class, + com.google.cloud.vertexai.api.ExamplesOverride.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ExamplesOverride.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + neighborCount_ = 0; + crowdingCount_ = 0; + if (restrictionsBuilder_ == null) { + restrictions_ = java.util.Collections.emptyList(); + } else { + restrictions_ = null; + restrictionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + returnEmbeddings_ = false; + dataFormat_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExamplesOverride_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesOverride getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExamplesOverride.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesOverride build() { + com.google.cloud.vertexai.api.ExamplesOverride result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesOverride buildPartial() { + com.google.cloud.vertexai.api.ExamplesOverride result = + new com.google.cloud.vertexai.api.ExamplesOverride(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.ExamplesOverride result) { + if (restrictionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + restrictions_ = java.util.Collections.unmodifiableList(restrictions_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.restrictions_ = restrictions_; + } else { + result.restrictions_ = restrictionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.ExamplesOverride result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.neighborCount_ = neighborCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.crowdingCount_ = crowdingCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.returnEmbeddings_ = returnEmbeddings_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.dataFormat_ = dataFormat_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExamplesOverride) { + return mergeFrom((com.google.cloud.vertexai.api.ExamplesOverride) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ExamplesOverride other) { + if (other == com.google.cloud.vertexai.api.ExamplesOverride.getDefaultInstance()) return this; + if (other.getNeighborCount() != 0) { + setNeighborCount(other.getNeighborCount()); + } + if (other.getCrowdingCount() != 0) { + setCrowdingCount(other.getCrowdingCount()); + } + if (restrictionsBuilder_ == null) { + if (!other.restrictions_.isEmpty()) { + if (restrictions_.isEmpty()) { + restrictions_ = other.restrictions_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureRestrictionsIsMutable(); + restrictions_.addAll(other.restrictions_); + } + onChanged(); + } + } else { + if (!other.restrictions_.isEmpty()) { + if (restrictionsBuilder_.isEmpty()) { + restrictionsBuilder_.dispose(); + restrictionsBuilder_ = null; + restrictions_ = other.restrictions_; + bitField0_ = (bitField0_ & ~0x00000004); + restrictionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRestrictionsFieldBuilder() + : null; + } else { + restrictionsBuilder_.addAllMessages(other.restrictions_); + } + } + } + if (other.getReturnEmbeddings() != false) { + setReturnEmbeddings(other.getReturnEmbeddings()); + } + if (other.dataFormat_ != 0) { + setDataFormatValue(other.getDataFormatValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + neighborCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + crowdingCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace m = + input.readMessage( + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.parser(), + extensionRegistry); + if (restrictionsBuilder_ == null) { + ensureRestrictionsIsMutable(); + restrictions_.add(m); + } else { + restrictionsBuilder_.addMessage(m); + } + break; + } // case 26 + case 32: + { + returnEmbeddings_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + dataFormat_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int neighborCount_; + /** + * + * + *
+     * The number of neighbors to return.
+     * 
+ * + * int32 neighbor_count = 1; + * + * @return The neighborCount. + */ + @java.lang.Override + public int getNeighborCount() { + return neighborCount_; + } + /** + * + * + *
+     * The number of neighbors to return.
+     * 
+ * + * int32 neighbor_count = 1; + * + * @param value The neighborCount to set. + * @return This builder for chaining. + */ + public Builder setNeighborCount(int value) { + + neighborCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of neighbors to return.
+     * 
+ * + * int32 neighbor_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearNeighborCount() { + bitField0_ = (bitField0_ & ~0x00000001); + neighborCount_ = 0; + onChanged(); + return this; + } + + private int crowdingCount_; + /** + * + * + *
+     * The number of neighbors to return that have the same crowding tag.
+     * 
+ * + * int32 crowding_count = 2; + * + * @return The crowdingCount. + */ + @java.lang.Override + public int getCrowdingCount() { + return crowdingCount_; + } + /** + * + * + *
+     * The number of neighbors to return that have the same crowding tag.
+     * 
+ * + * int32 crowding_count = 2; + * + * @param value The crowdingCount to set. + * @return This builder for chaining. + */ + public Builder setCrowdingCount(int value) { + + crowdingCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of neighbors to return that have the same crowding tag.
+     * 
+ * + * int32 crowding_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearCrowdingCount() { + bitField0_ = (bitField0_ & ~0x00000002); + crowdingCount_ = 0; + onChanged(); + return this; + } + + private java.util.List + restrictions_ = java.util.Collections.emptyList(); + + private void ensureRestrictionsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + restrictions_ = + new java.util.ArrayList( + restrictions_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespaceOrBuilder> + restrictionsBuilder_; + + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public java.util.List + getRestrictionsList() { + if (restrictionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(restrictions_); + } else { + return restrictionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public int getRestrictionsCount() { + if (restrictionsBuilder_ == null) { + return restrictions_.size(); + } else { + return restrictionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace getRestrictions(int index) { + if (restrictionsBuilder_ == null) { + return restrictions_.get(index); + } else { + return restrictionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public Builder setRestrictions( + int index, com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace value) { + if (restrictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictionsIsMutable(); + restrictions_.set(index, value); + onChanged(); + } else { + restrictionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public Builder setRestrictions( + int index, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder builderForValue) { + if (restrictionsBuilder_ == null) { + ensureRestrictionsIsMutable(); + restrictions_.set(index, builderForValue.build()); + onChanged(); + } else { + restrictionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public Builder addRestrictions( + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace value) { + if (restrictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictionsIsMutable(); + restrictions_.add(value); + onChanged(); + } else { + restrictionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public Builder addRestrictions( + int index, com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace value) { + if (restrictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictionsIsMutable(); + restrictions_.add(index, value); + onChanged(); + } else { + restrictionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public Builder addRestrictions( + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder builderForValue) { + if (restrictionsBuilder_ == null) { + ensureRestrictionsIsMutable(); + restrictions_.add(builderForValue.build()); + onChanged(); + } else { + restrictionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public Builder addRestrictions( + int index, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder builderForValue) { + if (restrictionsBuilder_ == null) { + ensureRestrictionsIsMutable(); + restrictions_.add(index, builderForValue.build()); + onChanged(); + } else { + restrictionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public Builder addAllRestrictions( + java.lang.Iterable + values) { + if (restrictionsBuilder_ == null) { + ensureRestrictionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, restrictions_); + onChanged(); + } else { + restrictionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public Builder clearRestrictions() { + if (restrictionsBuilder_ == null) { + restrictions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + restrictionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public Builder removeRestrictions(int index) { + if (restrictionsBuilder_ == null) { + ensureRestrictionsIsMutable(); + restrictions_.remove(index); + onChanged(); + } else { + restrictionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder + getRestrictionsBuilder(int index) { + return getRestrictionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespaceOrBuilder + getRestrictionsOrBuilder(int index) { + if (restrictionsBuilder_ == null) { + return restrictions_.get(index); + } else { + return restrictionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.vertexai.api.ExamplesRestrictionsNamespaceOrBuilder> + getRestrictionsOrBuilderList() { + if (restrictionsBuilder_ != null) { + return restrictionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(restrictions_); + } + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder + addRestrictionsBuilder() { + return getRestrictionsFieldBuilder() + .addBuilder( + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.getDefaultInstance()); + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder + addRestrictionsBuilder(int index) { + return getRestrictionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.getDefaultInstance()); + } + /** + * + * + *
+     * Restrict the resulting nearest neighbors to respect these constraints.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + public java.util.List + getRestrictionsBuilderList() { + return getRestrictionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespaceOrBuilder> + getRestrictionsFieldBuilder() { + if (restrictionsBuilder_ == null) { + restrictionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespaceOrBuilder>( + restrictions_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + restrictions_ = null; + } + return restrictionsBuilder_; + } + + private boolean returnEmbeddings_; + /** + * + * + *
+     * If true, return the embeddings instead of neighbors.
+     * 
+ * + * bool return_embeddings = 4; + * + * @return The returnEmbeddings. + */ + @java.lang.Override + public boolean getReturnEmbeddings() { + return returnEmbeddings_; + } + /** + * + * + *
+     * If true, return the embeddings instead of neighbors.
+     * 
+ * + * bool return_embeddings = 4; + * + * @param value The returnEmbeddings to set. + * @return This builder for chaining. + */ + public Builder setReturnEmbeddings(boolean value) { + + returnEmbeddings_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, return the embeddings instead of neighbors.
+     * 
+ * + * bool return_embeddings = 4; + * + * @return This builder for chaining. + */ + public Builder clearReturnEmbeddings() { + bitField0_ = (bitField0_ & ~0x00000008); + returnEmbeddings_ = false; + onChanged(); + return this; + } + + private int dataFormat_ = 0; + /** + * + * + *
+     * The format of the data being provided with each call.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat data_format = 5; + * + * @return The enum numeric value on the wire for dataFormat. + */ + @java.lang.Override + public int getDataFormatValue() { + return dataFormat_; + } + /** + * + * + *
+     * The format of the data being provided with each call.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat data_format = 5; + * + * @param value The enum numeric value on the wire for dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormatValue(int value) { + dataFormat_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The format of the data being provided with each call.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat data_format = 5; + * + * @return The dataFormat. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesOverride.DataFormat getDataFormat() { + com.google.cloud.vertexai.api.ExamplesOverride.DataFormat result = + com.google.cloud.vertexai.api.ExamplesOverride.DataFormat.forNumber(dataFormat_); + return result == null + ? com.google.cloud.vertexai.api.ExamplesOverride.DataFormat.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The format of the data being provided with each call.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat data_format = 5; + * + * @param value The dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormat(com.google.cloud.vertexai.api.ExamplesOverride.DataFormat value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + dataFormat_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The format of the data being provided with each call.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat data_format = 5; + * + * @return This builder for chaining. + */ + public Builder clearDataFormat() { + bitField0_ = (bitField0_ & ~0x00000010); + dataFormat_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExamplesOverride) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExamplesOverride) + private static final com.google.cloud.vertexai.api.ExamplesOverride DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExamplesOverride(); + } + + public static com.google.cloud.vertexai.api.ExamplesOverride getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExamplesOverride parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesOverride getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesOverrideOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesOverrideOrBuilder.java new file mode 100644 index 000000000000..686707b8dc60 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesOverrideOrBuilder.java @@ -0,0 +1,147 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface ExamplesOverrideOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExamplesOverride) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The number of neighbors to return.
+   * 
+ * + * int32 neighbor_count = 1; + * + * @return The neighborCount. + */ + int getNeighborCount(); + + /** + * + * + *
+   * The number of neighbors to return that have the same crowding tag.
+   * 
+ * + * int32 crowding_count = 2; + * + * @return The crowdingCount. + */ + int getCrowdingCount(); + + /** + * + * + *
+   * Restrict the resulting nearest neighbors to respect these constraints.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + java.util.List getRestrictionsList(); + /** + * + * + *
+   * Restrict the resulting nearest neighbors to respect these constraints.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace getRestrictions(int index); + /** + * + * + *
+   * Restrict the resulting nearest neighbors to respect these constraints.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + int getRestrictionsCount(); + /** + * + * + *
+   * Restrict the resulting nearest neighbors to respect these constraints.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + java.util.List + getRestrictionsOrBuilderList(); + /** + * + * + *
+   * Restrict the resulting nearest neighbors to respect these constraints.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace restrictions = 3; + * + */ + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespaceOrBuilder getRestrictionsOrBuilder( + int index); + + /** + * + * + *
+   * If true, return the embeddings instead of neighbors.
+   * 
+ * + * bool return_embeddings = 4; + * + * @return The returnEmbeddings. + */ + boolean getReturnEmbeddings(); + + /** + * + * + *
+   * The format of the data being provided with each call.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat data_format = 5; + * + * @return The enum numeric value on the wire for dataFormat. + */ + int getDataFormatValue(); + /** + * + * + *
+   * The format of the data being provided with each call.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride.DataFormat data_format = 5; + * + * @return The dataFormat. + */ + com.google.cloud.vertexai.api.ExamplesOverride.DataFormat getDataFormat(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesRestrictionsNamespace.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesRestrictionsNamespace.java new file mode 100644 index 000000000000..345c5b09199e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesRestrictionsNamespace.java @@ -0,0 +1,1179 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Restrictions namespace for example-based explanations overrides.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace} + */ +public final class ExamplesRestrictionsNamespace extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace) + ExamplesRestrictionsNamespaceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExamplesRestrictionsNamespace.newBuilder() to construct. + private ExamplesRestrictionsNamespace(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExamplesRestrictionsNamespace() { + namespaceName_ = ""; + allow_ = com.google.protobuf.LazyStringArrayList.emptyList(); + deny_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExamplesRestrictionsNamespace(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExamplesRestrictionsNamespace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExamplesRestrictionsNamespace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.class, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder.class); + } + + public static final int NAMESPACE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object namespaceName_ = ""; + /** + * + * + *
+   * The namespace name.
+   * 
+ * + * string namespace_name = 1; + * + * @return The namespaceName. + */ + @java.lang.Override + public java.lang.String getNamespaceName() { + java.lang.Object ref = namespaceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespaceName_ = s; + return s; + } + } + /** + * + * + *
+   * The namespace name.
+   * 
+ * + * string namespace_name = 1; + * + * @return The bytes for namespaceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNamespaceNameBytes() { + java.lang.Object ref = namespaceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespaceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOW_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList allow_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The list of allowed tags.
+   * 
+ * + * repeated string allow = 2; + * + * @return A list containing the allow. + */ + public com.google.protobuf.ProtocolStringList getAllowList() { + return allow_; + } + /** + * + * + *
+   * The list of allowed tags.
+   * 
+ * + * repeated string allow = 2; + * + * @return The count of allow. + */ + public int getAllowCount() { + return allow_.size(); + } + /** + * + * + *
+   * The list of allowed tags.
+   * 
+ * + * repeated string allow = 2; + * + * @param index The index of the element to return. + * @return The allow at the given index. + */ + public java.lang.String getAllow(int index) { + return allow_.get(index); + } + /** + * + * + *
+   * The list of allowed tags.
+   * 
+ * + * repeated string allow = 2; + * + * @param index The index of the value to return. + * @return The bytes of the allow at the given index. + */ + public com.google.protobuf.ByteString getAllowBytes(int index) { + return allow_.getByteString(index); + } + + public static final int DENY_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList deny_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The list of deny tags.
+   * 
+ * + * repeated string deny = 3; + * + * @return A list containing the deny. + */ + public com.google.protobuf.ProtocolStringList getDenyList() { + return deny_; + } + /** + * + * + *
+   * The list of deny tags.
+   * 
+ * + * repeated string deny = 3; + * + * @return The count of deny. + */ + public int getDenyCount() { + return deny_.size(); + } + /** + * + * + *
+   * The list of deny tags.
+   * 
+ * + * repeated string deny = 3; + * + * @param index The index of the element to return. + * @return The deny at the given index. + */ + public java.lang.String getDeny(int index) { + return deny_.get(index); + } + /** + * + * + *
+   * The list of deny tags.
+   * 
+ * + * repeated string deny = 3; + * + * @param index The index of the value to return. + * @return The bytes of the deny at the given index. + */ + public com.google.protobuf.ByteString getDenyBytes(int index) { + return deny_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(namespaceName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, namespaceName_); + } + for (int i = 0; i < allow_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, allow_.getRaw(i)); + } + for (int i = 0; i < deny_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deny_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(namespaceName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, namespaceName_); + } + { + int dataSize = 0; + for (int i = 0; i < allow_.size(); i++) { + dataSize += computeStringSizeNoTag(allow_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < deny_.size(); i++) { + dataSize += computeStringSizeNoTag(deny_.getRaw(i)); + } + size += dataSize; + size += 1 * getDenyList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace other = + (com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace) obj; + + if (!getNamespaceName().equals(other.getNamespaceName())) return false; + if (!getAllowList().equals(other.getAllowList())) return false; + if (!getDenyList().equals(other.getDenyList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAMESPACE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getNamespaceName().hashCode(); + if (getAllowCount() > 0) { + hash = (37 * hash) + ALLOW_FIELD_NUMBER; + hash = (53 * hash) + getAllowList().hashCode(); + } + if (getDenyCount() > 0) { + hash = (37 * hash) + DENY_FIELD_NUMBER; + hash = (53 * hash) + getDenyList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Restrictions namespace for example-based explanations overrides.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace) + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespaceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExamplesRestrictionsNamespace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExamplesRestrictionsNamespace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.class, + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + namespaceName_ = ""; + allow_ = com.google.protobuf.LazyStringArrayList.emptyList(); + deny_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExamplesRestrictionsNamespace_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace build() { + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace buildPartial() { + com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace result = + new com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.namespaceName_ = namespaceName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + allow_.makeImmutable(); + result.allow_ = allow_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + deny_.makeImmutable(); + result.deny_ = deny_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace) { + return mergeFrom((com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace other) { + if (other == com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace.getDefaultInstance()) + return this; + if (!other.getNamespaceName().isEmpty()) { + namespaceName_ = other.namespaceName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.allow_.isEmpty()) { + if (allow_.isEmpty()) { + allow_ = other.allow_; + bitField0_ |= 0x00000002; + } else { + ensureAllowIsMutable(); + allow_.addAll(other.allow_); + } + onChanged(); + } + if (!other.deny_.isEmpty()) { + if (deny_.isEmpty()) { + deny_ = other.deny_; + bitField0_ |= 0x00000004; + } else { + ensureDenyIsMutable(); + deny_.addAll(other.deny_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + namespaceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAllowIsMutable(); + allow_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDenyIsMutable(); + deny_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object namespaceName_ = ""; + /** + * + * + *
+     * The namespace name.
+     * 
+ * + * string namespace_name = 1; + * + * @return The namespaceName. + */ + public java.lang.String getNamespaceName() { + java.lang.Object ref = namespaceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespaceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The namespace name.
+     * 
+ * + * string namespace_name = 1; + * + * @return The bytes for namespaceName. + */ + public com.google.protobuf.ByteString getNamespaceNameBytes() { + java.lang.Object ref = namespaceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespaceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The namespace name.
+     * 
+ * + * string namespace_name = 1; + * + * @param value The namespaceName to set. + * @return This builder for chaining. + */ + public Builder setNamespaceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + namespaceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The namespace name.
+     * 
+ * + * string namespace_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearNamespaceName() { + namespaceName_ = getDefaultInstance().getNamespaceName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The namespace name.
+     * 
+ * + * string namespace_name = 1; + * + * @param value The bytes for namespaceName to set. + * @return This builder for chaining. + */ + public Builder setNamespaceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + namespaceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList allow_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAllowIsMutable() { + if (!allow_.isModifiable()) { + allow_ = new com.google.protobuf.LazyStringArrayList(allow_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * The list of allowed tags.
+     * 
+ * + * repeated string allow = 2; + * + * @return A list containing the allow. + */ + public com.google.protobuf.ProtocolStringList getAllowList() { + allow_.makeImmutable(); + return allow_; + } + /** + * + * + *
+     * The list of allowed tags.
+     * 
+ * + * repeated string allow = 2; + * + * @return The count of allow. + */ + public int getAllowCount() { + return allow_.size(); + } + /** + * + * + *
+     * The list of allowed tags.
+     * 
+ * + * repeated string allow = 2; + * + * @param index The index of the element to return. + * @return The allow at the given index. + */ + public java.lang.String getAllow(int index) { + return allow_.get(index); + } + /** + * + * + *
+     * The list of allowed tags.
+     * 
+ * + * repeated string allow = 2; + * + * @param index The index of the value to return. + * @return The bytes of the allow at the given index. + */ + public com.google.protobuf.ByteString getAllowBytes(int index) { + return allow_.getByteString(index); + } + /** + * + * + *
+     * The list of allowed tags.
+     * 
+ * + * repeated string allow = 2; + * + * @param index The index to set the value at. + * @param value The allow to set. + * @return This builder for chaining. + */ + public Builder setAllow(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowIsMutable(); + allow_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of allowed tags.
+     * 
+ * + * repeated string allow = 2; + * + * @param value The allow to add. + * @return This builder for chaining. + */ + public Builder addAllow(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowIsMutable(); + allow_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of allowed tags.
+     * 
+ * + * repeated string allow = 2; + * + * @param values The allow to add. + * @return This builder for chaining. + */ + public Builder addAllAllow(java.lang.Iterable values) { + ensureAllowIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allow_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of allowed tags.
+     * 
+ * + * repeated string allow = 2; + * + * @return This builder for chaining. + */ + public Builder clearAllow() { + allow_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of allowed tags.
+     * 
+ * + * repeated string allow = 2; + * + * @param value The bytes of the allow to add. + * @return This builder for chaining. + */ + public Builder addAllowBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowIsMutable(); + allow_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList deny_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDenyIsMutable() { + if (!deny_.isModifiable()) { + deny_ = new com.google.protobuf.LazyStringArrayList(deny_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * The list of deny tags.
+     * 
+ * + * repeated string deny = 3; + * + * @return A list containing the deny. + */ + public com.google.protobuf.ProtocolStringList getDenyList() { + deny_.makeImmutable(); + return deny_; + } + /** + * + * + *
+     * The list of deny tags.
+     * 
+ * + * repeated string deny = 3; + * + * @return The count of deny. + */ + public int getDenyCount() { + return deny_.size(); + } + /** + * + * + *
+     * The list of deny tags.
+     * 
+ * + * repeated string deny = 3; + * + * @param index The index of the element to return. + * @return The deny at the given index. + */ + public java.lang.String getDeny(int index) { + return deny_.get(index); + } + /** + * + * + *
+     * The list of deny tags.
+     * 
+ * + * repeated string deny = 3; + * + * @param index The index of the value to return. + * @return The bytes of the deny at the given index. + */ + public com.google.protobuf.ByteString getDenyBytes(int index) { + return deny_.getByteString(index); + } + /** + * + * + *
+     * The list of deny tags.
+     * 
+ * + * repeated string deny = 3; + * + * @param index The index to set the value at. + * @param value The deny to set. + * @return This builder for chaining. + */ + public Builder setDeny(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenyIsMutable(); + deny_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of deny tags.
+     * 
+ * + * repeated string deny = 3; + * + * @param value The deny to add. + * @return This builder for chaining. + */ + public Builder addDeny(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDenyIsMutable(); + deny_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of deny tags.
+     * 
+ * + * repeated string deny = 3; + * + * @param values The deny to add. + * @return This builder for chaining. + */ + public Builder addAllDeny(java.lang.Iterable values) { + ensureDenyIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deny_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of deny tags.
+     * 
+ * + * repeated string deny = 3; + * + * @return This builder for chaining. + */ + public Builder clearDeny() { + deny_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of deny tags.
+     * 
+ * + * repeated string deny = 3; + * + * @param value The bytes of the deny to add. + * @return This builder for chaining. + */ + public Builder addDenyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDenyIsMutable(); + deny_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace) + private static final com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace(); + } + + public static com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExamplesRestrictionsNamespace parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesRestrictionsNamespace getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesRestrictionsNamespaceOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesRestrictionsNamespaceOrBuilder.java new file mode 100644 index 000000000000..767ac22af14e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExamplesRestrictionsNamespaceOrBuilder.java @@ -0,0 +1,152 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface ExamplesRestrictionsNamespaceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExamplesRestrictionsNamespace) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The namespace name.
+   * 
+ * + * string namespace_name = 1; + * + * @return The namespaceName. + */ + java.lang.String getNamespaceName(); + /** + * + * + *
+   * The namespace name.
+   * 
+ * + * string namespace_name = 1; + * + * @return The bytes for namespaceName. + */ + com.google.protobuf.ByteString getNamespaceNameBytes(); + + /** + * + * + *
+   * The list of allowed tags.
+   * 
+ * + * repeated string allow = 2; + * + * @return A list containing the allow. + */ + java.util.List getAllowList(); + /** + * + * + *
+   * The list of allowed tags.
+   * 
+ * + * repeated string allow = 2; + * + * @return The count of allow. + */ + int getAllowCount(); + /** + * + * + *
+   * The list of allowed tags.
+   * 
+ * + * repeated string allow = 2; + * + * @param index The index of the element to return. + * @return The allow at the given index. + */ + java.lang.String getAllow(int index); + /** + * + * + *
+   * The list of allowed tags.
+   * 
+ * + * repeated string allow = 2; + * + * @param index The index of the value to return. + * @return The bytes of the allow at the given index. + */ + com.google.protobuf.ByteString getAllowBytes(int index); + + /** + * + * + *
+   * The list of deny tags.
+   * 
+ * + * repeated string deny = 3; + * + * @return A list containing the deny. + */ + java.util.List getDenyList(); + /** + * + * + *
+   * The list of deny tags.
+   * 
+ * + * repeated string deny = 3; + * + * @return The count of deny. + */ + int getDenyCount(); + /** + * + * + *
+   * The list of deny tags.
+   * 
+ * + * repeated string deny = 3; + * + * @param index The index of the element to return. + * @return The deny at the given index. + */ + java.lang.String getDeny(int index); + /** + * + * + *
+   * The list of deny tags.
+   * 
+ * + * repeated string deny = 3; + * + * @param index The index of the value to return. + * @return The bytes of the deny at the given index. + */ + com.google.protobuf.ByteString getDenyBytes(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainRequest.java new file mode 100644 index 000000000000..5c02012be199 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainRequest.java @@ -0,0 +1,2726 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [PredictionService.Explain][google.cloud.vertexai.v1beta1.PredictionService.Explain].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplainRequest} + */ +public final class ExplainRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplainRequest) + ExplainRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplainRequest.newBuilder() to construct. + private ExplainRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplainRequest() { + endpoint_ = ""; + instances_ = java.util.Collections.emptyList(); + deployedModelId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplainRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetConcurrentExplanationSpecOverride(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplainRequest.class, + com.google.cloud.vertexai.api.ExplainRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the explanation.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the explanation.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getInstancesList() { + return 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getInstancesOrBuilderList() { + return 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.Value getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int PARAMETERS_FIELD_NUMBER = 4; + private com.google.protobuf.Value 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].
+   * 
+ * + * .google.protobuf.Value parameters = 4; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * 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].
+   * 
+ * + * .google.protobuf.Value parameters = 4; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.protobuf.Value getParameters() { + return parameters_ == null ? com.google.protobuf.Value.getDefaultInstance() : 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].
+   * 
+ * + * .google.protobuf.Value parameters = 4; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getParametersOrBuilder() { + return parameters_ == null ? com.google.protobuf.Value.getDefaultInstance() : parameters_; + } + + public static final int EXPLANATION_SPEC_OVERRIDE_FIELD_NUMBER = 5; + private com.google.cloud.vertexai.api.ExplanationSpecOverride explanationSpecOverride_; + /** + * + * + *
+   * If specified, overrides the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * of the DeployedModel. Can be used for explaining prediction results with
+   * different configurations, such as:
+   *  - Explaining top-5 predictions results as opposed to top-1;
+   *  - Increasing path count or step count of the attribution methods to reduce
+   *    approximate errors;
+   *  - Using different baselines for explaining the prediction results.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + * + * @return Whether the explanationSpecOverride field is set. + */ + @java.lang.Override + public boolean hasExplanationSpecOverride() { + return explanationSpecOverride_ != null; + } + /** + * + * + *
+   * If specified, overrides the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * of the DeployedModel. Can be used for explaining prediction results with
+   * different configurations, such as:
+   *  - Explaining top-5 predictions results as opposed to top-1;
+   *  - Increasing path count or step count of the attribution methods to reduce
+   *    approximate errors;
+   *  - Using different baselines for explaining the prediction results.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + * + * @return The explanationSpecOverride. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpecOverride getExplanationSpecOverride() { + return explanationSpecOverride_ == null + ? com.google.cloud.vertexai.api.ExplanationSpecOverride.getDefaultInstance() + : explanationSpecOverride_; + } + /** + * + * + *
+   * If specified, overrides the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * of the DeployedModel. Can be used for explaining prediction results with
+   * different configurations, such as:
+   *  - Explaining top-5 predictions results as opposed to top-1;
+   *  - Increasing path count or step count of the attribution methods to reduce
+   *    approximate errors;
+   *  - Using different baselines for explaining the prediction results.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpecOverrideOrBuilder + getExplanationSpecOverrideOrBuilder() { + return explanationSpecOverride_ == null + ? com.google.cloud.vertexai.api.ExplanationSpecOverride.getDefaultInstance() + : explanationSpecOverride_; + } + + public static final int CONCURRENT_EXPLANATION_SPEC_OVERRIDE_FIELD_NUMBER = 6; + + private static final class ConcurrentExplanationSpecOverrideDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.ExplanationSpecOverride> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_ConcurrentExplanationSpecOverrideEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.vertexai.api.ExplanationSpecOverride.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationSpecOverride> + concurrentExplanationSpecOverride_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationSpecOverride> + internalGetConcurrentExplanationSpecOverride() { + if (concurrentExplanationSpecOverride_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ConcurrentExplanationSpecOverrideDefaultEntryHolder.defaultEntry); + } + return concurrentExplanationSpecOverride_; + } + + public int getConcurrentExplanationSpecOverrideCount() { + return internalGetConcurrentExplanationSpecOverride().getMap().size(); + } + /** + * + * + *
+   * Optional. This field is the same as the one above, but supports multiple
+   * explanations to occur in parallel. The key can be any string. Each override
+   * will be run against the model, then its explanations will be grouped
+   * together.
+   *
+   * Note - these explanations are run **In Addition** to the default
+   * Explanation in the deployed model.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsConcurrentExplanationSpecOverride(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetConcurrentExplanationSpecOverride().getMap().containsKey(key); + } + /** Use {@link #getConcurrentExplanationSpecOverrideMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getConcurrentExplanationSpecOverride() { + return getConcurrentExplanationSpecOverrideMap(); + } + /** + * + * + *
+   * Optional. This field is the same as the one above, but supports multiple
+   * explanations to occur in parallel. The key can be any string. Each override
+   * will be run against the model, then its explanations will be grouped
+   * together.
+   *
+   * Note - these explanations are run **In Addition** to the default
+   * Explanation in the deployed model.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getConcurrentExplanationSpecOverrideMap() { + return internalGetConcurrentExplanationSpecOverride().getMap(); + } + /** + * + * + *
+   * Optional. This field is the same as the one above, but supports multiple
+   * explanations to occur in parallel. The key can be any string. Each override
+   * will be run against the model, then its explanations will be grouped
+   * together.
+   *
+   * Note - these explanations are run **In Addition** to the default
+   * Explanation in the deployed model.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.ExplanationSpecOverride + getConcurrentExplanationSpecOverrideOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationSpecOverride defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetConcurrentExplanationSpecOverride().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. This field is the same as the one above, but supports multiple
+   * explanations to occur in parallel. The key can be any string. Each override
+   * will be run against the model, then its explanations will be grouped
+   * together.
+   *
+   * Note - these explanations are run **In Addition** to the default
+   * Explanation in the deployed model.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpecOverride + getConcurrentExplanationSpecOverrideOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetConcurrentExplanationSpecOverride().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DEPLOYED_MODEL_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object deployedModelId_ = ""; + /** + * + * + *
+   * If specified, this ExplainRequest will be served by the chosen
+   * DeployedModel, overriding
+   * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+   * 
+ * + * string deployed_model_id = 3; + * + * @return The deployedModelId. + */ + @java.lang.Override + public java.lang.String getDeployedModelId() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedModelId_ = s; + return s; + } + } + /** + * + * + *
+   * If specified, this ExplainRequest will be served by the chosen
+   * DeployedModel, overriding
+   * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+   * 
+ * + * string deployed_model_id = 3; + * + * @return The bytes for deployedModelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeployedModelIdBytes() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + for (int i = 0; i < instances_.size(); i++) { + output.writeMessage(2, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedModelId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deployedModelId_); + } + if (parameters_ != null) { + output.writeMessage(4, getParameters()); + } + if (explanationSpecOverride_ != null) { + output.writeMessage(5, getExplanationSpecOverride()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetConcurrentExplanationSpecOverride(), + ConcurrentExplanationSpecOverrideDefaultEntryHolder.defaultEntry, + 6); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedModelId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, deployedModelId_); + } + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getParameters()); + } + if (explanationSpecOverride_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getExplanationSpecOverride()); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.vertexai.api.ExplanationSpecOverride> + entry : internalGetConcurrentExplanationSpecOverride().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.ExplanationSpecOverride> + concurrentExplanationSpecOverride__ = + ConcurrentExplanationSpecOverrideDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, concurrentExplanationSpecOverride__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExplainRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplainRequest other = + (com.google.cloud.vertexai.api.ExplainRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (hasExplanationSpecOverride() != other.hasExplanationSpecOverride()) return false; + if (hasExplanationSpecOverride()) { + if (!getExplanationSpecOverride().equals(other.getExplanationSpecOverride())) return false; + } + if (!internalGetConcurrentExplanationSpecOverride() + .equals(other.internalGetConcurrentExplanationSpecOverride())) return false; + if (!getDeployedModelId().equals(other.getDeployedModelId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + if (hasExplanationSpecOverride()) { + hash = (37 * hash) + EXPLANATION_SPEC_OVERRIDE_FIELD_NUMBER; + hash = (53 * hash) + getExplanationSpecOverride().hashCode(); + } + if (!internalGetConcurrentExplanationSpecOverride().getMap().isEmpty()) { + hash = (37 * hash) + CONCURRENT_EXPLANATION_SPEC_OVERRIDE_FIELD_NUMBER; + hash = (53 * hash) + internalGetConcurrentExplanationSpecOverride().hashCode(); + } + hash = (37 * hash) + DEPLOYED_MODEL_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeployedModelId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplainRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ExplainRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [PredictionService.Explain][google.cloud.vertexai.v1beta1.PredictionService.Explain].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplainRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplainRequest) + com.google.cloud.vertexai.api.ExplainRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetConcurrentExplanationSpecOverride(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableConcurrentExplanationSpecOverride(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplainRequest.class, + com.google.cloud.vertexai.api.ExplainRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ExplainRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + explanationSpecOverride_ = null; + if (explanationSpecOverrideBuilder_ != null) { + explanationSpecOverrideBuilder_.dispose(); + explanationSpecOverrideBuilder_ = null; + } + internalGetMutableConcurrentExplanationSpecOverride().clear(); + deployedModelId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplainRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainRequest build() { + com.google.cloud.vertexai.api.ExplainRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainRequest buildPartial() { + com.google.cloud.vertexai.api.ExplainRequest result = + new com.google.cloud.vertexai.api.ExplainRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.ExplainRequest result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.ExplainRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.parameters_ = parametersBuilder_ == null ? parameters_ : parametersBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.explanationSpecOverride_ = + explanationSpecOverrideBuilder_ == null + ? explanationSpecOverride_ + : explanationSpecOverrideBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.concurrentExplanationSpecOverride_ = internalGetConcurrentExplanationSpecOverride(); + result.concurrentExplanationSpecOverride_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deployedModelId_ = deployedModelId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExplainRequest) { + return mergeFrom((com.google.cloud.vertexai.api.ExplainRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ExplainRequest other) { + if (other == com.google.cloud.vertexai.api.ExplainRequest.getDefaultInstance()) return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000002); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + if (other.hasExplanationSpecOverride()) { + mergeExplanationSpecOverride(other.getExplanationSpecOverride()); + } + internalGetMutableConcurrentExplanationSpecOverride() + .mergeFrom(other.internalGetConcurrentExplanationSpecOverride()); + bitField0_ |= 0x00000010; + if (!other.getDeployedModelId().isEmpty()) { + deployedModelId_ = other.deployedModelId_; + bitField0_ |= 0x00000020; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.protobuf.Value m = + input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + deployedModelId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 26 + case 34: + { + input.readMessage(getParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + input.readMessage( + getExplanationSpecOverrideFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.ExplanationSpecOverride> + concurrentExplanationSpecOverride__ = + input.readMessage( + ConcurrentExplanationSpecOverrideDefaultEntryHolder.defaultEntry + .getParserForType(), + extensionRegistry); + internalGetMutableConcurrentExplanationSpecOverride() + .getMutableMap() + .put( + concurrentExplanationSpecOverride__.getKey(), + concurrentExplanationSpecOverride__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the explanation.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the explanation.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the explanation.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the explanation.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the explanation.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstances(int index, com.google.protobuf.Value value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstances(int index, com.google.protobuf.Value.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(com.google.protobuf.Value value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(int index, com.google.protobuf.Value value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(com.google.protobuf.Value.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(int index, com.google.protobuf.Value.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllInstances(java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value.Builder addInstancesBuilder() { + return getInstancesFieldBuilder().addBuilder(com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + instances_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private com.google.protobuf.Value parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 4; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 4; + * + * @return The parameters. + */ + public com.google.protobuf.Value getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null ? com.google.protobuf.Value.getDefaultInstance() : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 4; + */ + public Builder setParameters(com.google.protobuf.Value value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + } else { + parametersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 4; + */ + public Builder setParameters(com.google.protobuf.Value.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 4; + */ + public Builder mergeParameters(com.google.protobuf.Value value) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && parameters_ != null + && parameters_ != com.google.protobuf.Value.getDefaultInstance()) { + getParametersBuilder().mergeFrom(value); + } else { + parameters_ = value; + } + } else { + parametersBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 4; + */ + public Builder clearParameters() { + bitField0_ = (bitField0_ & ~0x00000004); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 4; + */ + public com.google.protobuf.Value.Builder getParametersBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 4; + */ + public com.google.protobuf.ValueOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null ? com.google.protobuf.Value.getDefaultInstance() : 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].
+     * 
+ * + * .google.protobuf.Value parameters = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + private com.google.cloud.vertexai.api.ExplanationSpecOverride explanationSpecOverride_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationSpecOverride, + com.google.cloud.vertexai.api.ExplanationSpecOverride.Builder, + com.google.cloud.vertexai.api.ExplanationSpecOverrideOrBuilder> + explanationSpecOverrideBuilder_; + /** + * + * + *
+     * If specified, overrides the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * of the DeployedModel. Can be used for explaining prediction results with
+     * different configurations, such as:
+     *  - Explaining top-5 predictions results as opposed to top-1;
+     *  - Increasing path count or step count of the attribution methods to reduce
+     *    approximate errors;
+     *  - Using different baselines for explaining the prediction results.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + * + * @return Whether the explanationSpecOverride field is set. + */ + public boolean hasExplanationSpecOverride() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * If specified, overrides the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * of the DeployedModel. Can be used for explaining prediction results with
+     * different configurations, such as:
+     *  - Explaining top-5 predictions results as opposed to top-1;
+     *  - Increasing path count or step count of the attribution methods to reduce
+     *    approximate errors;
+     *  - Using different baselines for explaining the prediction results.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + * + * @return The explanationSpecOverride. + */ + public com.google.cloud.vertexai.api.ExplanationSpecOverride getExplanationSpecOverride() { + if (explanationSpecOverrideBuilder_ == null) { + return explanationSpecOverride_ == null + ? com.google.cloud.vertexai.api.ExplanationSpecOverride.getDefaultInstance() + : explanationSpecOverride_; + } else { + return explanationSpecOverrideBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If specified, overrides the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * of the DeployedModel. Can be used for explaining prediction results with
+     * different configurations, such as:
+     *  - Explaining top-5 predictions results as opposed to top-1;
+     *  - Increasing path count or step count of the attribution methods to reduce
+     *    approximate errors;
+     *  - Using different baselines for explaining the prediction results.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + */ + public Builder setExplanationSpecOverride( + com.google.cloud.vertexai.api.ExplanationSpecOverride value) { + if (explanationSpecOverrideBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explanationSpecOverride_ = value; + } else { + explanationSpecOverrideBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If specified, overrides the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * of the DeployedModel. Can be used for explaining prediction results with
+     * different configurations, such as:
+     *  - Explaining top-5 predictions results as opposed to top-1;
+     *  - Increasing path count or step count of the attribution methods to reduce
+     *    approximate errors;
+     *  - Using different baselines for explaining the prediction results.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + */ + public Builder setExplanationSpecOverride( + com.google.cloud.vertexai.api.ExplanationSpecOverride.Builder builderForValue) { + if (explanationSpecOverrideBuilder_ == null) { + explanationSpecOverride_ = builderForValue.build(); + } else { + explanationSpecOverrideBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If specified, overrides the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * of the DeployedModel. Can be used for explaining prediction results with
+     * different configurations, such as:
+     *  - Explaining top-5 predictions results as opposed to top-1;
+     *  - Increasing path count or step count of the attribution methods to reduce
+     *    approximate errors;
+     *  - Using different baselines for explaining the prediction results.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + */ + public Builder mergeExplanationSpecOverride( + com.google.cloud.vertexai.api.ExplanationSpecOverride value) { + if (explanationSpecOverrideBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && explanationSpecOverride_ != null + && explanationSpecOverride_ + != com.google.cloud.vertexai.api.ExplanationSpecOverride.getDefaultInstance()) { + getExplanationSpecOverrideBuilder().mergeFrom(value); + } else { + explanationSpecOverride_ = value; + } + } else { + explanationSpecOverrideBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If specified, overrides the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * of the DeployedModel. Can be used for explaining prediction results with
+     * different configurations, such as:
+     *  - Explaining top-5 predictions results as opposed to top-1;
+     *  - Increasing path count or step count of the attribution methods to reduce
+     *    approximate errors;
+     *  - Using different baselines for explaining the prediction results.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + */ + public Builder clearExplanationSpecOverride() { + bitField0_ = (bitField0_ & ~0x00000008); + explanationSpecOverride_ = null; + if (explanationSpecOverrideBuilder_ != null) { + explanationSpecOverrideBuilder_.dispose(); + explanationSpecOverrideBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * If specified, overrides the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * of the DeployedModel. Can be used for explaining prediction results with
+     * different configurations, such as:
+     *  - Explaining top-5 predictions results as opposed to top-1;
+     *  - Increasing path count or step count of the attribution methods to reduce
+     *    approximate errors;
+     *  - Using different baselines for explaining the prediction results.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + */ + public com.google.cloud.vertexai.api.ExplanationSpecOverride.Builder + getExplanationSpecOverrideBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getExplanationSpecOverrideFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If specified, overrides the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * of the DeployedModel. Can be used for explaining prediction results with
+     * different configurations, such as:
+     *  - Explaining top-5 predictions results as opposed to top-1;
+     *  - Increasing path count or step count of the attribution methods to reduce
+     *    approximate errors;
+     *  - Using different baselines for explaining the prediction results.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + */ + public com.google.cloud.vertexai.api.ExplanationSpecOverrideOrBuilder + getExplanationSpecOverrideOrBuilder() { + if (explanationSpecOverrideBuilder_ != null) { + return explanationSpecOverrideBuilder_.getMessageOrBuilder(); + } else { + return explanationSpecOverride_ == null + ? com.google.cloud.vertexai.api.ExplanationSpecOverride.getDefaultInstance() + : explanationSpecOverride_; + } + } + /** + * + * + *
+     * If specified, overrides the
+     * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+     * of the DeployedModel. Can be used for explaining prediction results with
+     * different configurations, such as:
+     *  - Explaining top-5 predictions results as opposed to top-1;
+     *  - Increasing path count or step count of the attribution methods to reduce
+     *    approximate errors;
+     *  - Using different baselines for explaining the prediction results.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationSpecOverride, + com.google.cloud.vertexai.api.ExplanationSpecOverride.Builder, + com.google.cloud.vertexai.api.ExplanationSpecOverrideOrBuilder> + getExplanationSpecOverrideFieldBuilder() { + if (explanationSpecOverrideBuilder_ == null) { + explanationSpecOverrideBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationSpecOverride, + com.google.cloud.vertexai.api.ExplanationSpecOverride.Builder, + com.google.cloud.vertexai.api.ExplanationSpecOverrideOrBuilder>( + getExplanationSpecOverride(), getParentForChildren(), isClean()); + explanationSpecOverride_ = null; + } + return explanationSpecOverrideBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationSpecOverride> + concurrentExplanationSpecOverride_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationSpecOverride> + internalGetConcurrentExplanationSpecOverride() { + if (concurrentExplanationSpecOverride_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ConcurrentExplanationSpecOverrideDefaultEntryHolder.defaultEntry); + } + return concurrentExplanationSpecOverride_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationSpecOverride> + internalGetMutableConcurrentExplanationSpecOverride() { + if (concurrentExplanationSpecOverride_ == null) { + concurrentExplanationSpecOverride_ = + com.google.protobuf.MapField.newMapField( + ConcurrentExplanationSpecOverrideDefaultEntryHolder.defaultEntry); + } + if (!concurrentExplanationSpecOverride_.isMutable()) { + concurrentExplanationSpecOverride_ = concurrentExplanationSpecOverride_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return concurrentExplanationSpecOverride_; + } + + public int getConcurrentExplanationSpecOverrideCount() { + return internalGetConcurrentExplanationSpecOverride().getMap().size(); + } + /** + * + * + *
+     * Optional. This field is the same as the one above, but supports multiple
+     * explanations to occur in parallel. The key can be any string. Each override
+     * will be run against the model, then its explanations will be grouped
+     * together.
+     *
+     * Note - these explanations are run **In Addition** to the default
+     * Explanation in the deployed model.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsConcurrentExplanationSpecOverride(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetConcurrentExplanationSpecOverride().getMap().containsKey(key); + } + /** Use {@link #getConcurrentExplanationSpecOverrideMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getConcurrentExplanationSpecOverride() { + return getConcurrentExplanationSpecOverrideMap(); + } + /** + * + * + *
+     * Optional. This field is the same as the one above, but supports multiple
+     * explanations to occur in parallel. The key can be any string. Each override
+     * will be run against the model, then its explanations will be grouped
+     * together.
+     *
+     * Note - these explanations are run **In Addition** to the default
+     * Explanation in the deployed model.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getConcurrentExplanationSpecOverrideMap() { + return internalGetConcurrentExplanationSpecOverride().getMap(); + } + /** + * + * + *
+     * Optional. This field is the same as the one above, but supports multiple
+     * explanations to occur in parallel. The key can be any string. Each override
+     * will be run against the model, then its explanations will be grouped
+     * together.
+     *
+     * Note - these explanations are run **In Addition** to the default
+     * Explanation in the deployed model.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.ExplanationSpecOverride + getConcurrentExplanationSpecOverrideOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationSpecOverride defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetConcurrentExplanationSpecOverride().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. This field is the same as the one above, but supports multiple
+     * explanations to occur in parallel. The key can be any string. Each override
+     * will be run against the model, then its explanations will be grouped
+     * together.
+     *
+     * Note - these explanations are run **In Addition** to the default
+     * Explanation in the deployed model.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpecOverride + getConcurrentExplanationSpecOverrideOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetConcurrentExplanationSpecOverride().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearConcurrentExplanationSpecOverride() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableConcurrentExplanationSpecOverride().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. This field is the same as the one above, but supports multiple
+     * explanations to occur in parallel. The key can be any string. Each override
+     * will be run against the model, then its explanations will be grouped
+     * together.
+     *
+     * Note - these explanations are run **In Addition** to the default
+     * Explanation in the deployed model.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeConcurrentExplanationSpecOverride(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableConcurrentExplanationSpecOverride().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableConcurrentExplanationSpecOverride() { + bitField0_ |= 0x00000010; + return internalGetMutableConcurrentExplanationSpecOverride().getMutableMap(); + } + /** + * + * + *
+     * Optional. This field is the same as the one above, but supports multiple
+     * explanations to occur in parallel. The key can be any string. Each override
+     * will be run against the model, then its explanations will be grouped
+     * together.
+     *
+     * Note - these explanations are run **In Addition** to the default
+     * Explanation in the deployed model.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putConcurrentExplanationSpecOverride( + java.lang.String key, com.google.cloud.vertexai.api.ExplanationSpecOverride value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableConcurrentExplanationSpecOverride().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * Optional. This field is the same as the one above, but supports multiple
+     * explanations to occur in parallel. The key can be any string. Each override
+     * will be run against the model, then its explanations will be grouped
+     * together.
+     *
+     * Note - these explanations are run **In Addition** to the default
+     * Explanation in the deployed model.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllConcurrentExplanationSpecOverride( + java.util.Map + values) { + internalGetMutableConcurrentExplanationSpecOverride().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private java.lang.Object deployedModelId_ = ""; + /** + * + * + *
+     * If specified, this ExplainRequest will be served by the chosen
+     * DeployedModel, overriding
+     * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+     * 
+ * + * string deployed_model_id = 3; + * + * @return The deployedModelId. + */ + public java.lang.String getDeployedModelId() { + java.lang.Object ref = deployedModelId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedModelId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If specified, this ExplainRequest will be served by the chosen
+     * DeployedModel, overriding
+     * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+     * 
+ * + * string deployed_model_id = 3; + * + * @return The bytes for deployedModelId. + */ + public com.google.protobuf.ByteString getDeployedModelIdBytes() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If specified, this ExplainRequest will be served by the chosen
+     * DeployedModel, overriding
+     * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+     * 
+ * + * string deployed_model_id = 3; + * + * @param value The deployedModelId to set. + * @return This builder for chaining. + */ + public Builder setDeployedModelId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + deployedModelId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * If specified, this ExplainRequest will be served by the chosen
+     * DeployedModel, overriding
+     * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+     * 
+ * + * string deployed_model_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearDeployedModelId() { + deployedModelId_ = getDefaultInstance().getDeployedModelId(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * If specified, this ExplainRequest will be served by the chosen
+     * DeployedModel, overriding
+     * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+     * 
+ * + * string deployed_model_id = 3; + * + * @param value The bytes for deployedModelId to set. + * @return This builder for chaining. + */ + public Builder setDeployedModelIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + deployedModelId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplainRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplainRequest) + private static final com.google.cloud.vertexai.api.ExplainRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExplainRequest(); + } + + public static com.google.cloud.vertexai.api.ExplainRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplainRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainRequestOrBuilder.java new file mode 100644 index 000000000000..1d4a13494afd --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainRequestOrBuilder.java @@ -0,0 +1,397 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface ExplainRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplainRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the explanation.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the explanation.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.Value getInstances(int index); + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getInstancesCount(); + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getInstancesOrBuilderList(); + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index); + + /** + * + * + *
+   * 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].
+   * 
+ * + * .google.protobuf.Value parameters = 4; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * 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].
+   * 
+ * + * .google.protobuf.Value parameters = 4; + * + * @return The parameters. + */ + com.google.protobuf.Value getParameters(); + /** + * + * + *
+   * 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].
+   * 
+ * + * .google.protobuf.Value parameters = 4; + */ + com.google.protobuf.ValueOrBuilder getParametersOrBuilder(); + + /** + * + * + *
+   * If specified, overrides the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * of the DeployedModel. Can be used for explaining prediction results with
+   * different configurations, such as:
+   *  - Explaining top-5 predictions results as opposed to top-1;
+   *  - Increasing path count or step count of the attribution methods to reduce
+   *    approximate errors;
+   *  - Using different baselines for explaining the prediction results.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + * + * @return Whether the explanationSpecOverride field is set. + */ + boolean hasExplanationSpecOverride(); + /** + * + * + *
+   * If specified, overrides the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * of the DeployedModel. Can be used for explaining prediction results with
+   * different configurations, such as:
+   *  - Explaining top-5 predictions results as opposed to top-1;
+   *  - Increasing path count or step count of the attribution methods to reduce
+   *    approximate errors;
+   *  - Using different baselines for explaining the prediction results.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + * + * @return The explanationSpecOverride. + */ + com.google.cloud.vertexai.api.ExplanationSpecOverride getExplanationSpecOverride(); + /** + * + * + *
+   * If specified, overrides the
+   * [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]
+   * of the DeployedModel. Can be used for explaining prediction results with
+   * different configurations, such as:
+   *  - Explaining top-5 predictions results as opposed to top-1;
+   *  - Increasing path count or step count of the attribution methods to reduce
+   *    approximate errors;
+   *  - Using different baselines for explaining the prediction results.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationSpecOverride explanation_spec_override = 5; + * + */ + com.google.cloud.vertexai.api.ExplanationSpecOverrideOrBuilder + getExplanationSpecOverrideOrBuilder(); + + /** + * + * + *
+   * Optional. This field is the same as the one above, but supports multiple
+   * explanations to occur in parallel. The key can be any string. Each override
+   * will be run against the model, then its explanations will be grouped
+   * together.
+   *
+   * Note - these explanations are run **In Addition** to the default
+   * Explanation in the deployed model.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getConcurrentExplanationSpecOverrideCount(); + /** + * + * + *
+   * Optional. This field is the same as the one above, but supports multiple
+   * explanations to occur in parallel. The key can be any string. Each override
+   * will be run against the model, then its explanations will be grouped
+   * together.
+   *
+   * Note - these explanations are run **In Addition** to the default
+   * Explanation in the deployed model.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsConcurrentExplanationSpecOverride(java.lang.String key); + /** Use {@link #getConcurrentExplanationSpecOverrideMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getConcurrentExplanationSpecOverride(); + /** + * + * + *
+   * Optional. This field is the same as the one above, but supports multiple
+   * explanations to occur in parallel. The key can be any string. Each override
+   * will be run against the model, then its explanations will be grouped
+   * together.
+   *
+   * Note - these explanations are run **In Addition** to the default
+   * Explanation in the deployed model.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map + getConcurrentExplanationSpecOverrideMap(); + /** + * + * + *
+   * Optional. This field is the same as the one above, but supports multiple
+   * explanations to occur in parallel. The key can be any string. Each override
+   * will be run against the model, then its explanations will be grouped
+   * together.
+   *
+   * Note - these explanations are run **In Addition** to the default
+   * Explanation in the deployed model.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + com.google.cloud.vertexai.api.ExplanationSpecOverride + getConcurrentExplanationSpecOverrideOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationSpecOverride defaultValue); + /** + * + * + *
+   * Optional. This field is the same as the one above, but supports multiple
+   * explanations to occur in parallel. The key can be any string. Each override
+   * will be run against the model, then its explanations will be grouped
+   * together.
+   *
+   * Note - these explanations are run **In Addition** to the default
+   * Explanation in the deployed model.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationSpecOverride> concurrent_explanation_spec_override = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.ExplanationSpecOverride getConcurrentExplanationSpecOverrideOrThrow( + java.lang.String key); + + /** + * + * + *
+   * If specified, this ExplainRequest will be served by the chosen
+   * DeployedModel, overriding
+   * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+   * 
+ * + * string deployed_model_id = 3; + * + * @return The deployedModelId. + */ + java.lang.String getDeployedModelId(); + /** + * + * + *
+   * If specified, this ExplainRequest will be served by the chosen
+   * DeployedModel, overriding
+   * [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split].
+   * 
+ * + * string deployed_model_id = 3; + * + * @return The bytes for deployedModelId. + */ + com.google.protobuf.ByteString getDeployedModelIdBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainResponse.java new file mode 100644 index 000000000000..0d9c7b6c093c --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainResponse.java @@ -0,0 +1,3325 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [PredictionService.Explain][google.cloud.vertexai.v1beta1.PredictionService.Explain].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplainResponse} + */ +public final class ExplainResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplainResponse) + ExplainResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplainResponse.newBuilder() to construct. + private ExplainResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplainResponse() { + explanations_ = java.util.Collections.emptyList(); + deployedModelId_ = ""; + predictions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplainResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetConcurrentExplanations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplainResponse.class, + com.google.cloud.vertexai.api.ExplainResponse.Builder.class); + } + + public interface ConcurrentExplanationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+     * be explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + java.util.List getExplanationsList(); + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+     * be explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + com.google.cloud.vertexai.api.Explanation getExplanations(int index); + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+     * be explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + int getExplanationsCount(); + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+     * be explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + java.util.List + getExplanationsOrBuilderList(); + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+     * be explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + com.google.cloud.vertexai.api.ExplanationOrBuilder getExplanationsOrBuilder(int index); + } + /** + * + * + *
+   * This message is a wrapper grouping Concurrent Explanations.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation} + */ + public static final class ConcurrentExplanation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation) + ConcurrentExplanationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConcurrentExplanation.newBuilder() to construct. + private ConcurrentExplanation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConcurrentExplanation() { + explanations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConcurrentExplanation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation.class, + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation.Builder.class); + } + + public static final int EXPLANATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List explanations_; + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+     * be explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + @java.lang.Override + public java.util.List getExplanationsList() { + return explanations_; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+     * be explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + @java.lang.Override + public java.util.List + getExplanationsOrBuilderList() { + return explanations_; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+     * be explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + @java.lang.Override + public int getExplanationsCount() { + return explanations_.size(); + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+     * be explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Explanation getExplanations(int index) { + return explanations_.get(index); + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+     * be explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationOrBuilder getExplanationsOrBuilder(int index) { + return explanations_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < explanations_.size(); i++) { + output.writeMessage(1, explanations_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < explanations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, explanations_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation other = + (com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation) obj; + + if (!getExplanationsList().equals(other.getExplanationsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExplanationsCount() > 0) { + hash = (37 * hash) + EXPLANATIONS_FIELD_NUMBER; + hash = (53 * hash) + getExplanationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * This message is a wrapper grouping Concurrent Explanations.
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation) + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation.class, + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation.Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (explanationsBuilder_ == null) { + explanations_ = java.util.Collections.emptyList(); + } else { + explanations_ = null; + explanationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation build() { + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation buildPartial() { + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation result = + new com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation result) { + if (explanationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + explanations_ = java.util.Collections.unmodifiableList(explanations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.explanations_ = explanations_; + } else { + result.explanations_ = explanationsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation) { + return mergeFrom( + (com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation other) { + if (other + == com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + .getDefaultInstance()) return this; + if (explanationsBuilder_ == null) { + if (!other.explanations_.isEmpty()) { + if (explanations_.isEmpty()) { + explanations_ = other.explanations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExplanationsIsMutable(); + explanations_.addAll(other.explanations_); + } + onChanged(); + } + } else { + if (!other.explanations_.isEmpty()) { + if (explanationsBuilder_.isEmpty()) { + explanationsBuilder_.dispose(); + explanationsBuilder_ = null; + explanations_ = other.explanations_; + bitField0_ = (bitField0_ & ~0x00000001); + explanationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExplanationsFieldBuilder() + : null; + } else { + explanationsBuilder_.addAllMessages(other.explanations_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vertexai.api.Explanation m = + input.readMessage( + com.google.cloud.vertexai.api.Explanation.parser(), extensionRegistry); + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + explanations_.add(m); + } else { + explanationsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List explanations_ = + java.util.Collections.emptyList(); + + private void ensureExplanationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + explanations_ = + new java.util.ArrayList(explanations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Explanation, + com.google.cloud.vertexai.api.Explanation.Builder, + com.google.cloud.vertexai.api.ExplanationOrBuilder> + explanationsBuilder_; + + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public java.util.List getExplanationsList() { + if (explanationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(explanations_); + } else { + return explanationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public int getExplanationsCount() { + if (explanationsBuilder_ == null) { + return explanations_.size(); + } else { + return explanationsBuilder_.getCount(); + } + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public com.google.cloud.vertexai.api.Explanation getExplanations(int index) { + if (explanationsBuilder_ == null) { + return explanations_.get(index); + } else { + return explanationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder setExplanations(int index, com.google.cloud.vertexai.api.Explanation value) { + if (explanationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExplanationsIsMutable(); + explanations_.set(index, value); + onChanged(); + } else { + explanationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder setExplanations( + int index, com.google.cloud.vertexai.api.Explanation.Builder builderForValue) { + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + explanations_.set(index, builderForValue.build()); + onChanged(); + } else { + explanationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder addExplanations(com.google.cloud.vertexai.api.Explanation value) { + if (explanationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExplanationsIsMutable(); + explanations_.add(value); + onChanged(); + } else { + explanationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder addExplanations(int index, com.google.cloud.vertexai.api.Explanation value) { + if (explanationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExplanationsIsMutable(); + explanations_.add(index, value); + onChanged(); + } else { + explanationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder addExplanations( + com.google.cloud.vertexai.api.Explanation.Builder builderForValue) { + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + explanations_.add(builderForValue.build()); + onChanged(); + } else { + explanationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder addExplanations( + int index, com.google.cloud.vertexai.api.Explanation.Builder builderForValue) { + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + explanations_.add(index, builderForValue.build()); + onChanged(); + } else { + explanationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder addAllExplanations( + java.lang.Iterable values) { + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, explanations_); + onChanged(); + } else { + explanationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder clearExplanations() { + if (explanationsBuilder_ == null) { + explanations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + explanationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder removeExplanations(int index) { + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + explanations_.remove(index); + onChanged(); + } else { + explanationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public com.google.cloud.vertexai.api.Explanation.Builder getExplanationsBuilder(int index) { + return getExplanationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public com.google.cloud.vertexai.api.ExplanationOrBuilder getExplanationsOrBuilder( + int index) { + if (explanationsBuilder_ == null) { + return explanations_.get(index); + } else { + return explanationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public java.util.List + getExplanationsOrBuilderList() { + if (explanationsBuilder_ != null) { + return explanationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(explanations_); + } + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public com.google.cloud.vertexai.api.Explanation.Builder addExplanationsBuilder() { + return getExplanationsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Explanation.getDefaultInstance()); + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public com.google.cloud.vertexai.api.Explanation.Builder addExplanationsBuilder(int index) { + return getExplanationsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Explanation.getDefaultInstance()); + } + /** + * + * + *
+       * The explanations of the Model's
+       * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+       *
+       * It has the same number of elements as
+       * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to
+       * be explained.
+       * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public java.util.List + getExplanationsBuilderList() { + return getExplanationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Explanation, + com.google.cloud.vertexai.api.Explanation.Builder, + com.google.cloud.vertexai.api.ExplanationOrBuilder> + getExplanationsFieldBuilder() { + if (explanationsBuilder_ == null) { + explanationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Explanation, + com.google.cloud.vertexai.api.Explanation.Builder, + com.google.cloud.vertexai.api.ExplanationOrBuilder>( + explanations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + explanations_ = null; + } + return explanationsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation) + private static final com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation(); + } + + public static com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConcurrentExplanation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int EXPLANATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List explanations_; + /** + * + * + *
+   * The explanations of the Model's
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   *
+   * It has the same number of elements as
+   * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+   * explained.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + @java.lang.Override + public java.util.List getExplanationsList() { + return explanations_; + } + /** + * + * + *
+   * The explanations of the Model's
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   *
+   * It has the same number of elements as
+   * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+   * explained.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + @java.lang.Override + public java.util.List + getExplanationsOrBuilderList() { + return explanations_; + } + /** + * + * + *
+   * The explanations of the Model's
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   *
+   * It has the same number of elements as
+   * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+   * explained.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + @java.lang.Override + public int getExplanationsCount() { + return explanations_.size(); + } + /** + * + * + *
+   * The explanations of the Model's
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   *
+   * It has the same number of elements as
+   * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+   * explained.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Explanation getExplanations(int index) { + return explanations_.get(index); + } + /** + * + * + *
+   * The explanations of the Model's
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   *
+   * It has the same number of elements as
+   * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+   * explained.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationOrBuilder getExplanationsOrBuilder(int index) { + return explanations_.get(index); + } + + public static final int CONCURRENT_EXPLANATIONS_FIELD_NUMBER = 4; + + private static final class ConcurrentExplanationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + concurrentExplanations_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + internalGetConcurrentExplanations() { + if (concurrentExplanations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ConcurrentExplanationsDefaultEntryHolder.defaultEntry); + } + return concurrentExplanations_; + } + + public int getConcurrentExplanationsCount() { + return internalGetConcurrentExplanations().getMap().size(); + } + /** + * + * + *
+   * This field stores the results of the explanations run in parallel with
+   * The default explanation strategy/method.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + @java.lang.Override + public boolean containsConcurrentExplanations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetConcurrentExplanations().getMap().containsKey(key); + } + /** Use {@link #getConcurrentExplanationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + getConcurrentExplanations() { + return getConcurrentExplanationsMap(); + } + /** + * + * + *
+   * This field stores the results of the explanations run in parallel with
+   * The default explanation strategy/method.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + getConcurrentExplanationsMap() { + return internalGetConcurrentExplanations().getMap(); + } + /** + * + * + *
+   * This field stores the results of the explanations run in parallel with
+   * The default explanation strategy/method.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + getConcurrentExplanationsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + map = internalGetConcurrentExplanations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * This field stores the results of the explanations run in parallel with
+   * The default explanation strategy/method.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + getConcurrentExplanationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + map = internalGetConcurrentExplanations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DEPLOYED_MODEL_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object deployedModelId_ = ""; + /** + * + * + *
+   * ID of the Endpoint's DeployedModel that served this explanation.
+   * 
+ * + * string deployed_model_id = 2; + * + * @return The deployedModelId. + */ + @java.lang.Override + public java.lang.String getDeployedModelId() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedModelId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the Endpoint's DeployedModel that served this explanation.
+   * 
+ * + * string deployed_model_id = 2; + * + * @return The bytes for deployedModelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeployedModelIdBytes() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREDICTIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List predictions_; + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * Same as
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + @java.lang.Override + public java.util.List getPredictionsList() { + return predictions_; + } + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * Same as
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + @java.lang.Override + public java.util.List + getPredictionsOrBuilderList() { + return predictions_; + } + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * Same as
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + @java.lang.Override + public int getPredictionsCount() { + return predictions_.size(); + } + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * Same as
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + @java.lang.Override + public com.google.protobuf.Value getPredictions(int index) { + return predictions_.get(index); + } + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * Same as
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getPredictionsOrBuilder(int index) { + return predictions_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < explanations_.size(); i++) { + output.writeMessage(1, explanations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedModelId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deployedModelId_); + } + for (int i = 0; i < predictions_.size(); i++) { + output.writeMessage(3, predictions_.get(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetConcurrentExplanations(), + ConcurrentExplanationsDefaultEntryHolder.defaultEntry, + 4); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < explanations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, explanations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedModelId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deployedModelId_); + } + for (int i = 0; i < predictions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, predictions_.get(i)); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + entry : internalGetConcurrentExplanations().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + concurrentExplanations__ = + ConcurrentExplanationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, concurrentExplanations__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExplainResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplainResponse other = + (com.google.cloud.vertexai.api.ExplainResponse) obj; + + if (!getExplanationsList().equals(other.getExplanationsList())) return false; + if (!internalGetConcurrentExplanations().equals(other.internalGetConcurrentExplanations())) + return false; + if (!getDeployedModelId().equals(other.getDeployedModelId())) return false; + if (!getPredictionsList().equals(other.getPredictionsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExplanationsCount() > 0) { + hash = (37 * hash) + EXPLANATIONS_FIELD_NUMBER; + hash = (53 * hash) + getExplanationsList().hashCode(); + } + if (!internalGetConcurrentExplanations().getMap().isEmpty()) { + hash = (37 * hash) + CONCURRENT_EXPLANATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetConcurrentExplanations().hashCode(); + } + hash = (37 * hash) + DEPLOYED_MODEL_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeployedModelId().hashCode(); + if (getPredictionsCount() > 0) { + hash = (37 * hash) + PREDICTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPredictionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplainResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ExplainResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [PredictionService.Explain][google.cloud.vertexai.v1beta1.PredictionService.Explain].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplainResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplainResponse) + com.google.cloud.vertexai.api.ExplainResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetConcurrentExplanations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableConcurrentExplanations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplainResponse.class, + com.google.cloud.vertexai.api.ExplainResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ExplainResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (explanationsBuilder_ == null) { + explanations_ = java.util.Collections.emptyList(); + } else { + explanations_ = null; + explanationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableConcurrentExplanations().clear(); + deployedModelId_ = ""; + if (predictionsBuilder_ == null) { + predictions_ = java.util.Collections.emptyList(); + } else { + predictions_ = null; + predictionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplainResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainResponse build() { + com.google.cloud.vertexai.api.ExplainResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainResponse buildPartial() { + com.google.cloud.vertexai.api.ExplainResponse result = + new com.google.cloud.vertexai.api.ExplainResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.ExplainResponse result) { + if (explanationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + explanations_ = java.util.Collections.unmodifiableList(explanations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.explanations_ = explanations_; + } else { + result.explanations_ = explanationsBuilder_.build(); + } + if (predictionsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + predictions_ = java.util.Collections.unmodifiableList(predictions_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.predictions_ = predictions_; + } else { + result.predictions_ = predictionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.ExplainResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.concurrentExplanations_ = internalGetConcurrentExplanations(); + result.concurrentExplanations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.deployedModelId_ = deployedModelId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExplainResponse) { + return mergeFrom((com.google.cloud.vertexai.api.ExplainResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ExplainResponse other) { + if (other == com.google.cloud.vertexai.api.ExplainResponse.getDefaultInstance()) return this; + if (explanationsBuilder_ == null) { + if (!other.explanations_.isEmpty()) { + if (explanations_.isEmpty()) { + explanations_ = other.explanations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExplanationsIsMutable(); + explanations_.addAll(other.explanations_); + } + onChanged(); + } + } else { + if (!other.explanations_.isEmpty()) { + if (explanationsBuilder_.isEmpty()) { + explanationsBuilder_.dispose(); + explanationsBuilder_ = null; + explanations_ = other.explanations_; + bitField0_ = (bitField0_ & ~0x00000001); + explanationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExplanationsFieldBuilder() + : null; + } else { + explanationsBuilder_.addAllMessages(other.explanations_); + } + } + } + internalGetMutableConcurrentExplanations() + .mergeFrom(other.internalGetConcurrentExplanations()); + bitField0_ |= 0x00000002; + if (!other.getDeployedModelId().isEmpty()) { + deployedModelId_ = other.deployedModelId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (predictionsBuilder_ == null) { + if (!other.predictions_.isEmpty()) { + if (predictions_.isEmpty()) { + predictions_ = other.predictions_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensurePredictionsIsMutable(); + predictions_.addAll(other.predictions_); + } + onChanged(); + } + } else { + if (!other.predictions_.isEmpty()) { + if (predictionsBuilder_.isEmpty()) { + predictionsBuilder_.dispose(); + predictionsBuilder_ = null; + predictions_ = other.predictions_; + bitField0_ = (bitField0_ & ~0x00000008); + predictionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPredictionsFieldBuilder() + : null; + } else { + predictionsBuilder_.addAllMessages(other.predictions_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vertexai.api.Explanation m = + input.readMessage( + com.google.cloud.vertexai.api.Explanation.parser(), extensionRegistry); + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + explanations_.add(m); + } else { + explanationsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + deployedModelId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: + { + com.google.protobuf.Value m = + input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + predictions_.add(m); + } else { + predictionsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + concurrentExplanations__ = + input.readMessage( + ConcurrentExplanationsDefaultEntryHolder.defaultEntry + .getParserForType(), + extensionRegistry); + internalGetMutableConcurrentExplanations() + .getMutableMap() + .put(concurrentExplanations__.getKey(), concurrentExplanations__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List explanations_ = + java.util.Collections.emptyList(); + + private void ensureExplanationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + explanations_ = + new java.util.ArrayList(explanations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Explanation, + com.google.cloud.vertexai.api.Explanation.Builder, + com.google.cloud.vertexai.api.ExplanationOrBuilder> + explanationsBuilder_; + + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public java.util.List getExplanationsList() { + if (explanationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(explanations_); + } else { + return explanationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public int getExplanationsCount() { + if (explanationsBuilder_ == null) { + return explanations_.size(); + } else { + return explanationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public com.google.cloud.vertexai.api.Explanation getExplanations(int index) { + if (explanationsBuilder_ == null) { + return explanations_.get(index); + } else { + return explanationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder setExplanations(int index, com.google.cloud.vertexai.api.Explanation value) { + if (explanationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExplanationsIsMutable(); + explanations_.set(index, value); + onChanged(); + } else { + explanationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder setExplanations( + int index, com.google.cloud.vertexai.api.Explanation.Builder builderForValue) { + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + explanations_.set(index, builderForValue.build()); + onChanged(); + } else { + explanationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder addExplanations(com.google.cloud.vertexai.api.Explanation value) { + if (explanationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExplanationsIsMutable(); + explanations_.add(value); + onChanged(); + } else { + explanationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder addExplanations(int index, com.google.cloud.vertexai.api.Explanation value) { + if (explanationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExplanationsIsMutable(); + explanations_.add(index, value); + onChanged(); + } else { + explanationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder addExplanations( + com.google.cloud.vertexai.api.Explanation.Builder builderForValue) { + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + explanations_.add(builderForValue.build()); + onChanged(); + } else { + explanationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder addExplanations( + int index, com.google.cloud.vertexai.api.Explanation.Builder builderForValue) { + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + explanations_.add(index, builderForValue.build()); + onChanged(); + } else { + explanationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder addAllExplanations( + java.lang.Iterable values) { + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, explanations_); + onChanged(); + } else { + explanationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder clearExplanations() { + if (explanationsBuilder_ == null) { + explanations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + explanationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public Builder removeExplanations(int index) { + if (explanationsBuilder_ == null) { + ensureExplanationsIsMutable(); + explanations_.remove(index); + onChanged(); + } else { + explanationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public com.google.cloud.vertexai.api.Explanation.Builder getExplanationsBuilder(int index) { + return getExplanationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public com.google.cloud.vertexai.api.ExplanationOrBuilder getExplanationsOrBuilder(int index) { + if (explanationsBuilder_ == null) { + return explanations_.get(index); + } else { + return explanationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public java.util.List + getExplanationsOrBuilderList() { + if (explanationsBuilder_ != null) { + return explanationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(explanations_); + } + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public com.google.cloud.vertexai.api.Explanation.Builder addExplanationsBuilder() { + return getExplanationsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Explanation.getDefaultInstance()); + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public com.google.cloud.vertexai.api.Explanation.Builder addExplanationsBuilder(int index) { + return getExplanationsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Explanation.getDefaultInstance()); + } + /** + * + * + *
+     * The explanations of the Model's
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     *
+     * It has the same number of elements as
+     * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+     * explained.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + public java.util.List + getExplanationsBuilderList() { + return getExplanationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Explanation, + com.google.cloud.vertexai.api.Explanation.Builder, + com.google.cloud.vertexai.api.ExplanationOrBuilder> + getExplanationsFieldBuilder() { + if (explanationsBuilder_ == null) { + explanationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Explanation, + com.google.cloud.vertexai.api.Explanation.Builder, + com.google.cloud.vertexai.api.ExplanationOrBuilder>( + explanations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + explanations_ = null; + } + return explanationsBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + concurrentExplanations_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + internalGetConcurrentExplanations() { + if (concurrentExplanations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ConcurrentExplanationsDefaultEntryHolder.defaultEntry); + } + return concurrentExplanations_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + internalGetMutableConcurrentExplanations() { + if (concurrentExplanations_ == null) { + concurrentExplanations_ = + com.google.protobuf.MapField.newMapField( + ConcurrentExplanationsDefaultEntryHolder.defaultEntry); + } + if (!concurrentExplanations_.isMutable()) { + concurrentExplanations_ = concurrentExplanations_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return concurrentExplanations_; + } + + public int getConcurrentExplanationsCount() { + return internalGetConcurrentExplanations().getMap().size(); + } + /** + * + * + *
+     * This field stores the results of the explanations run in parallel with
+     * The default explanation strategy/method.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + @java.lang.Override + public boolean containsConcurrentExplanations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetConcurrentExplanations().getMap().containsKey(key); + } + /** Use {@link #getConcurrentExplanationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + getConcurrentExplanations() { + return getConcurrentExplanationsMap(); + } + /** + * + * + *
+     * This field stores the results of the explanations run in parallel with
+     * The default explanation strategy/method.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + getConcurrentExplanationsMap() { + return internalGetConcurrentExplanations().getMap(); + } + /** + * + * + *
+     * This field stores the results of the explanations run in parallel with
+     * The default explanation strategy/method.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + getConcurrentExplanationsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + map = internalGetConcurrentExplanations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * This field stores the results of the explanations run in parallel with
+     * The default explanation strategy/method.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + getConcurrentExplanationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + map = internalGetConcurrentExplanations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearConcurrentExplanations() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableConcurrentExplanations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * This field stores the results of the explanations run in parallel with
+     * The default explanation strategy/method.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + public Builder removeConcurrentExplanations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableConcurrentExplanations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + getMutableConcurrentExplanations() { + bitField0_ |= 0x00000002; + return internalGetMutableConcurrentExplanations().getMutableMap(); + } + /** + * + * + *
+     * This field stores the results of the explanations run in parallel with
+     * The default explanation strategy/method.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + public Builder putConcurrentExplanations( + java.lang.String key, + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableConcurrentExplanations().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+     * This field stores the results of the explanations run in parallel with
+     * The default explanation strategy/method.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + public Builder putAllConcurrentExplanations( + java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + values) { + internalGetMutableConcurrentExplanations().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; + return this; + } + + private java.lang.Object deployedModelId_ = ""; + /** + * + * + *
+     * ID of the Endpoint's DeployedModel that served this explanation.
+     * 
+ * + * string deployed_model_id = 2; + * + * @return The deployedModelId. + */ + public java.lang.String getDeployedModelId() { + java.lang.Object ref = deployedModelId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedModelId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the Endpoint's DeployedModel that served this explanation.
+     * 
+ * + * string deployed_model_id = 2; + * + * @return The bytes for deployedModelId. + */ + public com.google.protobuf.ByteString getDeployedModelIdBytes() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the Endpoint's DeployedModel that served this explanation.
+     * 
+ * + * string deployed_model_id = 2; + * + * @param value The deployedModelId to set. + * @return This builder for chaining. + */ + public Builder setDeployedModelId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + deployedModelId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the Endpoint's DeployedModel that served this explanation.
+     * 
+ * + * string deployed_model_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearDeployedModelId() { + deployedModelId_ = getDefaultInstance().getDeployedModelId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the Endpoint's DeployedModel that served this explanation.
+     * 
+ * + * string deployed_model_id = 2; + * + * @param value The bytes for deployedModelId to set. + * @return This builder for chaining. + */ + public Builder setDeployedModelIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + deployedModelId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List predictions_ = + java.util.Collections.emptyList(); + + private void ensurePredictionsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + predictions_ = new java.util.ArrayList(predictions_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + predictionsBuilder_; + + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public java.util.List getPredictionsList() { + if (predictionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(predictions_); + } else { + return predictionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public int getPredictionsCount() { + if (predictionsBuilder_ == null) { + return predictions_.size(); + } else { + return predictionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public com.google.protobuf.Value getPredictions(int index) { + if (predictionsBuilder_ == null) { + return predictions_.get(index); + } else { + return predictionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public Builder setPredictions(int index, com.google.protobuf.Value value) { + if (predictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePredictionsIsMutable(); + predictions_.set(index, value); + onChanged(); + } else { + predictionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public Builder setPredictions(int index, com.google.protobuf.Value.Builder builderForValue) { + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + predictions_.set(index, builderForValue.build()); + onChanged(); + } else { + predictionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public Builder addPredictions(com.google.protobuf.Value value) { + if (predictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePredictionsIsMutable(); + predictions_.add(value); + onChanged(); + } else { + predictionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public Builder addPredictions(int index, com.google.protobuf.Value value) { + if (predictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePredictionsIsMutable(); + predictions_.add(index, value); + onChanged(); + } else { + predictionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public Builder addPredictions(com.google.protobuf.Value.Builder builderForValue) { + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + predictions_.add(builderForValue.build()); + onChanged(); + } else { + predictionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public Builder addPredictions(int index, com.google.protobuf.Value.Builder builderForValue) { + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + predictions_.add(index, builderForValue.build()); + onChanged(); + } else { + predictionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public Builder addAllPredictions( + java.lang.Iterable values) { + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, predictions_); + onChanged(); + } else { + predictionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public Builder clearPredictions() { + if (predictionsBuilder_ == null) { + predictions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + predictionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public Builder removePredictions(int index) { + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + predictions_.remove(index); + onChanged(); + } else { + predictionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public com.google.protobuf.Value.Builder getPredictionsBuilder(int index) { + return getPredictionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public com.google.protobuf.ValueOrBuilder getPredictionsOrBuilder(int index) { + if (predictionsBuilder_ == null) { + return predictions_.get(index); + } else { + return predictionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public java.util.List + getPredictionsOrBuilderList() { + if (predictionsBuilder_ != null) { + return predictionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(predictions_); + } + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public com.google.protobuf.Value.Builder addPredictionsBuilder() { + return getPredictionsFieldBuilder() + .addBuilder(com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public com.google.protobuf.Value.Builder addPredictionsBuilder(int index) { + return getPredictionsFieldBuilder() + .addBuilder(index, com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * Same as
+     * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + public java.util.List getPredictionsBuilderList() { + return getPredictionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getPredictionsFieldBuilder() { + if (predictionsBuilder_ == null) { + predictionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + predictions_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + predictions_ = null; + } + return predictionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplainResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplainResponse) + private static final com.google.cloud.vertexai.api.ExplainResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExplainResponse(); + } + + public static com.google.cloud.vertexai.api.ExplainResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplainResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplainResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainResponseOrBuilder.java new file mode 100644 index 000000000000..3e32656abdb1 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplainResponseOrBuilder.java @@ -0,0 +1,267 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface ExplainResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplainResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The explanations of the Model's
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   *
+   * It has the same number of elements as
+   * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+   * explained.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + java.util.List getExplanationsList(); + /** + * + * + *
+   * The explanations of the Model's
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   *
+   * It has the same number of elements as
+   * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+   * explained.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + com.google.cloud.vertexai.api.Explanation getExplanations(int index); + /** + * + * + *
+   * The explanations of the Model's
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   *
+   * It has the same number of elements as
+   * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+   * explained.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + int getExplanationsCount(); + /** + * + * + *
+   * The explanations of the Model's
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   *
+   * It has the same number of elements as
+   * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+   * explained.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + java.util.List + getExplanationsOrBuilderList(); + /** + * + * + *
+   * The explanations of the Model's
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   *
+   * It has the same number of elements as
+   * [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be
+   * explained.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Explanation explanations = 1; + */ + com.google.cloud.vertexai.api.ExplanationOrBuilder getExplanationsOrBuilder(int index); + + /** + * + * + *
+   * This field stores the results of the explanations run in parallel with
+   * The default explanation strategy/method.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + int getConcurrentExplanationsCount(); + /** + * + * + *
+   * This field stores the results of the explanations run in parallel with
+   * The default explanation strategy/method.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + boolean containsConcurrentExplanations(java.lang.String key); + /** Use {@link #getConcurrentExplanationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + getConcurrentExplanations(); + /** + * + * + *
+   * This field stores the results of the explanations run in parallel with
+   * The default explanation strategy/method.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation> + getConcurrentExplanationsMap(); + /** + * + * + *
+   * This field stores the results of the explanations run in parallel with
+   * The default explanation strategy/method.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + /* nullable */ + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + getConcurrentExplanationsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation defaultValue); + /** + * + * + *
+   * This field stores the results of the explanations run in parallel with
+   * The default explanation strategy/method.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplainResponse.ConcurrentExplanation> concurrent_explanations = 4; + * + */ + com.google.cloud.vertexai.api.ExplainResponse.ConcurrentExplanation + getConcurrentExplanationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * ID of the Endpoint's DeployedModel that served this explanation.
+   * 
+ * + * string deployed_model_id = 2; + * + * @return The deployedModelId. + */ + java.lang.String getDeployedModelId(); + /** + * + * + *
+   * ID of the Endpoint's DeployedModel that served this explanation.
+   * 
+ * + * string deployed_model_id = 2; + * + * @return The bytes for deployedModelId. + */ + com.google.protobuf.ByteString getDeployedModelIdBytes(); + + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * Same as
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + java.util.List getPredictionsList(); + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * Same as
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + com.google.protobuf.Value getPredictions(int index); + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * Same as
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + int getPredictionsCount(); + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * Same as
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + java.util.List getPredictionsOrBuilderList(); + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * Same as
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 3; + */ + com.google.protobuf.ValueOrBuilder getPredictionsOrBuilder(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Explanation.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Explanation.java new file mode 100644 index 000000000000..4178f2f773cd --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Explanation.java @@ -0,0 +1,2004 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Explanation of a prediction (provided in
+ * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions])
+ * produced by the Model on a given
+ * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Explanation} + */ +public final class Explanation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Explanation) + ExplanationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Explanation.newBuilder() to construct. + private Explanation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Explanation() { + attributions_ = java.util.Collections.emptyList(); + neighbors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Explanation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Explanation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Explanation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Explanation.class, + com.google.cloud.vertexai.api.Explanation.Builder.class); + } + + public static final int ATTRIBUTIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List attributions_; + /** + * + * + *
+   * Output only. Feature attributions grouped by predicted outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * If users set
+   * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+   * the attributions are sorted by
+   * [instance_output_value][Attributions.instance_output_value] in descending
+   * order. If
+   * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+   * is specified, the attributions are stored by
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * in the same order as they appear in the output_indices.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getAttributionsList() { + return attributions_; + } + /** + * + * + *
+   * Output only. Feature attributions grouped by predicted outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * If users set
+   * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+   * the attributions are sorted by
+   * [instance_output_value][Attributions.instance_output_value] in descending
+   * order. If
+   * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+   * is specified, the attributions are stored by
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * in the same order as they appear in the output_indices.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getAttributionsOrBuilderList() { + return attributions_; + } + /** + * + * + *
+   * Output only. Feature attributions grouped by predicted outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * If users set
+   * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+   * the attributions are sorted by
+   * [instance_output_value][Attributions.instance_output_value] in descending
+   * order. If
+   * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+   * is specified, the attributions are stored by
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * in the same order as they appear in the output_indices.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getAttributionsCount() { + return attributions_.size(); + } + /** + * + * + *
+   * Output only. Feature attributions grouped by predicted outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * If users set
+   * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+   * the attributions are sorted by
+   * [instance_output_value][Attributions.instance_output_value] in descending
+   * order. If
+   * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+   * is specified, the attributions are stored by
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * in the same order as they appear in the output_indices.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Attribution getAttributions(int index) { + return attributions_.get(index); + } + /** + * + * + *
+   * Output only. Feature attributions grouped by predicted outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * If users set
+   * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+   * the attributions are sorted by
+   * [instance_output_value][Attributions.instance_output_value] in descending
+   * order. If
+   * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+   * is specified, the attributions are stored by
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * in the same order as they appear in the output_indices.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.AttributionOrBuilder getAttributionsOrBuilder(int index) { + return attributions_.get(index); + } + + public static final int NEIGHBORS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List neighbors_; + /** + * + * + *
+   * Output only. List of the nearest neighbors for example-based explanations.
+   *
+   * For models deployed with the examples explanations feature enabled, the
+   * attributions field is empty and instead the neighbors field is populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getNeighborsList() { + return neighbors_; + } + /** + * + * + *
+   * Output only. List of the nearest neighbors for example-based explanations.
+   *
+   * For models deployed with the examples explanations feature enabled, the
+   * attributions field is empty and instead the neighbors field is populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getNeighborsOrBuilderList() { + return neighbors_; + } + /** + * + * + *
+   * Output only. List of the nearest neighbors for example-based explanations.
+   *
+   * For models deployed with the examples explanations feature enabled, the
+   * attributions field is empty and instead the neighbors field is populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getNeighborsCount() { + return neighbors_.size(); + } + /** + * + * + *
+   * Output only. List of the nearest neighbors for example-based explanations.
+   *
+   * For models deployed with the examples explanations feature enabled, the
+   * attributions field is empty and instead the neighbors field is populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Neighbor getNeighbors(int index) { + return neighbors_.get(index); + } + /** + * + * + *
+   * Output only. List of the nearest neighbors for example-based explanations.
+   *
+   * For models deployed with the examples explanations feature enabled, the
+   * attributions field is empty and instead the neighbors field is populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.NeighborOrBuilder getNeighborsOrBuilder(int index) { + return neighbors_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < attributions_.size(); i++) { + output.writeMessage(1, attributions_.get(i)); + } + for (int i = 0; i < neighbors_.size(); i++) { + output.writeMessage(2, neighbors_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < attributions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, attributions_.get(i)); + } + for (int i = 0; i < neighbors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, neighbors_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Explanation)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Explanation other = + (com.google.cloud.vertexai.api.Explanation) obj; + + if (!getAttributionsList().equals(other.getAttributionsList())) return false; + if (!getNeighborsList().equals(other.getNeighborsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAttributionsCount() > 0) { + hash = (37 * hash) + ATTRIBUTIONS_FIELD_NUMBER; + hash = (53 * hash) + getAttributionsList().hashCode(); + } + if (getNeighborsCount() > 0) { + hash = (37 * hash) + NEIGHBORS_FIELD_NUMBER; + hash = (53 * hash) + getNeighborsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Explanation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Explanation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Explanation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Explanation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Explanation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Explanation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Explanation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Explanation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Explanation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Explanation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Explanation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Explanation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Explanation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Explanation of a prediction (provided in
+   * [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions])
+   * produced by the Model on a given
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Explanation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Explanation) + com.google.cloud.vertexai.api.ExplanationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Explanation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Explanation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Explanation.class, + com.google.cloud.vertexai.api.Explanation.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Explanation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (attributionsBuilder_ == null) { + attributions_ = java.util.Collections.emptyList(); + } else { + attributions_ = null; + attributionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (neighborsBuilder_ == null) { + neighbors_ = java.util.Collections.emptyList(); + } else { + neighbors_ = null; + neighborsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Explanation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Explanation getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Explanation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Explanation build() { + com.google.cloud.vertexai.api.Explanation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Explanation buildPartial() { + com.google.cloud.vertexai.api.Explanation result = + new com.google.cloud.vertexai.api.Explanation(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.Explanation result) { + if (attributionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + attributions_ = java.util.Collections.unmodifiableList(attributions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.attributions_ = attributions_; + } else { + result.attributions_ = attributionsBuilder_.build(); + } + if (neighborsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + neighbors_ = java.util.Collections.unmodifiableList(neighbors_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.neighbors_ = neighbors_; + } else { + result.neighbors_ = neighborsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.Explanation result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Explanation) { + return mergeFrom((com.google.cloud.vertexai.api.Explanation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Explanation other) { + if (other == com.google.cloud.vertexai.api.Explanation.getDefaultInstance()) return this; + if (attributionsBuilder_ == null) { + if (!other.attributions_.isEmpty()) { + if (attributions_.isEmpty()) { + attributions_ = other.attributions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAttributionsIsMutable(); + attributions_.addAll(other.attributions_); + } + onChanged(); + } + } else { + if (!other.attributions_.isEmpty()) { + if (attributionsBuilder_.isEmpty()) { + attributionsBuilder_.dispose(); + attributionsBuilder_ = null; + attributions_ = other.attributions_; + bitField0_ = (bitField0_ & ~0x00000001); + attributionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAttributionsFieldBuilder() + : null; + } else { + attributionsBuilder_.addAllMessages(other.attributions_); + } + } + } + if (neighborsBuilder_ == null) { + if (!other.neighbors_.isEmpty()) { + if (neighbors_.isEmpty()) { + neighbors_ = other.neighbors_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNeighborsIsMutable(); + neighbors_.addAll(other.neighbors_); + } + onChanged(); + } + } else { + if (!other.neighbors_.isEmpty()) { + if (neighborsBuilder_.isEmpty()) { + neighborsBuilder_.dispose(); + neighborsBuilder_ = null; + neighbors_ = other.neighbors_; + bitField0_ = (bitField0_ & ~0x00000002); + neighborsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNeighborsFieldBuilder() + : null; + } else { + neighborsBuilder_.addAllMessages(other.neighbors_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vertexai.api.Attribution m = + input.readMessage( + com.google.cloud.vertexai.api.Attribution.parser(), extensionRegistry); + if (attributionsBuilder_ == null) { + ensureAttributionsIsMutable(); + attributions_.add(m); + } else { + attributionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.vertexai.api.Neighbor m = + input.readMessage( + com.google.cloud.vertexai.api.Neighbor.parser(), extensionRegistry); + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + neighbors_.add(m); + } else { + neighborsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List attributions_ = + java.util.Collections.emptyList(); + + private void ensureAttributionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + attributions_ = + new java.util.ArrayList(attributions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Attribution, + com.google.cloud.vertexai.api.Attribution.Builder, + com.google.cloud.vertexai.api.AttributionOrBuilder> + attributionsBuilder_; + + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getAttributionsList() { + if (attributionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(attributions_); + } else { + return attributionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getAttributionsCount() { + if (attributionsBuilder_ == null) { + return attributions_.size(); + } else { + return attributionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Attribution getAttributions(int index) { + if (attributionsBuilder_ == null) { + return attributions_.get(index); + } else { + return attributionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAttributions(int index, com.google.cloud.vertexai.api.Attribution value) { + if (attributionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributionsIsMutable(); + attributions_.set(index, value); + onChanged(); + } else { + attributionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAttributions( + int index, com.google.cloud.vertexai.api.Attribution.Builder builderForValue) { + if (attributionsBuilder_ == null) { + ensureAttributionsIsMutable(); + attributions_.set(index, builderForValue.build()); + onChanged(); + } else { + attributionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAttributions(com.google.cloud.vertexai.api.Attribution value) { + if (attributionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributionsIsMutable(); + attributions_.add(value); + onChanged(); + } else { + attributionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAttributions(int index, com.google.cloud.vertexai.api.Attribution value) { + if (attributionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributionsIsMutable(); + attributions_.add(index, value); + onChanged(); + } else { + attributionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAttributions( + com.google.cloud.vertexai.api.Attribution.Builder builderForValue) { + if (attributionsBuilder_ == null) { + ensureAttributionsIsMutable(); + attributions_.add(builderForValue.build()); + onChanged(); + } else { + attributionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAttributions( + int index, com.google.cloud.vertexai.api.Attribution.Builder builderForValue) { + if (attributionsBuilder_ == null) { + ensureAttributionsIsMutable(); + attributions_.add(index, builderForValue.build()); + onChanged(); + } else { + attributionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllAttributions( + java.lang.Iterable values) { + if (attributionsBuilder_ == null) { + ensureAttributionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, attributions_); + onChanged(); + } else { + attributionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearAttributions() { + if (attributionsBuilder_ == null) { + attributions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + attributionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeAttributions(int index) { + if (attributionsBuilder_ == null) { + ensureAttributionsIsMutable(); + attributions_.remove(index); + onChanged(); + } else { + attributionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Attribution.Builder getAttributionsBuilder(int index) { + return getAttributionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.AttributionOrBuilder getAttributionsOrBuilder(int index) { + if (attributionsBuilder_ == null) { + return attributions_.get(index); + } else { + return attributionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getAttributionsOrBuilderList() { + if (attributionsBuilder_ != null) { + return attributionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attributions_); + } + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Attribution.Builder addAttributionsBuilder() { + return getAttributionsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Attribution.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Attribution.Builder addAttributionsBuilder(int index) { + return getAttributionsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Attribution.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Feature attributions grouped by predicted outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * If users set
+     * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+     * the attributions are sorted by
+     * [instance_output_value][Attributions.instance_output_value] in descending
+     * order. If
+     * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+     * is specified, the attributions are stored by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * in the same order as they appear in the output_indices.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getAttributionsBuilderList() { + return getAttributionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Attribution, + com.google.cloud.vertexai.api.Attribution.Builder, + com.google.cloud.vertexai.api.AttributionOrBuilder> + getAttributionsFieldBuilder() { + if (attributionsBuilder_ == null) { + attributionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Attribution, + com.google.cloud.vertexai.api.Attribution.Builder, + com.google.cloud.vertexai.api.AttributionOrBuilder>( + attributions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + attributions_ = null; + } + return attributionsBuilder_; + } + + private java.util.List neighbors_ = + java.util.Collections.emptyList(); + + private void ensureNeighborsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + neighbors_ = new java.util.ArrayList(neighbors_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Neighbor, + com.google.cloud.vertexai.api.Neighbor.Builder, + com.google.cloud.vertexai.api.NeighborOrBuilder> + neighborsBuilder_; + + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getNeighborsList() { + if (neighborsBuilder_ == null) { + return java.util.Collections.unmodifiableList(neighbors_); + } else { + return neighborsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getNeighborsCount() { + if (neighborsBuilder_ == null) { + return neighbors_.size(); + } else { + return neighborsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Neighbor getNeighbors(int index) { + if (neighborsBuilder_ == null) { + return neighbors_.get(index); + } else { + return neighborsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNeighbors(int index, com.google.cloud.vertexai.api.Neighbor value) { + if (neighborsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNeighborsIsMutable(); + neighbors_.set(index, value); + onChanged(); + } else { + neighborsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNeighbors( + int index, com.google.cloud.vertexai.api.Neighbor.Builder builderForValue) { + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + neighbors_.set(index, builderForValue.build()); + onChanged(); + } else { + neighborsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNeighbors(com.google.cloud.vertexai.api.Neighbor value) { + if (neighborsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNeighborsIsMutable(); + neighbors_.add(value); + onChanged(); + } else { + neighborsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNeighbors(int index, com.google.cloud.vertexai.api.Neighbor value) { + if (neighborsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNeighborsIsMutable(); + neighbors_.add(index, value); + onChanged(); + } else { + neighborsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNeighbors(com.google.cloud.vertexai.api.Neighbor.Builder builderForValue) { + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + neighbors_.add(builderForValue.build()); + onChanged(); + } else { + neighborsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addNeighbors( + int index, com.google.cloud.vertexai.api.Neighbor.Builder builderForValue) { + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + neighbors_.add(index, builderForValue.build()); + onChanged(); + } else { + neighborsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllNeighbors( + java.lang.Iterable values) { + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, neighbors_); + onChanged(); + } else { + neighborsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNeighbors() { + if (neighborsBuilder_ == null) { + neighbors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + neighborsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeNeighbors(int index) { + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + neighbors_.remove(index); + onChanged(); + } else { + neighborsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Neighbor.Builder getNeighborsBuilder(int index) { + return getNeighborsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.NeighborOrBuilder getNeighborsOrBuilder(int index) { + if (neighborsBuilder_ == null) { + return neighbors_.get(index); + } else { + return neighborsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNeighborsOrBuilderList() { + if (neighborsBuilder_ != null) { + return neighborsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(neighbors_); + } + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Neighbor.Builder addNeighborsBuilder() { + return getNeighborsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Neighbor.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Neighbor.Builder addNeighborsBuilder(int index) { + return getNeighborsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Neighbor.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of the nearest neighbors for example-based explanations.
+     *
+     * For models deployed with the examples explanations feature enabled, the
+     * attributions field is empty and instead the neighbors field is populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getNeighborsBuilderList() { + return getNeighborsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Neighbor, + com.google.cloud.vertexai.api.Neighbor.Builder, + com.google.cloud.vertexai.api.NeighborOrBuilder> + getNeighborsFieldBuilder() { + if (neighborsBuilder_ == null) { + neighborsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Neighbor, + com.google.cloud.vertexai.api.Neighbor.Builder, + com.google.cloud.vertexai.api.NeighborOrBuilder>( + neighbors_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + neighbors_ = null; + } + return neighborsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Explanation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Explanation) + private static final com.google.cloud.vertexai.api.Explanation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Explanation(); + } + + public static com.google.cloud.vertexai.api.Explanation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Explanation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Explanation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadata.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadata.java new file mode 100644 index 000000000000..c275b468b8f1 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadata.java @@ -0,0 +1,12243 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation_metadata.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Metadata describing the Model's input and output for explanation.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationMetadata} + */ +public final class ExplanationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplanationMetadata) + ExplanationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplanationMetadata.newBuilder() to construct. + private ExplanationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplanationMetadata() { + featureAttributionsSchemaUri_ = ""; + latentSpaceSource_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplanationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetInputs(); + case 2: + return internalGetOutputs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadata.class, + com.google.cloud.vertexai.api.ExplanationMetadata.Builder.class); + } + + public interface InputMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * If no baseline is specified, Vertex AI chooses the baseline for this
+     * feature. If multiple baselines are specified, Vertex AI returns the
+     * average attributions across them in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     *
+     * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+     * of each baseline must match the shape of the input tensor. If a scalar is
+     * provided, we broadcast to the same shape as the input tensor.
+     *
+     * For custom images, the element of the baselines must be in the same
+     * format as the feature's input in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+     * 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].
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + java.util.List getInputBaselinesList(); + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * If no baseline is specified, Vertex AI chooses the baseline for this
+     * feature. If multiple baselines are specified, Vertex AI returns the
+     * average attributions across them in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     *
+     * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+     * of each baseline must match the shape of the input tensor. If a scalar is
+     * provided, we broadcast to the same shape as the input tensor.
+     *
+     * For custom images, the element of the baselines must be in the same
+     * format as the feature's input in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+     * 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].
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + com.google.protobuf.Value getInputBaselines(int index); + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * If no baseline is specified, Vertex AI chooses the baseline for this
+     * feature. If multiple baselines are specified, Vertex AI returns the
+     * average attributions across them in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     *
+     * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+     * of each baseline must match the shape of the input tensor. If a scalar is
+     * provided, we broadcast to the same shape as the input tensor.
+     *
+     * For custom images, the element of the baselines must be in the same
+     * format as the feature's input in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+     * 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].
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + int getInputBaselinesCount(); + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * If no baseline is specified, Vertex AI chooses the baseline for this
+     * feature. If multiple baselines are specified, Vertex AI returns the
+     * average attributions across them in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     *
+     * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+     * of each baseline must match the shape of the input tensor. If a scalar is
+     * provided, we broadcast to the same shape as the input tensor.
+     *
+     * For custom images, the element of the baselines must be in the same
+     * format as the feature's input in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+     * 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].
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + java.util.List getInputBaselinesOrBuilderList(); + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * If no baseline is specified, Vertex AI chooses the baseline for this
+     * feature. If multiple baselines are specified, Vertex AI returns the
+     * average attributions across them in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     *
+     * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+     * of each baseline must match the shape of the input tensor. If a scalar is
+     * provided, we broadcast to the same shape as the input tensor.
+     *
+     * For custom images, the element of the baselines must be in the same
+     * format as the feature's input in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+     * 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].
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + com.google.protobuf.ValueOrBuilder getInputBaselinesOrBuilder(int index); + + /** + * + * + *
+     * Name of the input tensor for this feature. Required and is only
+     * applicable to Vertex AI-provided images for Tensorflow.
+     * 
+ * + * string input_tensor_name = 2; + * + * @return The inputTensorName. + */ + java.lang.String getInputTensorName(); + /** + * + * + *
+     * Name of the input tensor for this feature. Required and is only
+     * applicable to Vertex AI-provided images for Tensorflow.
+     * 
+ * + * string input_tensor_name = 2; + * + * @return The bytes for inputTensorName. + */ + com.google.protobuf.ByteString getInputTensorNameBytes(); + + /** + * + * + *
+     * Defines how the feature is encoded into the input tensor. Defaults to
+     * IDENTITY.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding encoding = 3; + * + * + * @return The enum numeric value on the wire for encoding. + */ + int getEncodingValue(); + /** + * + * + *
+     * Defines how the feature is encoded into the input tensor. Defaults to
+     * IDENTITY.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding encoding = 3; + * + * + * @return The encoding. + */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding getEncoding(); + + /** + * + * + *
+     * Modality of the feature. Valid values are: numeric, image. Defaults to
+     * numeric.
+     * 
+ * + * string modality = 4; + * + * @return The modality. + */ + java.lang.String getModality(); + /** + * + * + *
+     * Modality of the feature. Valid values are: numeric, image. Defaults to
+     * numeric.
+     * 
+ * + * string modality = 4; + * + * @return The bytes for modality. + */ + com.google.protobuf.ByteString getModalityBytes(); + + /** + * + * + *
+     * The domain details of the input feature value. Like min/max, original
+     * mean or standard deviation if normalized.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + * + * @return Whether the featureValueDomain field is set. + */ + boolean hasFeatureValueDomain(); + /** + * + * + *
+     * The domain details of the input feature value. Like min/max, original
+     * mean or standard deviation if normalized.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + * + * @return The featureValueDomain. + */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + getFeatureValueDomain(); + /** + * + * + *
+     * The domain details of the input feature value. Like min/max, original
+     * mean or standard deviation if normalized.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomainOrBuilder + getFeatureValueDomainOrBuilder(); + + /** + * + * + *
+     * Specifies the index of the values of the input tensor.
+     * Required when the input tensor is a sparse representation. Refer to
+     * Tensorflow documentation for more details:
+     * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+     * 
+ * + * string indices_tensor_name = 6; + * + * @return The indicesTensorName. + */ + java.lang.String getIndicesTensorName(); + /** + * + * + *
+     * Specifies the index of the values of the input tensor.
+     * Required when the input tensor is a sparse representation. Refer to
+     * Tensorflow documentation for more details:
+     * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+     * 
+ * + * string indices_tensor_name = 6; + * + * @return The bytes for indicesTensorName. + */ + com.google.protobuf.ByteString getIndicesTensorNameBytes(); + + /** + * + * + *
+     * Specifies the shape of the values of the input if the input is a sparse
+     * representation. Refer to Tensorflow documentation for more details:
+     * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+     * 
+ * + * string dense_shape_tensor_name = 7; + * + * @return The denseShapeTensorName. + */ + java.lang.String getDenseShapeTensorName(); + /** + * + * + *
+     * Specifies the shape of the values of the input if the input is a sparse
+     * representation. Refer to Tensorflow documentation for more details:
+     * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+     * 
+ * + * string dense_shape_tensor_name = 7; + * + * @return The bytes for denseShapeTensorName. + */ + com.google.protobuf.ByteString getDenseShapeTensorNameBytes(); + + /** + * + * + *
+     * A list of feature names for each index in the input tensor.
+     * Required when the input
+     * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+     * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+     * 
+ * + * repeated string index_feature_mapping = 8; + * + * @return A list containing the indexFeatureMapping. + */ + java.util.List getIndexFeatureMappingList(); + /** + * + * + *
+     * A list of feature names for each index in the input tensor.
+     * Required when the input
+     * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+     * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+     * 
+ * + * repeated string index_feature_mapping = 8; + * + * @return The count of indexFeatureMapping. + */ + int getIndexFeatureMappingCount(); + /** + * + * + *
+     * A list of feature names for each index in the input tensor.
+     * Required when the input
+     * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+     * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+     * 
+ * + * repeated string index_feature_mapping = 8; + * + * @param index The index of the element to return. + * @return The indexFeatureMapping at the given index. + */ + java.lang.String getIndexFeatureMapping(int index); + /** + * + * + *
+     * A list of feature names for each index in the input tensor.
+     * Required when the input
+     * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+     * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+     * 
+ * + * repeated string index_feature_mapping = 8; + * + * @param index The index of the value to return. + * @return The bytes of the indexFeatureMapping at the given index. + */ + com.google.protobuf.ByteString getIndexFeatureMappingBytes(int index); + + /** + * + * + *
+     * Encoded tensor is a transformation of the input tensor. Must be provided
+     * if choosing
+     * [Integrated Gradients
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]
+     * or [XRAI
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution]
+     * and the input tensor is not differentiable.
+     *
+     * An encoded tensor is generated if the input tensor is encoded by a lookup
+     * table.
+     * 
+ * + * string encoded_tensor_name = 9; + * + * @return The encodedTensorName. + */ + java.lang.String getEncodedTensorName(); + /** + * + * + *
+     * Encoded tensor is a transformation of the input tensor. Must be provided
+     * if choosing
+     * [Integrated Gradients
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]
+     * or [XRAI
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution]
+     * and the input tensor is not differentiable.
+     *
+     * An encoded tensor is generated if the input tensor is encoded by a lookup
+     * table.
+     * 
+ * + * string encoded_tensor_name = 9; + * + * @return The bytes for encodedTensorName. + */ + com.google.protobuf.ByteString getEncodedTensorNameBytes(); + + /** + * + * + *
+     * A list of baselines for the encoded tensor.
+     *
+     * The shape of each baseline should match the shape of the encoded tensor.
+     * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+     * encoded tensor.
+     * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + java.util.List getEncodedBaselinesList(); + /** + * + * + *
+     * A list of baselines for the encoded tensor.
+     *
+     * The shape of each baseline should match the shape of the encoded tensor.
+     * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+     * encoded tensor.
+     * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + com.google.protobuf.Value getEncodedBaselines(int index); + /** + * + * + *
+     * A list of baselines for the encoded tensor.
+     *
+     * The shape of each baseline should match the shape of the encoded tensor.
+     * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+     * encoded tensor.
+     * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + int getEncodedBaselinesCount(); + /** + * + * + *
+     * A list of baselines for the encoded tensor.
+     *
+     * The shape of each baseline should match the shape of the encoded tensor.
+     * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+     * encoded tensor.
+     * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + java.util.List getEncodedBaselinesOrBuilderList(); + /** + * + * + *
+     * A list of baselines for the encoded tensor.
+     *
+     * The shape of each baseline should match the shape of the encoded tensor.
+     * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+     * encoded tensor.
+     * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + com.google.protobuf.ValueOrBuilder getEncodedBaselinesOrBuilder(int index); + + /** + * + * + *
+     * Visualization configurations for image explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + * + * @return Whether the visualization field is set. + */ + boolean hasVisualization(); + /** + * + * + *
+     * Visualization configurations for image explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + * + * @return The visualization. + */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + getVisualization(); + /** + * + * + *
+     * Visualization configurations for image explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.VisualizationOrBuilder + getVisualizationOrBuilder(); + + /** + * + * + *
+     * Name of the group that the input belongs to. Features with the same group
+     * name will be treated as one feature when computing attributions. Features
+     * grouped together can have different shapes in value. If provided, there
+     * will be one single attribution generated in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions],
+     * keyed by the group name.
+     * 
+ * + * string group_name = 12; + * + * @return The groupName. + */ + java.lang.String getGroupName(); + /** + * + * + *
+     * Name of the group that the input belongs to. Features with the same group
+     * name will be treated as one feature when computing attributions. Features
+     * grouped together can have different shapes in value. If provided, there
+     * will be one single attribution generated in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions],
+     * keyed by the group name.
+     * 
+ * + * string group_name = 12; + * + * @return The bytes for groupName. + */ + com.google.protobuf.ByteString getGroupNameBytes(); + } + /** + * + * + *
+   * Metadata of the input of a feature.
+   *
+   * Fields other than
+   * [InputMetadata.input_baselines][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.input_baselines]
+   * are applicable only for Models that are using Vertex AI-provided images for
+   * Tensorflow.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata} + */ + public static final class InputMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata) + InputMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use InputMetadata.newBuilder() to construct. + private InputMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InputMetadata() { + inputBaselines_ = java.util.Collections.emptyList(); + inputTensorName_ = ""; + encoding_ = 0; + modality_ = ""; + indicesTensorName_ = ""; + denseShapeTensorName_ = ""; + indexFeatureMapping_ = com.google.protobuf.LazyStringArrayList.emptyList(); + encodedTensorName_ = ""; + encodedBaselines_ = java.util.Collections.emptyList(); + groupName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InputMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.class, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Builder.class); + } + + /** + * + * + *
+     * Defines how a feature is encoded. Defaults to IDENTITY.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding} + */ + public enum Encoding implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value. This is the same as IDENTITY.
+       * 
+ * + * ENCODING_UNSPECIFIED = 0; + */ + ENCODING_UNSPECIFIED(0), + /** + * + * + *
+       * The tensor represents one feature.
+       * 
+ * + * IDENTITY = 1; + */ + IDENTITY(1), + /** + * + * + *
+       * The tensor represents a bag of features where each index maps to
+       * a feature.
+       * [InputMetadata.index_feature_mapping][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping]
+       * must be provided for this encoding. For example:
+       * ```
+       * input = [27, 6.0, 150]
+       * index_feature_mapping = ["age", "height", "weight"]
+       * ```
+       * 
+ * + * BAG_OF_FEATURES = 2; + */ + BAG_OF_FEATURES(2), + /** + * + * + *
+       * The tensor represents a bag of features where each index maps to a
+       * feature. Zero values in the tensor indicates feature being
+       * non-existent.
+       * [InputMetadata.index_feature_mapping][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping]
+       * must be provided for this encoding. For example:
+       * ```
+       * input = [2, 0, 5, 0, 1]
+       * index_feature_mapping = ["a", "b", "c", "d", "e"]
+       * ```
+       * 
+ * + * BAG_OF_FEATURES_SPARSE = 3; + */ + BAG_OF_FEATURES_SPARSE(3), + /** + * + * + *
+       * The tensor is a list of binaries representing whether a feature exists
+       * or not (1 indicates existence).
+       * [InputMetadata.index_feature_mapping][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping]
+       * must be provided for this encoding. For example:
+       * ```
+       * input = [1, 0, 1, 0, 1]
+       * index_feature_mapping = ["a", "b", "c", "d", "e"]
+       * ```
+       * 
+ * + * INDICATOR = 4; + */ + INDICATOR(4), + /** + * + * + *
+       * The tensor is encoded into a 1-dimensional array represented by an
+       * encoded tensor.
+       * [InputMetadata.encoded_tensor_name][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoded_tensor_name]
+       * must be provided for this encoding. For example:
+       * ```
+       * input = ["This", "is", "a", "test", "."]
+       * encoded = [0.1, 0.2, 0.3, 0.4, 0.5]
+       * ```
+       * 
+ * + * COMBINED_EMBEDDING = 5; + */ + COMBINED_EMBEDDING(5), + /** + * + * + *
+       * Select this encoding when the input tensor is encoded into a
+       * 2-dimensional array represented by an encoded tensor.
+       * [InputMetadata.encoded_tensor_name][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoded_tensor_name]
+       * must be provided for this encoding. The first dimension of the encoded
+       * tensor's shape is the same as the input tensor's shape. For example:
+       * ```
+       * input = ["This", "is", "a", "test", "."]
+       * encoded = [[0.1, 0.2, 0.3, 0.4, 0.5],
+       *            [0.2, 0.1, 0.4, 0.3, 0.5],
+       *            [0.5, 0.1, 0.3, 0.5, 0.4],
+       *            [0.5, 0.3, 0.1, 0.2, 0.4],
+       *            [0.4, 0.3, 0.2, 0.5, 0.1]]
+       * ```
+       * 
+ * + * CONCAT_EMBEDDING = 6; + */ + CONCAT_EMBEDDING(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value. This is the same as IDENTITY.
+       * 
+ * + * ENCODING_UNSPECIFIED = 0; + */ + public static final int ENCODING_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The tensor represents one feature.
+       * 
+ * + * IDENTITY = 1; + */ + public static final int IDENTITY_VALUE = 1; + /** + * + * + *
+       * The tensor represents a bag of features where each index maps to
+       * a feature.
+       * [InputMetadata.index_feature_mapping][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping]
+       * must be provided for this encoding. For example:
+       * ```
+       * input = [27, 6.0, 150]
+       * index_feature_mapping = ["age", "height", "weight"]
+       * ```
+       * 
+ * + * BAG_OF_FEATURES = 2; + */ + public static final int BAG_OF_FEATURES_VALUE = 2; + /** + * + * + *
+       * The tensor represents a bag of features where each index maps to a
+       * feature. Zero values in the tensor indicates feature being
+       * non-existent.
+       * [InputMetadata.index_feature_mapping][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping]
+       * must be provided for this encoding. For example:
+       * ```
+       * input = [2, 0, 5, 0, 1]
+       * index_feature_mapping = ["a", "b", "c", "d", "e"]
+       * ```
+       * 
+ * + * BAG_OF_FEATURES_SPARSE = 3; + */ + public static final int BAG_OF_FEATURES_SPARSE_VALUE = 3; + /** + * + * + *
+       * The tensor is a list of binaries representing whether a feature exists
+       * or not (1 indicates existence).
+       * [InputMetadata.index_feature_mapping][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping]
+       * must be provided for this encoding. For example:
+       * ```
+       * input = [1, 0, 1, 0, 1]
+       * index_feature_mapping = ["a", "b", "c", "d", "e"]
+       * ```
+       * 
+ * + * INDICATOR = 4; + */ + public static final int INDICATOR_VALUE = 4; + /** + * + * + *
+       * The tensor is encoded into a 1-dimensional array represented by an
+       * encoded tensor.
+       * [InputMetadata.encoded_tensor_name][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoded_tensor_name]
+       * must be provided for this encoding. For example:
+       * ```
+       * input = ["This", "is", "a", "test", "."]
+       * encoded = [0.1, 0.2, 0.3, 0.4, 0.5]
+       * ```
+       * 
+ * + * COMBINED_EMBEDDING = 5; + */ + public static final int COMBINED_EMBEDDING_VALUE = 5; + /** + * + * + *
+       * Select this encoding when the input tensor is encoded into a
+       * 2-dimensional array represented by an encoded tensor.
+       * [InputMetadata.encoded_tensor_name][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoded_tensor_name]
+       * must be provided for this encoding. The first dimension of the encoded
+       * tensor's shape is the same as the input tensor's shape. For example:
+       * ```
+       * input = ["This", "is", "a", "test", "."]
+       * encoded = [[0.1, 0.2, 0.3, 0.4, 0.5],
+       *            [0.2, 0.1, 0.4, 0.3, 0.5],
+       *            [0.5, 0.1, 0.3, 0.5, 0.4],
+       *            [0.5, 0.3, 0.1, 0.2, 0.4],
+       *            [0.4, 0.3, 0.2, 0.5, 0.1]]
+       * ```
+       * 
+ * + * CONCAT_EMBEDDING = 6; + */ + public static final int CONCAT_EMBEDDING_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Encoding valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Encoding forNumber(int value) { + switch (value) { + case 0: + return ENCODING_UNSPECIFIED; + case 1: + return IDENTITY; + case 2: + return BAG_OF_FEATURES; + case 3: + return BAG_OF_FEATURES_SPARSE; + case 4: + return INDICATOR; + case 5: + return COMBINED_EMBEDDING; + case 6: + return CONCAT_EMBEDDING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Encoding findValueByNumber(int number) { + return Encoding.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Encoding[] VALUES = values(); + + public static Encoding valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Encoding(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding) + } + + public interface FeatureValueDomainOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The minimum permissible value for this feature.
+       * 
+ * + * float min_value = 1; + * + * @return The minValue. + */ + float getMinValue(); + + /** + * + * + *
+       * The maximum permissible value for this feature.
+       * 
+ * + * float max_value = 2; + * + * @return The maxValue. + */ + float getMaxValue(); + + /** + * + * + *
+       * If this input feature has been normalized to a mean value of 0,
+       * the original_mean specifies the mean value of the domain prior to
+       * normalization.
+       * 
+ * + * float original_mean = 3; + * + * @return The originalMean. + */ + float getOriginalMean(); + + /** + * + * + *
+       * If this input feature has been normalized to a standard deviation of
+       * 1.0, the original_stddev specifies the standard deviation of the domain
+       * prior to normalization.
+       * 
+ * + * float original_stddev = 4; + * + * @return The originalStddev. + */ + float getOriginalStddev(); + } + /** + * + * + *
+     * Domain details of the input feature value. Provides numeric information
+     * about the feature, such as its range (min, max). If the feature has been
+     * pre-processed, for example with z-scoring, then it provides information
+     * about how to recover the original feature. For example, if the input
+     * feature is an image and it has been pre-processed to obtain 0-mean and
+     * stddev = 1 values, then original_mean, and original_stddev refer to the
+     * mean and stddev of the original feature (e.g. image tensor) from which
+     * input feature (with mean = 0 and stddev = 1) was obtained.
+     * 
+ * + * Protobuf type {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain} + */ + public static final class FeatureValueDomain extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain) + FeatureValueDomainOrBuilder { + private static final long serialVersionUID = 0L; + // Use FeatureValueDomain.newBuilder() to construct. + private FeatureValueDomain(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FeatureValueDomain() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FeatureValueDomain(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_FeatureValueDomain_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_FeatureValueDomain_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .class, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .Builder.class); + } + + public static final int MIN_VALUE_FIELD_NUMBER = 1; + private float minValue_ = 0F; + /** + * + * + *
+       * The minimum permissible value for this feature.
+       * 
+ * + * float min_value = 1; + * + * @return The minValue. + */ + @java.lang.Override + public float getMinValue() { + return minValue_; + } + + public static final int MAX_VALUE_FIELD_NUMBER = 2; + private float maxValue_ = 0F; + /** + * + * + *
+       * The maximum permissible value for this feature.
+       * 
+ * + * float max_value = 2; + * + * @return The maxValue. + */ + @java.lang.Override + public float getMaxValue() { + return maxValue_; + } + + public static final int ORIGINAL_MEAN_FIELD_NUMBER = 3; + private float originalMean_ = 0F; + /** + * + * + *
+       * If this input feature has been normalized to a mean value of 0,
+       * the original_mean specifies the mean value of the domain prior to
+       * normalization.
+       * 
+ * + * float original_mean = 3; + * + * @return The originalMean. + */ + @java.lang.Override + public float getOriginalMean() { + return originalMean_; + } + + public static final int ORIGINAL_STDDEV_FIELD_NUMBER = 4; + private float originalStddev_ = 0F; + /** + * + * + *
+       * If this input feature has been normalized to a standard deviation of
+       * 1.0, the original_stddev specifies the standard deviation of the domain
+       * prior to normalization.
+       * 
+ * + * float original_stddev = 4; + * + * @return The originalStddev. + */ + @java.lang.Override + public float getOriginalStddev() { + return originalStddev_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(minValue_) != 0) { + output.writeFloat(1, minValue_); + } + if (java.lang.Float.floatToRawIntBits(maxValue_) != 0) { + output.writeFloat(2, maxValue_); + } + if (java.lang.Float.floatToRawIntBits(originalMean_) != 0) { + output.writeFloat(3, originalMean_); + } + if (java.lang.Float.floatToRawIntBits(originalStddev_) != 0) { + output.writeFloat(4, originalStddev_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(minValue_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, minValue_); + } + if (java.lang.Float.floatToRawIntBits(maxValue_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, maxValue_); + } + if (java.lang.Float.floatToRawIntBits(originalMean_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, originalMean_); + } + if (java.lang.Float.floatToRawIntBits(originalStddev_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, originalStddev_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain other = + (com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain) + obj; + + if (java.lang.Float.floatToIntBits(getMinValue()) + != java.lang.Float.floatToIntBits(other.getMinValue())) return false; + if (java.lang.Float.floatToIntBits(getMaxValue()) + != java.lang.Float.floatToIntBits(other.getMaxValue())) return false; + if (java.lang.Float.floatToIntBits(getOriginalMean()) + != java.lang.Float.floatToIntBits(other.getOriginalMean())) return false; + if (java.lang.Float.floatToIntBits(getOriginalStddev()) + != java.lang.Float.floatToIntBits(other.getOriginalStddev())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MIN_VALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMinValue()); + hash = (37 * hash) + MAX_VALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMaxValue()); + hash = (37 * hash) + ORIGINAL_MEAN_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getOriginalMean()); + hash = (37 * hash) + ORIGINAL_STDDEV_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getOriginalStddev()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Domain details of the input feature value. Provides numeric information
+       * about the feature, such as its range (min, max). If the feature has been
+       * pre-processed, for example with z-scoring, then it provides information
+       * about how to recover the original feature. For example, if the input
+       * feature is an image and it has been pre-processed to obtain 0-mean and
+       * stddev = 1 values, then original_mean, and original_stddev refer to the
+       * mean and stddev of the original feature (e.g. image tensor) from which
+       * input feature (with mean = 0 and stddev = 1) was obtained.
+       * 
+ * + * Protobuf type {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain) + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomainOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_FeatureValueDomain_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_FeatureValueDomain_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .class, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minValue_ = 0F; + maxValue_ = 0F; + originalMean_ = 0F; + originalStddev_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_FeatureValueDomain_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + build() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + buildPartial() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + result = + new com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minValue_ = minValue_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxValue_ = maxValue_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.originalMean_ = originalMean_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.originalStddev_ = originalStddev_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain) { + return mergeFrom( + (com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + other) { + if (other + == com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .getDefaultInstance()) return this; + if (other.getMinValue() != 0F) { + setMinValue(other.getMinValue()); + } + if (other.getMaxValue() != 0F) { + setMaxValue(other.getMaxValue()); + } + if (other.getOriginalMean() != 0F) { + setOriginalMean(other.getOriginalMean()); + } + if (other.getOriginalStddev() != 0F) { + setOriginalStddev(other.getOriginalStddev()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + minValue_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 21: + { + maxValue_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: + { + originalMean_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 37: + { + originalStddev_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float minValue_; + /** + * + * + *
+         * The minimum permissible value for this feature.
+         * 
+ * + * float min_value = 1; + * + * @return The minValue. + */ + @java.lang.Override + public float getMinValue() { + return minValue_; + } + /** + * + * + *
+         * The minimum permissible value for this feature.
+         * 
+ * + * float min_value = 1; + * + * @param value The minValue to set. + * @return This builder for chaining. + */ + public Builder setMinValue(float value) { + + minValue_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The minimum permissible value for this feature.
+         * 
+ * + * float min_value = 1; + * + * @return This builder for chaining. + */ + public Builder clearMinValue() { + bitField0_ = (bitField0_ & ~0x00000001); + minValue_ = 0F; + onChanged(); + return this; + } + + private float maxValue_; + /** + * + * + *
+         * The maximum permissible value for this feature.
+         * 
+ * + * float max_value = 2; + * + * @return The maxValue. + */ + @java.lang.Override + public float getMaxValue() { + return maxValue_; + } + /** + * + * + *
+         * The maximum permissible value for this feature.
+         * 
+ * + * float max_value = 2; + * + * @param value The maxValue to set. + * @return This builder for chaining. + */ + public Builder setMaxValue(float value) { + + maxValue_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * The maximum permissible value for this feature.
+         * 
+ * + * float max_value = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxValue() { + bitField0_ = (bitField0_ & ~0x00000002); + maxValue_ = 0F; + onChanged(); + return this; + } + + private float originalMean_; + /** + * + * + *
+         * If this input feature has been normalized to a mean value of 0,
+         * the original_mean specifies the mean value of the domain prior to
+         * normalization.
+         * 
+ * + * float original_mean = 3; + * + * @return The originalMean. + */ + @java.lang.Override + public float getOriginalMean() { + return originalMean_; + } + /** + * + * + *
+         * If this input feature has been normalized to a mean value of 0,
+         * the original_mean specifies the mean value of the domain prior to
+         * normalization.
+         * 
+ * + * float original_mean = 3; + * + * @param value The originalMean to set. + * @return This builder for chaining. + */ + public Builder setOriginalMean(float value) { + + originalMean_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * If this input feature has been normalized to a mean value of 0,
+         * the original_mean specifies the mean value of the domain prior to
+         * normalization.
+         * 
+ * + * float original_mean = 3; + * + * @return This builder for chaining. + */ + public Builder clearOriginalMean() { + bitField0_ = (bitField0_ & ~0x00000004); + originalMean_ = 0F; + onChanged(); + return this; + } + + private float originalStddev_; + /** + * + * + *
+         * If this input feature has been normalized to a standard deviation of
+         * 1.0, the original_stddev specifies the standard deviation of the domain
+         * prior to normalization.
+         * 
+ * + * float original_stddev = 4; + * + * @return The originalStddev. + */ + @java.lang.Override + public float getOriginalStddev() { + return originalStddev_; + } + /** + * + * + *
+         * If this input feature has been normalized to a standard deviation of
+         * 1.0, the original_stddev specifies the standard deviation of the domain
+         * prior to normalization.
+         * 
+ * + * float original_stddev = 4; + * + * @param value The originalStddev to set. + * @return This builder for chaining. + */ + public Builder setOriginalStddev(float value) { + + originalStddev_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * If this input feature has been normalized to a standard deviation of
+         * 1.0, the original_stddev specifies the standard deviation of the domain
+         * prior to normalization.
+         * 
+ * + * float original_stddev = 4; + * + * @return This builder for chaining. + */ + public Builder clearOriginalStddev() { + bitField0_ = (bitField0_ & ~0x00000008); + originalStddev_ = 0F; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain) + private static final com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain(); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FeatureValueDomain parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface VisualizationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Type of the image visualization. Only applicable to
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution].
+       * OUTLINES shows regions of attribution, while PIXELS shows per-pixel
+       * attribution. Defaults to OUTLINES.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type type = 1; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+       * Type of the image visualization. Only applicable to
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution].
+       * OUTLINES shows regions of attribution, while PIXELS shows per-pixel
+       * attribution. Defaults to OUTLINES.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type type = 1; + * + * + * @return The type. + */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type getType(); + + /** + * + * + *
+       * Whether to only highlight pixels with positive contributions, negative
+       * or both. Defaults to POSITIVE.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity polarity = 2; + * + * + * @return The enum numeric value on the wire for polarity. + */ + int getPolarityValue(); + /** + * + * + *
+       * Whether to only highlight pixels with positive contributions, negative
+       * or both. Defaults to POSITIVE.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity polarity = 2; + * + * + * @return The polarity. + */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Polarity + getPolarity(); + + /** + * + * + *
+       * The color scheme used for the highlighted areas.
+       *
+       * Defaults to PINK_GREEN for
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+       * which shows positive attributions in green and negative in pink.
+       *
+       * Defaults to VIRIDIS for
+       * [XRAI
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+       * which highlights the most influential regions in yellow and the least
+       * influential in blue.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap color_map = 3; + * + * + * @return The enum numeric value on the wire for colorMap. + */ + int getColorMapValue(); + /** + * + * + *
+       * The color scheme used for the highlighted areas.
+       *
+       * Defaults to PINK_GREEN for
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+       * which shows positive attributions in green and negative in pink.
+       *
+       * Defaults to VIRIDIS for
+       * [XRAI
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+       * which highlights the most influential regions in yellow and the least
+       * influential in blue.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap color_map = 3; + * + * + * @return The colorMap. + */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.ColorMap + getColorMap(); + + /** + * + * + *
+       * Excludes attributions above the specified percentile from the
+       * highlighted areas. Using the clip_percent_upperbound and
+       * clip_percent_lowerbound together can be useful for filtering out noise
+       * and making it easier to see areas of strong attribution. Defaults to
+       * 99.9.
+       * 
+ * + * float clip_percent_upperbound = 4; + * + * @return The clipPercentUpperbound. + */ + float getClipPercentUpperbound(); + + /** + * + * + *
+       * Excludes attributions below the specified percentile, from the
+       * highlighted areas. Defaults to 62.
+       * 
+ * + * float clip_percent_lowerbound = 5; + * + * @return The clipPercentLowerbound. + */ + float getClipPercentLowerbound(); + + /** + * + * + *
+       * How the original image is displayed in the visualization.
+       * Adjusting the overlay can help increase visual clarity if the original
+       * image makes it difficult to view the visualization. Defaults to NONE.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType overlay_type = 6; + * + * + * @return The enum numeric value on the wire for overlayType. + */ + int getOverlayTypeValue(); + /** + * + * + *
+       * How the original image is displayed in the visualization.
+       * Adjusting the overlay can help increase visual clarity if the original
+       * image makes it difficult to view the visualization. Defaults to NONE.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType overlay_type = 6; + * + * + * @return The overlayType. + */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.OverlayType + getOverlayType(); + } + /** + * + * + *
+     * Visualization configurations for image explanation.
+     * 
+ * + * Protobuf type {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization} + */ + public static final class Visualization extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization) + VisualizationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Visualization.newBuilder() to construct. + private Visualization(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Visualization() { + type_ = 0; + polarity_ = 0; + colorMap_ = 0; + overlayType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Visualization(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_Visualization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_Visualization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.class, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .Builder.class); + } + + /** + * + * + *
+       * Type of the image visualization. Only applicable to
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution].
+       * 
+ * + * Protobuf enum {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Should not be used.
+         * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+         * Shows which pixel contributed to the image prediction.
+         * 
+ * + * PIXELS = 1; + */ + PIXELS(1), + /** + * + * + *
+         * Shows which region contributed to the image prediction by outlining
+         * the region.
+         * 
+ * + * OUTLINES = 2; + */ + OUTLINES(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Should not be used.
+         * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+         * Shows which pixel contributed to the image prediction.
+         * 
+ * + * PIXELS = 1; + */ + public static final int PIXELS_VALUE = 1; + /** + * + * + *
+         * Shows which region contributed to the image prediction by outlining
+         * the region.
+         * 
+ * + * OUTLINES = 2; + */ + public static final int OUTLINES_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return PIXELS; + case 2: + return OUTLINES; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type) + } + + /** + * + * + *
+       * Whether to only highlight pixels with positive contributions, negative
+       * or both. Defaults to POSITIVE.
+       * 
+ * + * Protobuf enum {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity} + */ + public enum Polarity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Default value. This is the same as POSITIVE.
+         * 
+ * + * POLARITY_UNSPECIFIED = 0; + */ + POLARITY_UNSPECIFIED(0), + /** + * + * + *
+         * Highlights the pixels/outlines that were most influential to the
+         * model's prediction.
+         * 
+ * + * POSITIVE = 1; + */ + POSITIVE(1), + /** + * + * + *
+         * Setting polarity to negative highlights areas that does not lead to
+         * the models's current prediction.
+         * 
+ * + * NEGATIVE = 2; + */ + NEGATIVE(2), + /** + * + * + *
+         * Shows both positive and negative attributions.
+         * 
+ * + * BOTH = 3; + */ + BOTH(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Default value. This is the same as POSITIVE.
+         * 
+ * + * POLARITY_UNSPECIFIED = 0; + */ + public static final int POLARITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+         * Highlights the pixels/outlines that were most influential to the
+         * model's prediction.
+         * 
+ * + * POSITIVE = 1; + */ + public static final int POSITIVE_VALUE = 1; + /** + * + * + *
+         * Setting polarity to negative highlights areas that does not lead to
+         * the models's current prediction.
+         * 
+ * + * NEGATIVE = 2; + */ + public static final int NEGATIVE_VALUE = 2; + /** + * + * + *
+         * Shows both positive and negative attributions.
+         * 
+ * + * BOTH = 3; + */ + public static final int BOTH_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Polarity valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Polarity forNumber(int value) { + switch (value) { + case 0: + return POLARITY_UNSPECIFIED; + case 1: + return POSITIVE; + case 2: + return NEGATIVE; + case 3: + return BOTH; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Polarity findValueByNumber(int number) { + return Polarity.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final Polarity[] VALUES = values(); + + public static Polarity valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Polarity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity) + } + + /** + * + * + *
+       * The color scheme used for highlighting areas.
+       * 
+ * + * Protobuf enum {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap} + */ + public enum ColorMap implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Should not be used.
+         * 
+ * + * COLOR_MAP_UNSPECIFIED = 0; + */ + COLOR_MAP_UNSPECIFIED(0), + /** + * + * + *
+         * Positive: green. Negative: pink.
+         * 
+ * + * PINK_GREEN = 1; + */ + PINK_GREEN(1), + /** + * + * + *
+         * Viridis color map: A perceptually uniform color mapping which is
+         * easier to see by those with colorblindness and progresses from yellow
+         * to green to blue. Positive: yellow. Negative: blue.
+         * 
+ * + * VIRIDIS = 2; + */ + VIRIDIS(2), + /** + * + * + *
+         * Positive: red. Negative: red.
+         * 
+ * + * RED = 3; + */ + RED(3), + /** + * + * + *
+         * Positive: green. Negative: green.
+         * 
+ * + * GREEN = 4; + */ + GREEN(4), + /** + * + * + *
+         * Positive: green. Negative: red.
+         * 
+ * + * RED_GREEN = 6; + */ + RED_GREEN(6), + /** + * + * + *
+         * PiYG palette.
+         * 
+ * + * PINK_WHITE_GREEN = 5; + */ + PINK_WHITE_GREEN(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Should not be used.
+         * 
+ * + * COLOR_MAP_UNSPECIFIED = 0; + */ + public static final int COLOR_MAP_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+         * Positive: green. Negative: pink.
+         * 
+ * + * PINK_GREEN = 1; + */ + public static final int PINK_GREEN_VALUE = 1; + /** + * + * + *
+         * Viridis color map: A perceptually uniform color mapping which is
+         * easier to see by those with colorblindness and progresses from yellow
+         * to green to blue. Positive: yellow. Negative: blue.
+         * 
+ * + * VIRIDIS = 2; + */ + public static final int VIRIDIS_VALUE = 2; + /** + * + * + *
+         * Positive: red. Negative: red.
+         * 
+ * + * RED = 3; + */ + public static final int RED_VALUE = 3; + /** + * + * + *
+         * Positive: green. Negative: green.
+         * 
+ * + * GREEN = 4; + */ + public static final int GREEN_VALUE = 4; + /** + * + * + *
+         * Positive: green. Negative: red.
+         * 
+ * + * RED_GREEN = 6; + */ + public static final int RED_GREEN_VALUE = 6; + /** + * + * + *
+         * PiYG palette.
+         * 
+ * + * PINK_WHITE_GREEN = 5; + */ + public static final int PINK_WHITE_GREEN_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ColorMap valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ColorMap forNumber(int value) { + switch (value) { + case 0: + return COLOR_MAP_UNSPECIFIED; + case 1: + return PINK_GREEN; + case 2: + return VIRIDIS; + case 3: + return RED; + case 4: + return GREEN; + case 6: + return RED_GREEN; + case 5: + return PINK_WHITE_GREEN; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ColorMap findValueByNumber(int number) { + return ColorMap.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDescriptor() + .getEnumTypes() + .get(2); + } + + private static final ColorMap[] VALUES = values(); + + public static ColorMap valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ColorMap(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap) + } + + /** + * + * + *
+       * How the original image is displayed in the visualization.
+       * 
+ * + * Protobuf enum {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType} + */ + public enum OverlayType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Default value. This is the same as NONE.
+         * 
+ * + * OVERLAY_TYPE_UNSPECIFIED = 0; + */ + OVERLAY_TYPE_UNSPECIFIED(0), + /** + * + * + *
+         * No overlay.
+         * 
+ * + * NONE = 1; + */ + NONE(1), + /** + * + * + *
+         * The attributions are shown on top of the original image.
+         * 
+ * + * ORIGINAL = 2; + */ + ORIGINAL(2), + /** + * + * + *
+         * The attributions are shown on top of grayscaled version of the
+         * original image.
+         * 
+ * + * GRAYSCALE = 3; + */ + GRAYSCALE(3), + /** + * + * + *
+         * The attributions are used as a mask to reveal predictive parts of
+         * the image and hide the un-predictive parts.
+         * 
+ * + * MASK_BLACK = 4; + */ + MASK_BLACK(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Default value. This is the same as NONE.
+         * 
+ * + * OVERLAY_TYPE_UNSPECIFIED = 0; + */ + public static final int OVERLAY_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+         * No overlay.
+         * 
+ * + * NONE = 1; + */ + public static final int NONE_VALUE = 1; + /** + * + * + *
+         * The attributions are shown on top of the original image.
+         * 
+ * + * ORIGINAL = 2; + */ + public static final int ORIGINAL_VALUE = 2; + /** + * + * + *
+         * The attributions are shown on top of grayscaled version of the
+         * original image.
+         * 
+ * + * GRAYSCALE = 3; + */ + public static final int GRAYSCALE_VALUE = 3; + /** + * + * + *
+         * The attributions are used as a mask to reveal predictive parts of
+         * the image and hide the un-predictive parts.
+         * 
+ * + * MASK_BLACK = 4; + */ + public static final int MASK_BLACK_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OverlayType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static OverlayType forNumber(int value) { + switch (value) { + case 0: + return OVERLAY_TYPE_UNSPECIFIED; + case 1: + return NONE; + case 2: + return ORIGINAL; + case 3: + return GRAYSCALE; + case 4: + return MASK_BLACK; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public OverlayType findValueByNumber(int number) { + return OverlayType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDescriptor() + .getEnumTypes() + .get(3); + } + + private static final OverlayType[] VALUES = values(); + + public static OverlayType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private OverlayType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + /** + * + * + *
+       * Type of the image visualization. Only applicable to
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution].
+       * OUTLINES shows regions of attribution, while PIXELS shows per-pixel
+       * attribution. Defaults to OUTLINES.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type type = 1; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+       * Type of the image visualization. Only applicable to
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution].
+       * OUTLINES shows regions of attribution, while PIXELS shows per-pixel
+       * attribution. Defaults to OUTLINES.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type type = 1; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type + getType() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type result = + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type + .forNumber(type_); + return result == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type + .UNRECOGNIZED + : result; + } + + public static final int POLARITY_FIELD_NUMBER = 2; + private int polarity_ = 0; + /** + * + * + *
+       * Whether to only highlight pixels with positive contributions, negative
+       * or both. Defaults to POSITIVE.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity polarity = 2; + * + * + * @return The enum numeric value on the wire for polarity. + */ + @java.lang.Override + public int getPolarityValue() { + return polarity_; + } + /** + * + * + *
+       * Whether to only highlight pixels with positive contributions, negative
+       * or both. Defaults to POSITIVE.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity polarity = 2; + * + * + * @return The polarity. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Polarity + getPolarity() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Polarity + result = + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .Polarity.forNumber(polarity_); + return result == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Polarity + .UNRECOGNIZED + : result; + } + + public static final int COLOR_MAP_FIELD_NUMBER = 3; + private int colorMap_ = 0; + /** + * + * + *
+       * The color scheme used for the highlighted areas.
+       *
+       * Defaults to PINK_GREEN for
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+       * which shows positive attributions in green and negative in pink.
+       *
+       * Defaults to VIRIDIS for
+       * [XRAI
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+       * which highlights the most influential regions in yellow and the least
+       * influential in blue.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap color_map = 3; + * + * + * @return The enum numeric value on the wire for colorMap. + */ + @java.lang.Override + public int getColorMapValue() { + return colorMap_; + } + /** + * + * + *
+       * The color scheme used for the highlighted areas.
+       *
+       * Defaults to PINK_GREEN for
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+       * which shows positive attributions in green and negative in pink.
+       *
+       * Defaults to VIRIDIS for
+       * [XRAI
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+       * which highlights the most influential regions in yellow and the least
+       * influential in blue.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap color_map = 3; + * + * + * @return The colorMap. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.ColorMap + getColorMap() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.ColorMap + result = + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .ColorMap.forNumber(colorMap_); + return result == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.ColorMap + .UNRECOGNIZED + : result; + } + + public static final int CLIP_PERCENT_UPPERBOUND_FIELD_NUMBER = 4; + private float clipPercentUpperbound_ = 0F; + /** + * + * + *
+       * Excludes attributions above the specified percentile from the
+       * highlighted areas. Using the clip_percent_upperbound and
+       * clip_percent_lowerbound together can be useful for filtering out noise
+       * and making it easier to see areas of strong attribution. Defaults to
+       * 99.9.
+       * 
+ * + * float clip_percent_upperbound = 4; + * + * @return The clipPercentUpperbound. + */ + @java.lang.Override + public float getClipPercentUpperbound() { + return clipPercentUpperbound_; + } + + public static final int CLIP_PERCENT_LOWERBOUND_FIELD_NUMBER = 5; + private float clipPercentLowerbound_ = 0F; + /** + * + * + *
+       * Excludes attributions below the specified percentile, from the
+       * highlighted areas. Defaults to 62.
+       * 
+ * + * float clip_percent_lowerbound = 5; + * + * @return The clipPercentLowerbound. + */ + @java.lang.Override + public float getClipPercentLowerbound() { + return clipPercentLowerbound_; + } + + public static final int OVERLAY_TYPE_FIELD_NUMBER = 6; + private int overlayType_ = 0; + /** + * + * + *
+       * How the original image is displayed in the visualization.
+       * Adjusting the overlay can help increase visual clarity if the original
+       * image makes it difficult to view the visualization. Defaults to NONE.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType overlay_type = 6; + * + * + * @return The enum numeric value on the wire for overlayType. + */ + @java.lang.Override + public int getOverlayTypeValue() { + return overlayType_; + } + /** + * + * + *
+       * How the original image is displayed in the visualization.
+       * Adjusting the overlay can help increase visual clarity if the original
+       * image makes it difficult to view the visualization. Defaults to NONE.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType overlay_type = 6; + * + * + * @return The overlayType. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .OverlayType + getOverlayType() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.OverlayType + result = + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .OverlayType.forNumber(overlayType_); + return result == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .OverlayType.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type + .TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, type_); + } + if (polarity_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .Polarity.POLARITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, polarity_); + } + if (colorMap_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .ColorMap.COLOR_MAP_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, colorMap_); + } + if (java.lang.Float.floatToRawIntBits(clipPercentUpperbound_) != 0) { + output.writeFloat(4, clipPercentUpperbound_); + } + if (java.lang.Float.floatToRawIntBits(clipPercentLowerbound_) != 0) { + output.writeFloat(5, clipPercentLowerbound_); + } + if (overlayType_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .OverlayType.OVERLAY_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, overlayType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type + .TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (polarity_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .Polarity.POLARITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, polarity_); + } + if (colorMap_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .ColorMap.COLOR_MAP_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, colorMap_); + } + if (java.lang.Float.floatToRawIntBits(clipPercentUpperbound_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, clipPercentUpperbound_); + } + if (java.lang.Float.floatToRawIntBits(clipPercentLowerbound_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, clipPercentLowerbound_); + } + if (overlayType_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .OverlayType.OVERLAY_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, overlayType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization other = + (com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization) obj; + + if (type_ != other.type_) return false; + if (polarity_ != other.polarity_) return false; + if (colorMap_ != other.colorMap_) return false; + if (java.lang.Float.floatToIntBits(getClipPercentUpperbound()) + != java.lang.Float.floatToIntBits(other.getClipPercentUpperbound())) return false; + if (java.lang.Float.floatToIntBits(getClipPercentLowerbound()) + != java.lang.Float.floatToIntBits(other.getClipPercentLowerbound())) return false; + if (overlayType_ != other.overlayType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + POLARITY_FIELD_NUMBER; + hash = (53 * hash) + polarity_; + hash = (37 * hash) + COLOR_MAP_FIELD_NUMBER; + hash = (53 * hash) + colorMap_; + hash = (37 * hash) + CLIP_PERCENT_UPPERBOUND_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getClipPercentUpperbound()); + hash = (37 * hash) + CLIP_PERCENT_LOWERBOUND_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getClipPercentLowerbound()); + hash = (37 * hash) + OVERLAY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + overlayType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Visualization configurations for image explanation.
+       * 
+ * + * Protobuf type {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization) + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.VisualizationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_Visualization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_Visualization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .class, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + polarity_ = 0; + colorMap_ = 0; + clipPercentUpperbound_ = 0F; + clipPercentLowerbound_ = 0F; + overlayType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_Visualization_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + build() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + buildPartial() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization result = + new com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.polarity_ = polarity_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.colorMap_ = colorMap_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clipPercentUpperbound_ = clipPercentUpperbound_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.clipPercentLowerbound_ = clipPercentLowerbound_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.overlayType_ = overlayType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization) { + return mergeFrom( + (com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization other) { + if (other + == com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.polarity_ != 0) { + setPolarityValue(other.getPolarityValue()); + } + if (other.colorMap_ != 0) { + setColorMapValue(other.getColorMapValue()); + } + if (other.getClipPercentUpperbound() != 0F) { + setClipPercentUpperbound(other.getClipPercentUpperbound()); + } + if (other.getClipPercentLowerbound() != 0F) { + setClipPercentLowerbound(other.getClipPercentLowerbound()); + } + if (other.overlayType_ != 0) { + setOverlayTypeValue(other.getOverlayTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + polarity_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + colorMap_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 37: + { + clipPercentUpperbound_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + case 45: + { + clipPercentLowerbound_ = input.readFloat(); + bitField0_ |= 0x00000010; + break; + } // case 45 + case 48: + { + overlayType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int type_ = 0; + /** + * + * + *
+         * Type of the image visualization. Only applicable to
+         * [Integrated Gradients
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution].
+         * OUTLINES shows regions of attribution, while PIXELS shows per-pixel
+         * attribution. Defaults to OUTLINES.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type type = 1; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+         * Type of the image visualization. Only applicable to
+         * [Integrated Gradients
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution].
+         * OUTLINES shows regions of attribution, while PIXELS shows per-pixel
+         * attribution. Defaults to OUTLINES.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type type = 1; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Type of the image visualization. Only applicable to
+         * [Integrated Gradients
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution].
+         * OUTLINES shows regions of attribution, while PIXELS shows per-pixel
+         * attribution. Defaults to OUTLINES.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type type = 1; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type + getType() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type + result = + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type + .forNumber(type_); + return result == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type + .UNRECOGNIZED + : result; + } + /** + * + * + *
+         * Type of the image visualization. Only applicable to
+         * [Integrated Gradients
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution].
+         * OUTLINES shows regions of attribution, while PIXELS shows per-pixel
+         * attribution. Defaults to OUTLINES.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type type = 1; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Type + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * Type of the image visualization. Only applicable to
+         * [Integrated Gradients
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution].
+         * OUTLINES shows regions of attribution, while PIXELS shows per-pixel
+         * attribution. Defaults to OUTLINES.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Type type = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private int polarity_ = 0; + /** + * + * + *
+         * Whether to only highlight pixels with positive contributions, negative
+         * or both. Defaults to POSITIVE.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity polarity = 2; + * + * + * @return The enum numeric value on the wire for polarity. + */ + @java.lang.Override + public int getPolarityValue() { + return polarity_; + } + /** + * + * + *
+         * Whether to only highlight pixels with positive contributions, negative
+         * or both. Defaults to POSITIVE.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity polarity = 2; + * + * + * @param value The enum numeric value on the wire for polarity to set. + * @return This builder for chaining. + */ + public Builder setPolarityValue(int value) { + polarity_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Whether to only highlight pixels with positive contributions, negative
+         * or both. Defaults to POSITIVE.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity polarity = 2; + * + * + * @return The polarity. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .Polarity + getPolarity() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Polarity + result = + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .Polarity.forNumber(polarity_); + return result == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .Polarity.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * Whether to only highlight pixels with positive contributions, negative
+         * or both. Defaults to POSITIVE.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity polarity = 2; + * + * + * @param value The polarity to set. + * @return This builder for chaining. + */ + public Builder setPolarity( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Polarity + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + polarity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * Whether to only highlight pixels with positive contributions, negative
+         * or both. Defaults to POSITIVE.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.Polarity polarity = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearPolarity() { + bitField0_ = (bitField0_ & ~0x00000002); + polarity_ = 0; + onChanged(); + return this; + } + + private int colorMap_ = 0; + /** + * + * + *
+         * The color scheme used for the highlighted areas.
+         *
+         * Defaults to PINK_GREEN for
+         * [Integrated Gradients
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+         * which shows positive attributions in green and negative in pink.
+         *
+         * Defaults to VIRIDIS for
+         * [XRAI
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+         * which highlights the most influential regions in yellow and the least
+         * influential in blue.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap color_map = 3; + * + * + * @return The enum numeric value on the wire for colorMap. + */ + @java.lang.Override + public int getColorMapValue() { + return colorMap_; + } + /** + * + * + *
+         * The color scheme used for the highlighted areas.
+         *
+         * Defaults to PINK_GREEN for
+         * [Integrated Gradients
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+         * which shows positive attributions in green and negative in pink.
+         *
+         * Defaults to VIRIDIS for
+         * [XRAI
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+         * which highlights the most influential regions in yellow and the least
+         * influential in blue.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap color_map = 3; + * + * + * @param value The enum numeric value on the wire for colorMap to set. + * @return This builder for chaining. + */ + public Builder setColorMapValue(int value) { + colorMap_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * The color scheme used for the highlighted areas.
+         *
+         * Defaults to PINK_GREEN for
+         * [Integrated Gradients
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+         * which shows positive attributions in green and negative in pink.
+         *
+         * Defaults to VIRIDIS for
+         * [XRAI
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+         * which highlights the most influential regions in yellow and the least
+         * influential in blue.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap color_map = 3; + * + * + * @return The colorMap. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .ColorMap + getColorMap() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.ColorMap + result = + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .ColorMap.forNumber(colorMap_); + return result == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .ColorMap.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * The color scheme used for the highlighted areas.
+         *
+         * Defaults to PINK_GREEN for
+         * [Integrated Gradients
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+         * which shows positive attributions in green and negative in pink.
+         *
+         * Defaults to VIRIDIS for
+         * [XRAI
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+         * which highlights the most influential regions in yellow and the least
+         * influential in blue.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap color_map = 3; + * + * + * @param value The colorMap to set. + * @return This builder for chaining. + */ + public Builder setColorMap( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.ColorMap + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + colorMap_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * The color scheme used for the highlighted areas.
+         *
+         * Defaults to PINK_GREEN for
+         * [Integrated Gradients
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution],
+         * which shows positive attributions in green and negative in pink.
+         *
+         * Defaults to VIRIDIS for
+         * [XRAI
+         * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution],
+         * which highlights the most influential regions in yellow and the least
+         * influential in blue.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.ColorMap color_map = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearColorMap() { + bitField0_ = (bitField0_ & ~0x00000004); + colorMap_ = 0; + onChanged(); + return this; + } + + private float clipPercentUpperbound_; + /** + * + * + *
+         * Excludes attributions above the specified percentile from the
+         * highlighted areas. Using the clip_percent_upperbound and
+         * clip_percent_lowerbound together can be useful for filtering out noise
+         * and making it easier to see areas of strong attribution. Defaults to
+         * 99.9.
+         * 
+ * + * float clip_percent_upperbound = 4; + * + * @return The clipPercentUpperbound. + */ + @java.lang.Override + public float getClipPercentUpperbound() { + return clipPercentUpperbound_; + } + /** + * + * + *
+         * Excludes attributions above the specified percentile from the
+         * highlighted areas. Using the clip_percent_upperbound and
+         * clip_percent_lowerbound together can be useful for filtering out noise
+         * and making it easier to see areas of strong attribution. Defaults to
+         * 99.9.
+         * 
+ * + * float clip_percent_upperbound = 4; + * + * @param value The clipPercentUpperbound to set. + * @return This builder for chaining. + */ + public Builder setClipPercentUpperbound(float value) { + + clipPercentUpperbound_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Excludes attributions above the specified percentile from the
+         * highlighted areas. Using the clip_percent_upperbound and
+         * clip_percent_lowerbound together can be useful for filtering out noise
+         * and making it easier to see areas of strong attribution. Defaults to
+         * 99.9.
+         * 
+ * + * float clip_percent_upperbound = 4; + * + * @return This builder for chaining. + */ + public Builder clearClipPercentUpperbound() { + bitField0_ = (bitField0_ & ~0x00000008); + clipPercentUpperbound_ = 0F; + onChanged(); + return this; + } + + private float clipPercentLowerbound_; + /** + * + * + *
+         * Excludes attributions below the specified percentile, from the
+         * highlighted areas. Defaults to 62.
+         * 
+ * + * float clip_percent_lowerbound = 5; + * + * @return The clipPercentLowerbound. + */ + @java.lang.Override + public float getClipPercentLowerbound() { + return clipPercentLowerbound_; + } + /** + * + * + *
+         * Excludes attributions below the specified percentile, from the
+         * highlighted areas. Defaults to 62.
+         * 
+ * + * float clip_percent_lowerbound = 5; + * + * @param value The clipPercentLowerbound to set. + * @return This builder for chaining. + */ + public Builder setClipPercentLowerbound(float value) { + + clipPercentLowerbound_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Excludes attributions below the specified percentile, from the
+         * highlighted areas. Defaults to 62.
+         * 
+ * + * float clip_percent_lowerbound = 5; + * + * @return This builder for chaining. + */ + public Builder clearClipPercentLowerbound() { + bitField0_ = (bitField0_ & ~0x00000010); + clipPercentLowerbound_ = 0F; + onChanged(); + return this; + } + + private int overlayType_ = 0; + /** + * + * + *
+         * How the original image is displayed in the visualization.
+         * Adjusting the overlay can help increase visual clarity if the original
+         * image makes it difficult to view the visualization. Defaults to NONE.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType overlay_type = 6; + * + * + * @return The enum numeric value on the wire for overlayType. + */ + @java.lang.Override + public int getOverlayTypeValue() { + return overlayType_; + } + /** + * + * + *
+         * How the original image is displayed in the visualization.
+         * Adjusting the overlay can help increase visual clarity if the original
+         * image makes it difficult to view the visualization. Defaults to NONE.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType overlay_type = 6; + * + * + * @param value The enum numeric value on the wire for overlayType to set. + * @return This builder for chaining. + */ + public Builder setOverlayTypeValue(int value) { + overlayType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+         * How the original image is displayed in the visualization.
+         * Adjusting the overlay can help increase visual clarity if the original
+         * image makes it difficult to view the visualization. Defaults to NONE.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType overlay_type = 6; + * + * + * @return The overlayType. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .OverlayType + getOverlayType() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.OverlayType + result = + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .OverlayType.forNumber(overlayType_); + return result == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .OverlayType.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * How the original image is displayed in the visualization.
+         * Adjusting the overlay can help increase visual clarity if the original
+         * image makes it difficult to view the visualization. Defaults to NONE.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType overlay_type = 6; + * + * + * @param value The overlayType to set. + * @return This builder for chaining. + */ + public Builder setOverlayType( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .OverlayType + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + overlayType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * How the original image is displayed in the visualization.
+         * Adjusting the overlay can help increase visual clarity if the original
+         * image makes it difficult to view the visualization. Defaults to NONE.
+         * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization.OverlayType overlay_type = 6; + * + * + * @return This builder for chaining. + */ + public Builder clearOverlayType() { + bitField0_ = (bitField0_ & ~0x00000020); + overlayType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization) + private static final com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .Visualization + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization(); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Visualization parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int INPUT_BASELINES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List inputBaselines_; + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * If no baseline is specified, Vertex AI chooses the baseline for this
+     * feature. If multiple baselines are specified, Vertex AI returns the
+     * average attributions across them in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     *
+     * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+     * of each baseline must match the shape of the input tensor. If a scalar is
+     * provided, we broadcast to the same shape as the input tensor.
+     *
+     * For custom images, the element of the baselines must be in the same
+     * format as the feature's input in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+     * 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].
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + @java.lang.Override + public java.util.List getInputBaselinesList() { + return inputBaselines_; + } + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * If no baseline is specified, Vertex AI chooses the baseline for this
+     * feature. If multiple baselines are specified, Vertex AI returns the
+     * average attributions across them in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     *
+     * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+     * of each baseline must match the shape of the input tensor. If a scalar is
+     * provided, we broadcast to the same shape as the input tensor.
+     *
+     * For custom images, the element of the baselines must be in the same
+     * format as the feature's input in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+     * 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].
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + @java.lang.Override + public java.util.List + getInputBaselinesOrBuilderList() { + return inputBaselines_; + } + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * If no baseline is specified, Vertex AI chooses the baseline for this
+     * feature. If multiple baselines are specified, Vertex AI returns the
+     * average attributions across them in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     *
+     * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+     * of each baseline must match the shape of the input tensor. If a scalar is
+     * provided, we broadcast to the same shape as the input tensor.
+     *
+     * For custom images, the element of the baselines must be in the same
+     * format as the feature's input in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+     * 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].
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + @java.lang.Override + public int getInputBaselinesCount() { + return inputBaselines_.size(); + } + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * If no baseline is specified, Vertex AI chooses the baseline for this
+     * feature. If multiple baselines are specified, Vertex AI returns the
+     * average attributions across them in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     *
+     * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+     * of each baseline must match the shape of the input tensor. If a scalar is
+     * provided, we broadcast to the same shape as the input tensor.
+     *
+     * For custom images, the element of the baselines must be in the same
+     * format as the feature's input in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+     * 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].
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + @java.lang.Override + public com.google.protobuf.Value getInputBaselines(int index) { + return inputBaselines_.get(index); + } + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * If no baseline is specified, Vertex AI chooses the baseline for this
+     * feature. If multiple baselines are specified, Vertex AI returns the
+     * average attributions across them in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     *
+     * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+     * of each baseline must match the shape of the input tensor. If a scalar is
+     * provided, we broadcast to the same shape as the input tensor.
+     *
+     * For custom images, the element of the baselines must be in the same
+     * format as the feature's input in the
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+     * 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].
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getInputBaselinesOrBuilder(int index) { + return inputBaselines_.get(index); + } + + public static final int INPUT_TENSOR_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object inputTensorName_ = ""; + /** + * + * + *
+     * Name of the input tensor for this feature. Required and is only
+     * applicable to Vertex AI-provided images for Tensorflow.
+     * 
+ * + * string input_tensor_name = 2; + * + * @return The inputTensorName. + */ + @java.lang.Override + public java.lang.String getInputTensorName() { + java.lang.Object ref = inputTensorName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputTensorName_ = s; + return s; + } + } + /** + * + * + *
+     * Name of the input tensor for this feature. Required and is only
+     * applicable to Vertex AI-provided images for Tensorflow.
+     * 
+ * + * string input_tensor_name = 2; + * + * @return The bytes for inputTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInputTensorNameBytes() { + java.lang.Object ref = inputTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENCODING_FIELD_NUMBER = 3; + private int encoding_ = 0; + /** + * + * + *
+     * Defines how the feature is encoded into the input tensor. Defaults to
+     * IDENTITY.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding encoding = 3; + * + * + * @return The enum numeric value on the wire for encoding. + */ + @java.lang.Override + public int getEncodingValue() { + return encoding_; + } + /** + * + * + *
+     * Defines how the feature is encoded into the input tensor. Defaults to
+     * IDENTITY.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding encoding = 3; + * + * + * @return The encoding. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding getEncoding() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding result = + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding.forNumber( + encoding_); + return result == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding.UNRECOGNIZED + : result; + } + + public static final int MODALITY_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object modality_ = ""; + /** + * + * + *
+     * Modality of the feature. Valid values are: numeric, image. Defaults to
+     * numeric.
+     * 
+ * + * string modality = 4; + * + * @return The modality. + */ + @java.lang.Override + public java.lang.String getModality() { + java.lang.Object ref = modality_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modality_ = s; + return s; + } + } + /** + * + * + *
+     * Modality of the feature. Valid values are: numeric, image. Defaults to
+     * numeric.
+     * 
+ * + * string modality = 4; + * + * @return The bytes for modality. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModalityBytes() { + java.lang.Object ref = modality_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modality_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FEATURE_VALUE_DOMAIN_FIELD_NUMBER = 5; + private com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + featureValueDomain_; + /** + * + * + *
+     * The domain details of the input feature value. Like min/max, original
+     * mean or standard deviation if normalized.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + * + * @return Whether the featureValueDomain field is set. + */ + @java.lang.Override + public boolean hasFeatureValueDomain() { + return featureValueDomain_ != null; + } + /** + * + * + *
+     * The domain details of the input feature value. Like min/max, original
+     * mean or standard deviation if normalized.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + * + * @return The featureValueDomain. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + getFeatureValueDomain() { + return featureValueDomain_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .getDefaultInstance() + : featureValueDomain_; + } + /** + * + * + *
+     * The domain details of the input feature value. Like min/max, original
+     * mean or standard deviation if normalized.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomainOrBuilder + getFeatureValueDomainOrBuilder() { + return featureValueDomain_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .getDefaultInstance() + : featureValueDomain_; + } + + public static final int INDICES_TENSOR_NAME_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object indicesTensorName_ = ""; + /** + * + * + *
+     * Specifies the index of the values of the input tensor.
+     * Required when the input tensor is a sparse representation. Refer to
+     * Tensorflow documentation for more details:
+     * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+     * 
+ * + * string indices_tensor_name = 6; + * + * @return The indicesTensorName. + */ + @java.lang.Override + public java.lang.String getIndicesTensorName() { + java.lang.Object ref = indicesTensorName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + indicesTensorName_ = s; + return s; + } + } + /** + * + * + *
+     * Specifies the index of the values of the input tensor.
+     * Required when the input tensor is a sparse representation. Refer to
+     * Tensorflow documentation for more details:
+     * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+     * 
+ * + * string indices_tensor_name = 6; + * + * @return The bytes for indicesTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIndicesTensorNameBytes() { + java.lang.Object ref = indicesTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indicesTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DENSE_SHAPE_TENSOR_NAME_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object denseShapeTensorName_ = ""; + /** + * + * + *
+     * Specifies the shape of the values of the input if the input is a sparse
+     * representation. Refer to Tensorflow documentation for more details:
+     * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+     * 
+ * + * string dense_shape_tensor_name = 7; + * + * @return The denseShapeTensorName. + */ + @java.lang.Override + public java.lang.String getDenseShapeTensorName() { + java.lang.Object ref = denseShapeTensorName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + denseShapeTensorName_ = s; + return s; + } + } + /** + * + * + *
+     * Specifies the shape of the values of the input if the input is a sparse
+     * representation. Refer to Tensorflow documentation for more details:
+     * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+     * 
+ * + * string dense_shape_tensor_name = 7; + * + * @return The bytes for denseShapeTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDenseShapeTensorNameBytes() { + java.lang.Object ref = denseShapeTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + denseShapeTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_FEATURE_MAPPING_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList indexFeatureMapping_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * A list of feature names for each index in the input tensor.
+     * Required when the input
+     * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+     * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+     * 
+ * + * repeated string index_feature_mapping = 8; + * + * @return A list containing the indexFeatureMapping. + */ + public com.google.protobuf.ProtocolStringList getIndexFeatureMappingList() { + return indexFeatureMapping_; + } + /** + * + * + *
+     * A list of feature names for each index in the input tensor.
+     * Required when the input
+     * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+     * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+     * 
+ * + * repeated string index_feature_mapping = 8; + * + * @return The count of indexFeatureMapping. + */ + public int getIndexFeatureMappingCount() { + return indexFeatureMapping_.size(); + } + /** + * + * + *
+     * A list of feature names for each index in the input tensor.
+     * Required when the input
+     * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+     * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+     * 
+ * + * repeated string index_feature_mapping = 8; + * + * @param index The index of the element to return. + * @return The indexFeatureMapping at the given index. + */ + public java.lang.String getIndexFeatureMapping(int index) { + return indexFeatureMapping_.get(index); + } + /** + * + * + *
+     * A list of feature names for each index in the input tensor.
+     * Required when the input
+     * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+     * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+     * 
+ * + * repeated string index_feature_mapping = 8; + * + * @param index The index of the value to return. + * @return The bytes of the indexFeatureMapping at the given index. + */ + public com.google.protobuf.ByteString getIndexFeatureMappingBytes(int index) { + return indexFeatureMapping_.getByteString(index); + } + + public static final int ENCODED_TENSOR_NAME_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object encodedTensorName_ = ""; + /** + * + * + *
+     * Encoded tensor is a transformation of the input tensor. Must be provided
+     * if choosing
+     * [Integrated Gradients
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]
+     * or [XRAI
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution]
+     * and the input tensor is not differentiable.
+     *
+     * An encoded tensor is generated if the input tensor is encoded by a lookup
+     * table.
+     * 
+ * + * string encoded_tensor_name = 9; + * + * @return The encodedTensorName. + */ + @java.lang.Override + public java.lang.String getEncodedTensorName() { + java.lang.Object ref = encodedTensorName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + encodedTensorName_ = s; + return s; + } + } + /** + * + * + *
+     * Encoded tensor is a transformation of the input tensor. Must be provided
+     * if choosing
+     * [Integrated Gradients
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]
+     * or [XRAI
+     * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution]
+     * and the input tensor is not differentiable.
+     *
+     * An encoded tensor is generated if the input tensor is encoded by a lookup
+     * table.
+     * 
+ * + * string encoded_tensor_name = 9; + * + * @return The bytes for encodedTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncodedTensorNameBytes() { + java.lang.Object ref = encodedTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + encodedTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENCODED_BASELINES_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private java.util.List encodedBaselines_; + /** + * + * + *
+     * A list of baselines for the encoded tensor.
+     *
+     * The shape of each baseline should match the shape of the encoded tensor.
+     * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+     * encoded tensor.
+     * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + @java.lang.Override + public java.util.List getEncodedBaselinesList() { + return encodedBaselines_; + } + /** + * + * + *
+     * A list of baselines for the encoded tensor.
+     *
+     * The shape of each baseline should match the shape of the encoded tensor.
+     * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+     * encoded tensor.
+     * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + @java.lang.Override + public java.util.List + getEncodedBaselinesOrBuilderList() { + return encodedBaselines_; + } + /** + * + * + *
+     * A list of baselines for the encoded tensor.
+     *
+     * The shape of each baseline should match the shape of the encoded tensor.
+     * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+     * encoded tensor.
+     * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + @java.lang.Override + public int getEncodedBaselinesCount() { + return encodedBaselines_.size(); + } + /** + * + * + *
+     * A list of baselines for the encoded tensor.
+     *
+     * The shape of each baseline should match the shape of the encoded tensor.
+     * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+     * encoded tensor.
+     * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + @java.lang.Override + public com.google.protobuf.Value getEncodedBaselines(int index) { + return encodedBaselines_.get(index); + } + /** + * + * + *
+     * A list of baselines for the encoded tensor.
+     *
+     * The shape of each baseline should match the shape of the encoded tensor.
+     * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+     * encoded tensor.
+     * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getEncodedBaselinesOrBuilder(int index) { + return encodedBaselines_.get(index); + } + + public static final int VISUALIZATION_FIELD_NUMBER = 11; + private com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + visualization_; + /** + * + * + *
+     * Visualization configurations for image explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + * + * @return Whether the visualization field is set. + */ + @java.lang.Override + public boolean hasVisualization() { + return visualization_ != null; + } + /** + * + * + *
+     * Visualization configurations for image explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + * + * @return The visualization. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + getVisualization() { + return visualization_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDefaultInstance() + : visualization_; + } + /** + * + * + *
+     * Visualization configurations for image explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.VisualizationOrBuilder + getVisualizationOrBuilder() { + return visualization_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDefaultInstance() + : visualization_; + } + + public static final int GROUP_NAME_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object groupName_ = ""; + /** + * + * + *
+     * Name of the group that the input belongs to. Features with the same group
+     * name will be treated as one feature when computing attributions. Features
+     * grouped together can have different shapes in value. If provided, there
+     * will be one single attribution generated in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions],
+     * keyed by the group name.
+     * 
+ * + * string group_name = 12; + * + * @return The groupName. + */ + @java.lang.Override + public java.lang.String getGroupName() { + java.lang.Object ref = groupName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + groupName_ = s; + return s; + } + } + /** + * + * + *
+     * Name of the group that the input belongs to. Features with the same group
+     * name will be treated as one feature when computing attributions. Features
+     * grouped together can have different shapes in value. If provided, there
+     * will be one single attribution generated in
+     * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions],
+     * keyed by the group name.
+     * 
+ * + * string group_name = 12; + * + * @return The bytes for groupName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGroupNameBytes() { + java.lang.Object ref = groupName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < inputBaselines_.size(); i++) { + output.writeMessage(1, inputBaselines_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputTensorName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, inputTensorName_); + } + if (encoding_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding + .ENCODING_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, encoding_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modality_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, modality_); + } + if (featureValueDomain_ != null) { + output.writeMessage(5, getFeatureValueDomain()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(indicesTensorName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, indicesTensorName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(denseShapeTensorName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, denseShapeTensorName_); + } + for (int i = 0; i < indexFeatureMapping_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 8, indexFeatureMapping_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(encodedTensorName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, encodedTensorName_); + } + for (int i = 0; i < encodedBaselines_.size(); i++) { + output.writeMessage(10, encodedBaselines_.get(i)); + } + if (visualization_ != null) { + output.writeMessage(11, getVisualization()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(groupName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, groupName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < inputBaselines_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, inputBaselines_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputTensorName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, inputTensorName_); + } + if (encoding_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding + .ENCODING_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, encoding_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modality_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, modality_); + } + if (featureValueDomain_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getFeatureValueDomain()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(indicesTensorName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, indicesTensorName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(denseShapeTensorName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, denseShapeTensorName_); + } + { + int dataSize = 0; + for (int i = 0; i < indexFeatureMapping_.size(); i++) { + dataSize += computeStringSizeNoTag(indexFeatureMapping_.getRaw(i)); + } + size += dataSize; + size += 1 * getIndexFeatureMappingList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(encodedTensorName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, encodedTensorName_); + } + for (int i = 0; i < encodedBaselines_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(10, encodedBaselines_.get(i)); + } + if (visualization_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getVisualization()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(groupName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, groupName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata other = + (com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata) obj; + + if (!getInputBaselinesList().equals(other.getInputBaselinesList())) return false; + if (!getInputTensorName().equals(other.getInputTensorName())) return false; + if (encoding_ != other.encoding_) return false; + if (!getModality().equals(other.getModality())) return false; + if (hasFeatureValueDomain() != other.hasFeatureValueDomain()) return false; + if (hasFeatureValueDomain()) { + if (!getFeatureValueDomain().equals(other.getFeatureValueDomain())) return false; + } + if (!getIndicesTensorName().equals(other.getIndicesTensorName())) return false; + if (!getDenseShapeTensorName().equals(other.getDenseShapeTensorName())) return false; + if (!getIndexFeatureMappingList().equals(other.getIndexFeatureMappingList())) return false; + if (!getEncodedTensorName().equals(other.getEncodedTensorName())) return false; + if (!getEncodedBaselinesList().equals(other.getEncodedBaselinesList())) return false; + if (hasVisualization() != other.hasVisualization()) return false; + if (hasVisualization()) { + if (!getVisualization().equals(other.getVisualization())) return false; + } + if (!getGroupName().equals(other.getGroupName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInputBaselinesCount() > 0) { + hash = (37 * hash) + INPUT_BASELINES_FIELD_NUMBER; + hash = (53 * hash) + getInputBaselinesList().hashCode(); + } + hash = (37 * hash) + INPUT_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getInputTensorName().hashCode(); + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + encoding_; + hash = (37 * hash) + MODALITY_FIELD_NUMBER; + hash = (53 * hash) + getModality().hashCode(); + if (hasFeatureValueDomain()) { + hash = (37 * hash) + FEATURE_VALUE_DOMAIN_FIELD_NUMBER; + hash = (53 * hash) + getFeatureValueDomain().hashCode(); + } + hash = (37 * hash) + INDICES_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getIndicesTensorName().hashCode(); + hash = (37 * hash) + DENSE_SHAPE_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDenseShapeTensorName().hashCode(); + if (getIndexFeatureMappingCount() > 0) { + hash = (37 * hash) + INDEX_FEATURE_MAPPING_FIELD_NUMBER; + hash = (53 * hash) + getIndexFeatureMappingList().hashCode(); + } + hash = (37 * hash) + ENCODED_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getEncodedTensorName().hashCode(); + if (getEncodedBaselinesCount() > 0) { + hash = (37 * hash) + ENCODED_BASELINES_FIELD_NUMBER; + hash = (53 * hash) + getEncodedBaselinesList().hashCode(); + } + if (hasVisualization()) { + hash = (37 * hash) + VISUALIZATION_FIELD_NUMBER; + hash = (53 * hash) + getVisualization().hashCode(); + } + hash = (37 * hash) + GROUP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getGroupName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Metadata of the input of a feature.
+     *
+     * Fields other than
+     * [InputMetadata.input_baselines][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.input_baselines]
+     * are applicable only for Models that are using Vertex AI-provided images for
+     * Tensorflow.
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata) + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.class, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (inputBaselinesBuilder_ == null) { + inputBaselines_ = java.util.Collections.emptyList(); + } else { + inputBaselines_ = null; + inputBaselinesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + inputTensorName_ = ""; + encoding_ = 0; + modality_ = ""; + featureValueDomain_ = null; + if (featureValueDomainBuilder_ != null) { + featureValueDomainBuilder_.dispose(); + featureValueDomainBuilder_ = null; + } + indicesTensorName_ = ""; + denseShapeTensorName_ = ""; + indexFeatureMapping_ = com.google.protobuf.LazyStringArrayList.emptyList(); + encodedTensorName_ = ""; + if (encodedBaselinesBuilder_ == null) { + encodedBaselines_ = java.util.Collections.emptyList(); + } else { + encodedBaselines_ = null; + encodedBaselinesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + visualization_ = null; + if (visualizationBuilder_ != null) { + visualizationBuilder_.dispose(); + visualizationBuilder_ = null; + } + groupName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata build() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata buildPartial() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata result = + new com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata result) { + if (inputBaselinesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + inputBaselines_ = java.util.Collections.unmodifiableList(inputBaselines_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.inputBaselines_ = inputBaselines_; + } else { + result.inputBaselines_ = inputBaselinesBuilder_.build(); + } + if (encodedBaselinesBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + encodedBaselines_ = java.util.Collections.unmodifiableList(encodedBaselines_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.encodedBaselines_ = encodedBaselines_; + } else { + result.encodedBaselines_ = encodedBaselinesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.inputTensorName_ = inputTensorName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.encoding_ = encoding_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.modality_ = modality_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.featureValueDomain_ = + featureValueDomainBuilder_ == null + ? featureValueDomain_ + : featureValueDomainBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.indicesTensorName_ = indicesTensorName_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.denseShapeTensorName_ = denseShapeTensorName_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + indexFeatureMapping_.makeImmutable(); + result.indexFeatureMapping_ = indexFeatureMapping_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.encodedTensorName_ = encodedTensorName_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.visualization_ = + visualizationBuilder_ == null ? visualization_ : visualizationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.groupName_ = groupName_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata) { + return mergeFrom((com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata other) { + if (other + == com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.getDefaultInstance()) + return this; + if (inputBaselinesBuilder_ == null) { + if (!other.inputBaselines_.isEmpty()) { + if (inputBaselines_.isEmpty()) { + inputBaselines_ = other.inputBaselines_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInputBaselinesIsMutable(); + inputBaselines_.addAll(other.inputBaselines_); + } + onChanged(); + } + } else { + if (!other.inputBaselines_.isEmpty()) { + if (inputBaselinesBuilder_.isEmpty()) { + inputBaselinesBuilder_.dispose(); + inputBaselinesBuilder_ = null; + inputBaselines_ = other.inputBaselines_; + bitField0_ = (bitField0_ & ~0x00000001); + inputBaselinesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInputBaselinesFieldBuilder() + : null; + } else { + inputBaselinesBuilder_.addAllMessages(other.inputBaselines_); + } + } + } + if (!other.getInputTensorName().isEmpty()) { + inputTensorName_ = other.inputTensorName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.encoding_ != 0) { + setEncodingValue(other.getEncodingValue()); + } + if (!other.getModality().isEmpty()) { + modality_ = other.modality_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasFeatureValueDomain()) { + mergeFeatureValueDomain(other.getFeatureValueDomain()); + } + if (!other.getIndicesTensorName().isEmpty()) { + indicesTensorName_ = other.indicesTensorName_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getDenseShapeTensorName().isEmpty()) { + denseShapeTensorName_ = other.denseShapeTensorName_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.indexFeatureMapping_.isEmpty()) { + if (indexFeatureMapping_.isEmpty()) { + indexFeatureMapping_ = other.indexFeatureMapping_; + bitField0_ |= 0x00000080; + } else { + ensureIndexFeatureMappingIsMutable(); + indexFeatureMapping_.addAll(other.indexFeatureMapping_); + } + onChanged(); + } + if (!other.getEncodedTensorName().isEmpty()) { + encodedTensorName_ = other.encodedTensorName_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (encodedBaselinesBuilder_ == null) { + if (!other.encodedBaselines_.isEmpty()) { + if (encodedBaselines_.isEmpty()) { + encodedBaselines_ = other.encodedBaselines_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureEncodedBaselinesIsMutable(); + encodedBaselines_.addAll(other.encodedBaselines_); + } + onChanged(); + } + } else { + if (!other.encodedBaselines_.isEmpty()) { + if (encodedBaselinesBuilder_.isEmpty()) { + encodedBaselinesBuilder_.dispose(); + encodedBaselinesBuilder_ = null; + encodedBaselines_ = other.encodedBaselines_; + bitField0_ = (bitField0_ & ~0x00000200); + encodedBaselinesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEncodedBaselinesFieldBuilder() + : null; + } else { + encodedBaselinesBuilder_.addAllMessages(other.encodedBaselines_); + } + } + } + if (other.hasVisualization()) { + mergeVisualization(other.getVisualization()); + } + if (!other.getGroupName().isEmpty()) { + groupName_ = other.groupName_; + bitField0_ |= 0x00000800; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Value m = + input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + inputBaselines_.add(m); + } else { + inputBaselinesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + inputTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + encoding_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + modality_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + getFeatureValueDomainFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + indicesTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + denseShapeTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureIndexFeatureMappingIsMutable(); + indexFeatureMapping_.add(s); + break; + } // case 66 + case 74: + { + encodedTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + com.google.protobuf.Value m = + input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (encodedBaselinesBuilder_ == null) { + ensureEncodedBaselinesIsMutable(); + encodedBaselines_.add(m); + } else { + encodedBaselinesBuilder_.addMessage(m); + } + break; + } // case 82 + case 90: + { + input.readMessage(getVisualizationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + groupName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List inputBaselines_ = + java.util.Collections.emptyList(); + + private void ensureInputBaselinesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + inputBaselines_ = new java.util.ArrayList(inputBaselines_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + inputBaselinesBuilder_; + + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public java.util.List getInputBaselinesList() { + if (inputBaselinesBuilder_ == null) { + return java.util.Collections.unmodifiableList(inputBaselines_); + } else { + return inputBaselinesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public int getInputBaselinesCount() { + if (inputBaselinesBuilder_ == null) { + return inputBaselines_.size(); + } else { + return inputBaselinesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public com.google.protobuf.Value getInputBaselines(int index) { + if (inputBaselinesBuilder_ == null) { + return inputBaselines_.get(index); + } else { + return inputBaselinesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder setInputBaselines(int index, com.google.protobuf.Value value) { + if (inputBaselinesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputBaselinesIsMutable(); + inputBaselines_.set(index, value); + onChanged(); + } else { + inputBaselinesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder setInputBaselines( + int index, com.google.protobuf.Value.Builder builderForValue) { + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + inputBaselines_.set(index, builderForValue.build()); + onChanged(); + } else { + inputBaselinesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder addInputBaselines(com.google.protobuf.Value value) { + if (inputBaselinesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputBaselinesIsMutable(); + inputBaselines_.add(value); + onChanged(); + } else { + inputBaselinesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder addInputBaselines(int index, com.google.protobuf.Value value) { + if (inputBaselinesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputBaselinesIsMutable(); + inputBaselines_.add(index, value); + onChanged(); + } else { + inputBaselinesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder addInputBaselines(com.google.protobuf.Value.Builder builderForValue) { + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + inputBaselines_.add(builderForValue.build()); + onChanged(); + } else { + inputBaselinesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder addInputBaselines( + int index, com.google.protobuf.Value.Builder builderForValue) { + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + inputBaselines_.add(index, builderForValue.build()); + onChanged(); + } else { + inputBaselinesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder addAllInputBaselines( + java.lang.Iterable values) { + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inputBaselines_); + onChanged(); + } else { + inputBaselinesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder clearInputBaselines() { + if (inputBaselinesBuilder_ == null) { + inputBaselines_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + inputBaselinesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder removeInputBaselines(int index) { + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + inputBaselines_.remove(index); + onChanged(); + } else { + inputBaselinesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public com.google.protobuf.Value.Builder getInputBaselinesBuilder(int index) { + return getInputBaselinesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public com.google.protobuf.ValueOrBuilder getInputBaselinesOrBuilder(int index) { + if (inputBaselinesBuilder_ == null) { + return inputBaselines_.get(index); + } else { + return inputBaselinesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public java.util.List + getInputBaselinesOrBuilderList() { + if (inputBaselinesBuilder_ != null) { + return inputBaselinesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inputBaselines_); + } + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public com.google.protobuf.Value.Builder addInputBaselinesBuilder() { + return getInputBaselinesFieldBuilder() + .addBuilder(com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public com.google.protobuf.Value.Builder addInputBaselinesBuilder(int index) { + return getInputBaselinesFieldBuilder() + .addBuilder(index, com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * If no baseline is specified, Vertex AI chooses the baseline for this
+       * feature. If multiple baselines are specified, Vertex AI returns the
+       * average attributions across them in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+       *
+       * For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape
+       * of each baseline must match the shape of the input tensor. If a scalar is
+       * provided, we broadcast to the same shape as the input tensor.
+       *
+       * For custom images, the element of the baselines must be in the same
+       * format as the feature's input in the
+       * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][].
+       * 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].
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public java.util.List getInputBaselinesBuilderList() { + return getInputBaselinesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getInputBaselinesFieldBuilder() { + if (inputBaselinesBuilder_ == null) { + inputBaselinesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + inputBaselines_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + inputBaselines_ = null; + } + return inputBaselinesBuilder_; + } + + private java.lang.Object inputTensorName_ = ""; + /** + * + * + *
+       * Name of the input tensor for this feature. Required and is only
+       * applicable to Vertex AI-provided images for Tensorflow.
+       * 
+ * + * string input_tensor_name = 2; + * + * @return The inputTensorName. + */ + public java.lang.String getInputTensorName() { + java.lang.Object ref = inputTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name of the input tensor for this feature. Required and is only
+       * applicable to Vertex AI-provided images for Tensorflow.
+       * 
+ * + * string input_tensor_name = 2; + * + * @return The bytes for inputTensorName. + */ + public com.google.protobuf.ByteString getInputTensorNameBytes() { + java.lang.Object ref = inputTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name of the input tensor for this feature. Required and is only
+       * applicable to Vertex AI-provided images for Tensorflow.
+       * 
+ * + * string input_tensor_name = 2; + * + * @param value The inputTensorName to set. + * @return This builder for chaining. + */ + public Builder setInputTensorName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + inputTensorName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the input tensor for this feature. Required and is only
+       * applicable to Vertex AI-provided images for Tensorflow.
+       * 
+ * + * string input_tensor_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearInputTensorName() { + inputTensorName_ = getDefaultInstance().getInputTensorName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the input tensor for this feature. Required and is only
+       * applicable to Vertex AI-provided images for Tensorflow.
+       * 
+ * + * string input_tensor_name = 2; + * + * @param value The bytes for inputTensorName to set. + * @return This builder for chaining. + */ + public Builder setInputTensorNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + inputTensorName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int encoding_ = 0; + /** + * + * + *
+       * Defines how the feature is encoded into the input tensor. Defaults to
+       * IDENTITY.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding encoding = 3; + * + * + * @return The enum numeric value on the wire for encoding. + */ + @java.lang.Override + public int getEncodingValue() { + return encoding_; + } + /** + * + * + *
+       * Defines how the feature is encoded into the input tensor. Defaults to
+       * IDENTITY.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding encoding = 3; + * + * + * @param value The enum numeric value on the wire for encoding to set. + * @return This builder for chaining. + */ + public Builder setEncodingValue(int value) { + encoding_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Defines how the feature is encoded into the input tensor. Defaults to
+       * IDENTITY.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding encoding = 3; + * + * + * @return The encoding. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding + getEncoding() { + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding result = + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding.forNumber( + encoding_); + return result == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Defines how the feature is encoded into the input tensor. Defaults to
+       * IDENTITY.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding encoding = 3; + * + * + * @param value The encoding to set. + * @return This builder for chaining. + */ + public Builder setEncoding( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Encoding value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + encoding_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Defines how the feature is encoded into the input tensor. Defaults to
+       * IDENTITY.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Encoding encoding = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearEncoding() { + bitField0_ = (bitField0_ & ~0x00000004); + encoding_ = 0; + onChanged(); + return this; + } + + private java.lang.Object modality_ = ""; + /** + * + * + *
+       * Modality of the feature. Valid values are: numeric, image. Defaults to
+       * numeric.
+       * 
+ * + * string modality = 4; + * + * @return The modality. + */ + public java.lang.String getModality() { + java.lang.Object ref = modality_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modality_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Modality of the feature. Valid values are: numeric, image. Defaults to
+       * numeric.
+       * 
+ * + * string modality = 4; + * + * @return The bytes for modality. + */ + public com.google.protobuf.ByteString getModalityBytes() { + java.lang.Object ref = modality_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modality_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Modality of the feature. Valid values are: numeric, image. Defaults to
+       * numeric.
+       * 
+ * + * string modality = 4; + * + * @param value The modality to set. + * @return This builder for chaining. + */ + public Builder setModality(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + modality_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Modality of the feature. Valid values are: numeric, image. Defaults to
+       * numeric.
+       * 
+ * + * string modality = 4; + * + * @return This builder for chaining. + */ + public Builder clearModality() { + modality_ = getDefaultInstance().getModality(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+       * Modality of the feature. Valid values are: numeric, image. Defaults to
+       * numeric.
+       * 
+ * + * string modality = 4; + * + * @param value The bytes for modality to set. + * @return This builder for chaining. + */ + public Builder setModalityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + modality_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + featureValueDomain_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .Builder, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomainOrBuilder> + featureValueDomainBuilder_; + /** + * + * + *
+       * The domain details of the input feature value. Like min/max, original
+       * mean or standard deviation if normalized.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + * + * @return Whether the featureValueDomain field is set. + */ + public boolean hasFeatureValueDomain() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+       * The domain details of the input feature value. Like min/max, original
+       * mean or standard deviation if normalized.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + * + * @return The featureValueDomain. + */ + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + getFeatureValueDomain() { + if (featureValueDomainBuilder_ == null) { + return featureValueDomain_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .getDefaultInstance() + : featureValueDomain_; + } else { + return featureValueDomainBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The domain details of the input feature value. Like min/max, original
+       * mean or standard deviation if normalized.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + */ + public Builder setFeatureValueDomain( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + value) { + if (featureValueDomainBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + featureValueDomain_ = value; + } else { + featureValueDomainBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The domain details of the input feature value. Like min/max, original
+       * mean or standard deviation if normalized.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + */ + public Builder setFeatureValueDomain( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain.Builder + builderForValue) { + if (featureValueDomainBuilder_ == null) { + featureValueDomain_ = builderForValue.build(); + } else { + featureValueDomainBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The domain details of the input feature value. Like min/max, original
+       * mean or standard deviation if normalized.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + */ + public Builder mergeFeatureValueDomain( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + value) { + if (featureValueDomainBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && featureValueDomain_ != null + && featureValueDomain_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain.getDefaultInstance()) { + getFeatureValueDomainBuilder().mergeFrom(value); + } else { + featureValueDomain_ = value; + } + } else { + featureValueDomainBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The domain details of the input feature value. Like min/max, original
+       * mean or standard deviation if normalized.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + */ + public Builder clearFeatureValueDomain() { + bitField0_ = (bitField0_ & ~0x00000010); + featureValueDomain_ = null; + if (featureValueDomainBuilder_ != null) { + featureValueDomainBuilder_.dispose(); + featureValueDomainBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The domain details of the input feature value. Like min/max, original
+       * mean or standard deviation if normalized.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + */ + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .Builder + getFeatureValueDomainBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getFeatureValueDomainFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The domain details of the input feature value. Like min/max, original
+       * mean or standard deviation if normalized.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + */ + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomainOrBuilder + getFeatureValueDomainOrBuilder() { + if (featureValueDomainBuilder_ != null) { + return featureValueDomainBuilder_.getMessageOrBuilder(); + } else { + return featureValueDomain_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .getDefaultInstance() + : featureValueDomain_; + } + } + /** + * + * + *
+       * The domain details of the input feature value. Like min/max, original
+       * mean or standard deviation if normalized.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.FeatureValueDomain feature_value_domain = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .Builder, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomainOrBuilder> + getFeatureValueDomainFieldBuilder() { + if (featureValueDomainBuilder_ == null) { + featureValueDomainBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomain, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.FeatureValueDomain + .Builder, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .FeatureValueDomainOrBuilder>( + getFeatureValueDomain(), getParentForChildren(), isClean()); + featureValueDomain_ = null; + } + return featureValueDomainBuilder_; + } + + private java.lang.Object indicesTensorName_ = ""; + /** + * + * + *
+       * Specifies the index of the values of the input tensor.
+       * Required when the input tensor is a sparse representation. Refer to
+       * Tensorflow documentation for more details:
+       * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+       * 
+ * + * string indices_tensor_name = 6; + * + * @return The indicesTensorName. + */ + public java.lang.String getIndicesTensorName() { + java.lang.Object ref = indicesTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + indicesTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Specifies the index of the values of the input tensor.
+       * Required when the input tensor is a sparse representation. Refer to
+       * Tensorflow documentation for more details:
+       * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+       * 
+ * + * string indices_tensor_name = 6; + * + * @return The bytes for indicesTensorName. + */ + public com.google.protobuf.ByteString getIndicesTensorNameBytes() { + java.lang.Object ref = indicesTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indicesTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Specifies the index of the values of the input tensor.
+       * Required when the input tensor is a sparse representation. Refer to
+       * Tensorflow documentation for more details:
+       * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+       * 
+ * + * string indices_tensor_name = 6; + * + * @param value The indicesTensorName to set. + * @return This builder for chaining. + */ + public Builder setIndicesTensorName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + indicesTensorName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the index of the values of the input tensor.
+       * Required when the input tensor is a sparse representation. Refer to
+       * Tensorflow documentation for more details:
+       * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+       * 
+ * + * string indices_tensor_name = 6; + * + * @return This builder for chaining. + */ + public Builder clearIndicesTensorName() { + indicesTensorName_ = getDefaultInstance().getIndicesTensorName(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the index of the values of the input tensor.
+       * Required when the input tensor is a sparse representation. Refer to
+       * Tensorflow documentation for more details:
+       * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+       * 
+ * + * string indices_tensor_name = 6; + * + * @param value The bytes for indicesTensorName to set. + * @return This builder for chaining. + */ + public Builder setIndicesTensorNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + indicesTensorName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object denseShapeTensorName_ = ""; + /** + * + * + *
+       * Specifies the shape of the values of the input if the input is a sparse
+       * representation. Refer to Tensorflow documentation for more details:
+       * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+       * 
+ * + * string dense_shape_tensor_name = 7; + * + * @return The denseShapeTensorName. + */ + public java.lang.String getDenseShapeTensorName() { + java.lang.Object ref = denseShapeTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + denseShapeTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Specifies the shape of the values of the input if the input is a sparse
+       * representation. Refer to Tensorflow documentation for more details:
+       * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+       * 
+ * + * string dense_shape_tensor_name = 7; + * + * @return The bytes for denseShapeTensorName. + */ + public com.google.protobuf.ByteString getDenseShapeTensorNameBytes() { + java.lang.Object ref = denseShapeTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + denseShapeTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Specifies the shape of the values of the input if the input is a sparse
+       * representation. Refer to Tensorflow documentation for more details:
+       * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+       * 
+ * + * string dense_shape_tensor_name = 7; + * + * @param value The denseShapeTensorName to set. + * @return This builder for chaining. + */ + public Builder setDenseShapeTensorName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + denseShapeTensorName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the shape of the values of the input if the input is a sparse
+       * representation. Refer to Tensorflow documentation for more details:
+       * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+       * 
+ * + * string dense_shape_tensor_name = 7; + * + * @return This builder for chaining. + */ + public Builder clearDenseShapeTensorName() { + denseShapeTensorName_ = getDefaultInstance().getDenseShapeTensorName(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies the shape of the values of the input if the input is a sparse
+       * representation. Refer to Tensorflow documentation for more details:
+       * https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor.
+       * 
+ * + * string dense_shape_tensor_name = 7; + * + * @param value The bytes for denseShapeTensorName to set. + * @return This builder for chaining. + */ + public Builder setDenseShapeTensorNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + denseShapeTensorName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList indexFeatureMapping_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureIndexFeatureMappingIsMutable() { + if (!indexFeatureMapping_.isModifiable()) { + indexFeatureMapping_ = new com.google.protobuf.LazyStringArrayList(indexFeatureMapping_); + } + bitField0_ |= 0x00000080; + } + /** + * + * + *
+       * A list of feature names for each index in the input tensor.
+       * Required when the input
+       * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+       * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+       * 
+ * + * repeated string index_feature_mapping = 8; + * + * @return A list containing the indexFeatureMapping. + */ + public com.google.protobuf.ProtocolStringList getIndexFeatureMappingList() { + indexFeatureMapping_.makeImmutable(); + return indexFeatureMapping_; + } + /** + * + * + *
+       * A list of feature names for each index in the input tensor.
+       * Required when the input
+       * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+       * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+       * 
+ * + * repeated string index_feature_mapping = 8; + * + * @return The count of indexFeatureMapping. + */ + public int getIndexFeatureMappingCount() { + return indexFeatureMapping_.size(); + } + /** + * + * + *
+       * A list of feature names for each index in the input tensor.
+       * Required when the input
+       * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+       * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+       * 
+ * + * repeated string index_feature_mapping = 8; + * + * @param index The index of the element to return. + * @return The indexFeatureMapping at the given index. + */ + public java.lang.String getIndexFeatureMapping(int index) { + return indexFeatureMapping_.get(index); + } + /** + * + * + *
+       * A list of feature names for each index in the input tensor.
+       * Required when the input
+       * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+       * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+       * 
+ * + * repeated string index_feature_mapping = 8; + * + * @param index The index of the value to return. + * @return The bytes of the indexFeatureMapping at the given index. + */ + public com.google.protobuf.ByteString getIndexFeatureMappingBytes(int index) { + return indexFeatureMapping_.getByteString(index); + } + /** + * + * + *
+       * A list of feature names for each index in the input tensor.
+       * Required when the input
+       * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+       * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+       * 
+ * + * repeated string index_feature_mapping = 8; + * + * @param index The index to set the value at. + * @param value The indexFeatureMapping to set. + * @return This builder for chaining. + */ + public Builder setIndexFeatureMapping(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexFeatureMappingIsMutable(); + indexFeatureMapping_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+       * A list of feature names for each index in the input tensor.
+       * Required when the input
+       * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+       * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+       * 
+ * + * repeated string index_feature_mapping = 8; + * + * @param value The indexFeatureMapping to add. + * @return This builder for chaining. + */ + public Builder addIndexFeatureMapping(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexFeatureMappingIsMutable(); + indexFeatureMapping_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+       * A list of feature names for each index in the input tensor.
+       * Required when the input
+       * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+       * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+       * 
+ * + * repeated string index_feature_mapping = 8; + * + * @param values The indexFeatureMapping to add. + * @return This builder for chaining. + */ + public Builder addAllIndexFeatureMapping(java.lang.Iterable values) { + ensureIndexFeatureMappingIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, indexFeatureMapping_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+       * A list of feature names for each index in the input tensor.
+       * Required when the input
+       * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+       * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+       * 
+ * + * repeated string index_feature_mapping = 8; + * + * @return This builder for chaining. + */ + public Builder clearIndexFeatureMapping() { + indexFeatureMapping_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * A list of feature names for each index in the input tensor.
+       * Required when the input
+       * [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding]
+       * is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR.
+       * 
+ * + * repeated string index_feature_mapping = 8; + * + * @param value The bytes of the indexFeatureMapping to add. + * @return This builder for chaining. + */ + public Builder addIndexFeatureMappingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIndexFeatureMappingIsMutable(); + indexFeatureMapping_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object encodedTensorName_ = ""; + /** + * + * + *
+       * Encoded tensor is a transformation of the input tensor. Must be provided
+       * if choosing
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]
+       * or [XRAI
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution]
+       * and the input tensor is not differentiable.
+       *
+       * An encoded tensor is generated if the input tensor is encoded by a lookup
+       * table.
+       * 
+ * + * string encoded_tensor_name = 9; + * + * @return The encodedTensorName. + */ + public java.lang.String getEncodedTensorName() { + java.lang.Object ref = encodedTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + encodedTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Encoded tensor is a transformation of the input tensor. Must be provided
+       * if choosing
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]
+       * or [XRAI
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution]
+       * and the input tensor is not differentiable.
+       *
+       * An encoded tensor is generated if the input tensor is encoded by a lookup
+       * table.
+       * 
+ * + * string encoded_tensor_name = 9; + * + * @return The bytes for encodedTensorName. + */ + public com.google.protobuf.ByteString getEncodedTensorNameBytes() { + java.lang.Object ref = encodedTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + encodedTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Encoded tensor is a transformation of the input tensor. Must be provided
+       * if choosing
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]
+       * or [XRAI
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution]
+       * and the input tensor is not differentiable.
+       *
+       * An encoded tensor is generated if the input tensor is encoded by a lookup
+       * table.
+       * 
+ * + * string encoded_tensor_name = 9; + * + * @param value The encodedTensorName to set. + * @return This builder for chaining. + */ + public Builder setEncodedTensorName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + encodedTensorName_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+       * Encoded tensor is a transformation of the input tensor. Must be provided
+       * if choosing
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]
+       * or [XRAI
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution]
+       * and the input tensor is not differentiable.
+       *
+       * An encoded tensor is generated if the input tensor is encoded by a lookup
+       * table.
+       * 
+ * + * string encoded_tensor_name = 9; + * + * @return This builder for chaining. + */ + public Builder clearEncodedTensorName() { + encodedTensorName_ = getDefaultInstance().getEncodedTensorName(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+       * Encoded tensor is a transformation of the input tensor. Must be provided
+       * if choosing
+       * [Integrated Gradients
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]
+       * or [XRAI
+       * attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution]
+       * and the input tensor is not differentiable.
+       *
+       * An encoded tensor is generated if the input tensor is encoded by a lookup
+       * table.
+       * 
+ * + * string encoded_tensor_name = 9; + * + * @param value The bytes for encodedTensorName to set. + * @return This builder for chaining. + */ + public Builder setEncodedTensorNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + encodedTensorName_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private java.util.List encodedBaselines_ = + java.util.Collections.emptyList(); + + private void ensureEncodedBaselinesIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + encodedBaselines_ = new java.util.ArrayList(encodedBaselines_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + encodedBaselinesBuilder_; + + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public java.util.List getEncodedBaselinesList() { + if (encodedBaselinesBuilder_ == null) { + return java.util.Collections.unmodifiableList(encodedBaselines_); + } else { + return encodedBaselinesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public int getEncodedBaselinesCount() { + if (encodedBaselinesBuilder_ == null) { + return encodedBaselines_.size(); + } else { + return encodedBaselinesBuilder_.getCount(); + } + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public com.google.protobuf.Value getEncodedBaselines(int index) { + if (encodedBaselinesBuilder_ == null) { + return encodedBaselines_.get(index); + } else { + return encodedBaselinesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public Builder setEncodedBaselines(int index, com.google.protobuf.Value value) { + if (encodedBaselinesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEncodedBaselinesIsMutable(); + encodedBaselines_.set(index, value); + onChanged(); + } else { + encodedBaselinesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public Builder setEncodedBaselines( + int index, com.google.protobuf.Value.Builder builderForValue) { + if (encodedBaselinesBuilder_ == null) { + ensureEncodedBaselinesIsMutable(); + encodedBaselines_.set(index, builderForValue.build()); + onChanged(); + } else { + encodedBaselinesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public Builder addEncodedBaselines(com.google.protobuf.Value value) { + if (encodedBaselinesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEncodedBaselinesIsMutable(); + encodedBaselines_.add(value); + onChanged(); + } else { + encodedBaselinesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public Builder addEncodedBaselines(int index, com.google.protobuf.Value value) { + if (encodedBaselinesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEncodedBaselinesIsMutable(); + encodedBaselines_.add(index, value); + onChanged(); + } else { + encodedBaselinesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public Builder addEncodedBaselines(com.google.protobuf.Value.Builder builderForValue) { + if (encodedBaselinesBuilder_ == null) { + ensureEncodedBaselinesIsMutable(); + encodedBaselines_.add(builderForValue.build()); + onChanged(); + } else { + encodedBaselinesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public Builder addEncodedBaselines( + int index, com.google.protobuf.Value.Builder builderForValue) { + if (encodedBaselinesBuilder_ == null) { + ensureEncodedBaselinesIsMutable(); + encodedBaselines_.add(index, builderForValue.build()); + onChanged(); + } else { + encodedBaselinesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public Builder addAllEncodedBaselines( + java.lang.Iterable values) { + if (encodedBaselinesBuilder_ == null) { + ensureEncodedBaselinesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, encodedBaselines_); + onChanged(); + } else { + encodedBaselinesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public Builder clearEncodedBaselines() { + if (encodedBaselinesBuilder_ == null) { + encodedBaselines_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + encodedBaselinesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public Builder removeEncodedBaselines(int index) { + if (encodedBaselinesBuilder_ == null) { + ensureEncodedBaselinesIsMutable(); + encodedBaselines_.remove(index); + onChanged(); + } else { + encodedBaselinesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public com.google.protobuf.Value.Builder getEncodedBaselinesBuilder(int index) { + return getEncodedBaselinesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public com.google.protobuf.ValueOrBuilder getEncodedBaselinesOrBuilder(int index) { + if (encodedBaselinesBuilder_ == null) { + return encodedBaselines_.get(index); + } else { + return encodedBaselinesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public java.util.List + getEncodedBaselinesOrBuilderList() { + if (encodedBaselinesBuilder_ != null) { + return encodedBaselinesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(encodedBaselines_); + } + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public com.google.protobuf.Value.Builder addEncodedBaselinesBuilder() { + return getEncodedBaselinesFieldBuilder() + .addBuilder(com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public com.google.protobuf.Value.Builder addEncodedBaselinesBuilder(int index) { + return getEncodedBaselinesFieldBuilder() + .addBuilder(index, com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+       * A list of baselines for the encoded tensor.
+       *
+       * The shape of each baseline should match the shape of the encoded tensor.
+       * If a scalar is provided, Vertex AI broadcasts to the same shape as the
+       * encoded tensor.
+       * 
+ * + * repeated .google.protobuf.Value encoded_baselines = 10; + */ + public java.util.List getEncodedBaselinesBuilderList() { + return getEncodedBaselinesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getEncodedBaselinesFieldBuilder() { + if (encodedBaselinesBuilder_ == null) { + encodedBaselinesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + encodedBaselines_, + ((bitField0_ & 0x00000200) != 0), + getParentForChildren(), + isClean()); + encodedBaselines_ = null; + } + return encodedBaselinesBuilder_; + } + + private com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + visualization_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Builder, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .VisualizationOrBuilder> + visualizationBuilder_; + /** + * + * + *
+       * Visualization configurations for image explanation.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + * + * @return Whether the visualization field is set. + */ + public boolean hasVisualization() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+       * Visualization configurations for image explanation.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + * + * @return The visualization. + */ + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + getVisualization() { + if (visualizationBuilder_ == null) { + return visualization_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDefaultInstance() + : visualization_; + } else { + return visualizationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Visualization configurations for image explanation.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + */ + public Builder setVisualization( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization value) { + if (visualizationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + visualization_ = value; + } else { + visualizationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+       * Visualization configurations for image explanation.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + */ + public Builder setVisualization( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Builder + builderForValue) { + if (visualizationBuilder_ == null) { + visualization_ = builderForValue.build(); + } else { + visualizationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+       * Visualization configurations for image explanation.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + */ + public Builder mergeVisualization( + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization value) { + if (visualizationBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && visualization_ != null + && visualization_ + != com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDefaultInstance()) { + getVisualizationBuilder().mergeFrom(value); + } else { + visualization_ = value; + } + } else { + visualizationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+       * Visualization configurations for image explanation.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + */ + public Builder clearVisualization() { + bitField0_ = (bitField0_ & ~0x00000400); + visualization_ = null; + if (visualizationBuilder_ != null) { + visualizationBuilder_.dispose(); + visualizationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Visualization configurations for image explanation.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + */ + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Builder + getVisualizationBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getVisualizationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Visualization configurations for image explanation.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + */ + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.VisualizationOrBuilder + getVisualizationOrBuilder() { + if (visualizationBuilder_ != null) { + return visualizationBuilder_.getMessageOrBuilder(); + } else { + return visualization_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .getDefaultInstance() + : visualization_; + } + } + /** + * + * + *
+       * Visualization configurations for image explanation.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.Visualization visualization = 11; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization.Builder, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .VisualizationOrBuilder> + getVisualizationFieldBuilder() { + if (visualizationBuilder_ == null) { + visualizationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata.Visualization + .Builder, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .VisualizationOrBuilder>( + getVisualization(), getParentForChildren(), isClean()); + visualization_ = null; + } + return visualizationBuilder_; + } + + private java.lang.Object groupName_ = ""; + /** + * + * + *
+       * Name of the group that the input belongs to. Features with the same group
+       * name will be treated as one feature when computing attributions. Features
+       * grouped together can have different shapes in value. If provided, there
+       * will be one single attribution generated in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions],
+       * keyed by the group name.
+       * 
+ * + * string group_name = 12; + * + * @return The groupName. + */ + public java.lang.String getGroupName() { + java.lang.Object ref = groupName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + groupName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name of the group that the input belongs to. Features with the same group
+       * name will be treated as one feature when computing attributions. Features
+       * grouped together can have different shapes in value. If provided, there
+       * will be one single attribution generated in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions],
+       * keyed by the group name.
+       * 
+ * + * string group_name = 12; + * + * @return The bytes for groupName. + */ + public com.google.protobuf.ByteString getGroupNameBytes() { + java.lang.Object ref = groupName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name of the group that the input belongs to. Features with the same group
+       * name will be treated as one feature when computing attributions. Features
+       * grouped together can have different shapes in value. If provided, there
+       * will be one single attribution generated in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions],
+       * keyed by the group name.
+       * 
+ * + * string group_name = 12; + * + * @param value The groupName to set. + * @return This builder for chaining. + */ + public Builder setGroupName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + groupName_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the group that the input belongs to. Features with the same group
+       * name will be treated as one feature when computing attributions. Features
+       * grouped together can have different shapes in value. If provided, there
+       * will be one single attribution generated in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions],
+       * keyed by the group name.
+       * 
+ * + * string group_name = 12; + * + * @return This builder for chaining. + */ + public Builder clearGroupName() { + groupName_ = getDefaultInstance().getGroupName(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the group that the input belongs to. Features with the same group
+       * name will be treated as one feature when computing attributions. Features
+       * grouped together can have different shapes in value. If provided, there
+       * will be one single attribution generated in
+       * [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions],
+       * keyed by the group name.
+       * 
+ * + * string group_name = 12; + * + * @param value The bytes for groupName to set. + * @return This builder for chaining. + */ + public Builder setGroupNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + groupName_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata) + private static final com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata(); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InputMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface OutputMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Static mapping between the index and display name.
+     *
+     * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+     * list of scores of all the classes in a pre-defined order for a
+     * multi-classification Model. It's not feasible if the outputs are
+     * non-deterministic, e.g. the Model produces top-k classes or sort the
+     * outputs by their values.
+     *
+     * The shape of the value must be an n-dimensional array of strings. The
+     * number of dimensions must match that of the outputs to be explained.
+     * The
+     * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+     * is populated by locating in the mapping with
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + * + * @return Whether the indexDisplayNameMapping field is set. + */ + boolean hasIndexDisplayNameMapping(); + /** + * + * + *
+     * Static mapping between the index and display name.
+     *
+     * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+     * list of scores of all the classes in a pre-defined order for a
+     * multi-classification Model. It's not feasible if the outputs are
+     * non-deterministic, e.g. the Model produces top-k classes or sort the
+     * outputs by their values.
+     *
+     * The shape of the value must be an n-dimensional array of strings. The
+     * number of dimensions must match that of the outputs to be explained.
+     * The
+     * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+     * is populated by locating in the mapping with
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + * + * @return The indexDisplayNameMapping. + */ + com.google.protobuf.Value getIndexDisplayNameMapping(); + /** + * + * + *
+     * Static mapping between the index and display name.
+     *
+     * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+     * list of scores of all the classes in a pre-defined order for a
+     * multi-classification Model. It's not feasible if the outputs are
+     * non-deterministic, e.g. the Model produces top-k classes or sort the
+     * outputs by their values.
+     *
+     * The shape of the value must be an n-dimensional array of strings. The
+     * number of dimensions must match that of the outputs to be explained.
+     * The
+     * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+     * is populated by locating in the mapping with
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + */ + com.google.protobuf.ValueOrBuilder getIndexDisplayNameMappingOrBuilder(); + + /** + * + * + *
+     * Specify a field name in the prediction to look for the display name.
+     *
+     * Use this if the prediction contains the display names for the outputs.
+     *
+     * The display names in the prediction must have the same shape of the
+     * outputs, so that it can be located by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * for a specific output.
+     * 
+ * + * string display_name_mapping_key = 2; + * + * @return Whether the displayNameMappingKey field is set. + */ + boolean hasDisplayNameMappingKey(); + /** + * + * + *
+     * Specify a field name in the prediction to look for the display name.
+     *
+     * Use this if the prediction contains the display names for the outputs.
+     *
+     * The display names in the prediction must have the same shape of the
+     * outputs, so that it can be located by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * for a specific output.
+     * 
+ * + * string display_name_mapping_key = 2; + * + * @return The displayNameMappingKey. + */ + java.lang.String getDisplayNameMappingKey(); + /** + * + * + *
+     * Specify a field name in the prediction to look for the display name.
+     *
+     * Use this if the prediction contains the display names for the outputs.
+     *
+     * The display names in the prediction must have the same shape of the
+     * outputs, so that it can be located by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * for a specific output.
+     * 
+ * + * string display_name_mapping_key = 2; + * + * @return The bytes for displayNameMappingKey. + */ + com.google.protobuf.ByteString getDisplayNameMappingKeyBytes(); + + /** + * + * + *
+     * Name of the output tensor. Required and is only applicable to Vertex
+     * AI provided images for Tensorflow.
+     * 
+ * + * string output_tensor_name = 3; + * + * @return The outputTensorName. + */ + java.lang.String getOutputTensorName(); + /** + * + * + *
+     * Name of the output tensor. Required and is only applicable to Vertex
+     * AI provided images for Tensorflow.
+     * 
+ * + * string output_tensor_name = 3; + * + * @return The bytes for outputTensorName. + */ + com.google.protobuf.ByteString getOutputTensorNameBytes(); + + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata.DisplayNameMappingCase + getDisplayNameMappingCase(); + } + /** + * + * + *
+   * Metadata of the prediction output to be explained.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata} + */ + public static final class OutputMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata) + OutputMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OutputMetadata.newBuilder() to construct. + private OutputMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OutputMetadata() { + outputTensorName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OutputMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata.class, + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata.Builder.class); + } + + private int displayNameMappingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object displayNameMapping_; + + public enum DisplayNameMappingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INDEX_DISPLAY_NAME_MAPPING(1), + DISPLAY_NAME_MAPPING_KEY(2), + DISPLAYNAMEMAPPING_NOT_SET(0); + private final int value; + + private DisplayNameMappingCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DisplayNameMappingCase valueOf(int value) { + return forNumber(value); + } + + public static DisplayNameMappingCase forNumber(int value) { + switch (value) { + case 1: + return INDEX_DISPLAY_NAME_MAPPING; + case 2: + return DISPLAY_NAME_MAPPING_KEY; + case 0: + return DISPLAYNAMEMAPPING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DisplayNameMappingCase getDisplayNameMappingCase() { + return DisplayNameMappingCase.forNumber(displayNameMappingCase_); + } + + public static final int INDEX_DISPLAY_NAME_MAPPING_FIELD_NUMBER = 1; + /** + * + * + *
+     * Static mapping between the index and display name.
+     *
+     * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+     * list of scores of all the classes in a pre-defined order for a
+     * multi-classification Model. It's not feasible if the outputs are
+     * non-deterministic, e.g. the Model produces top-k classes or sort the
+     * outputs by their values.
+     *
+     * The shape of the value must be an n-dimensional array of strings. The
+     * number of dimensions must match that of the outputs to be explained.
+     * The
+     * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+     * is populated by locating in the mapping with
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + * + * @return Whether the indexDisplayNameMapping field is set. + */ + @java.lang.Override + public boolean hasIndexDisplayNameMapping() { + return displayNameMappingCase_ == 1; + } + /** + * + * + *
+     * Static mapping between the index and display name.
+     *
+     * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+     * list of scores of all the classes in a pre-defined order for a
+     * multi-classification Model. It's not feasible if the outputs are
+     * non-deterministic, e.g. the Model produces top-k classes or sort the
+     * outputs by their values.
+     *
+     * The shape of the value must be an n-dimensional array of strings. The
+     * number of dimensions must match that of the outputs to be explained.
+     * The
+     * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+     * is populated by locating in the mapping with
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + * + * @return The indexDisplayNameMapping. + */ + @java.lang.Override + public com.google.protobuf.Value getIndexDisplayNameMapping() { + if (displayNameMappingCase_ == 1) { + return (com.google.protobuf.Value) displayNameMapping_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } + /** + * + * + *
+     * Static mapping between the index and display name.
+     *
+     * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+     * list of scores of all the classes in a pre-defined order for a
+     * multi-classification Model. It's not feasible if the outputs are
+     * non-deterministic, e.g. the Model produces top-k classes or sort the
+     * outputs by their values.
+     *
+     * The shape of the value must be an n-dimensional array of strings. The
+     * number of dimensions must match that of the outputs to be explained.
+     * The
+     * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+     * is populated by locating in the mapping with
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+     * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getIndexDisplayNameMappingOrBuilder() { + if (displayNameMappingCase_ == 1) { + return (com.google.protobuf.Value) displayNameMapping_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } + + public static final int DISPLAY_NAME_MAPPING_KEY_FIELD_NUMBER = 2; + /** + * + * + *
+     * Specify a field name in the prediction to look for the display name.
+     *
+     * Use this if the prediction contains the display names for the outputs.
+     *
+     * The display names in the prediction must have the same shape of the
+     * outputs, so that it can be located by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * for a specific output.
+     * 
+ * + * string display_name_mapping_key = 2; + * + * @return Whether the displayNameMappingKey field is set. + */ + public boolean hasDisplayNameMappingKey() { + return displayNameMappingCase_ == 2; + } + /** + * + * + *
+     * Specify a field name in the prediction to look for the display name.
+     *
+     * Use this if the prediction contains the display names for the outputs.
+     *
+     * The display names in the prediction must have the same shape of the
+     * outputs, so that it can be located by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * for a specific output.
+     * 
+ * + * string display_name_mapping_key = 2; + * + * @return The displayNameMappingKey. + */ + public java.lang.String getDisplayNameMappingKey() { + java.lang.Object ref = ""; + if (displayNameMappingCase_ == 2) { + ref = displayNameMapping_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (displayNameMappingCase_ == 2) { + displayNameMapping_ = s; + } + return s; + } + } + /** + * + * + *
+     * Specify a field name in the prediction to look for the display name.
+     *
+     * Use this if the prediction contains the display names for the outputs.
+     *
+     * The display names in the prediction must have the same shape of the
+     * outputs, so that it can be located by
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * for a specific output.
+     * 
+ * + * string display_name_mapping_key = 2; + * + * @return The bytes for displayNameMappingKey. + */ + public com.google.protobuf.ByteString getDisplayNameMappingKeyBytes() { + java.lang.Object ref = ""; + if (displayNameMappingCase_ == 2) { + ref = displayNameMapping_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (displayNameMappingCase_ == 2) { + displayNameMapping_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUTPUT_TENSOR_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object outputTensorName_ = ""; + /** + * + * + *
+     * Name of the output tensor. Required and is only applicable to Vertex
+     * AI provided images for Tensorflow.
+     * 
+ * + * string output_tensor_name = 3; + * + * @return The outputTensorName. + */ + @java.lang.Override + public java.lang.String getOutputTensorName() { + java.lang.Object ref = outputTensorName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputTensorName_ = s; + return s; + } + } + /** + * + * + *
+     * Name of the output tensor. Required and is only applicable to Vertex
+     * AI provided images for Tensorflow.
+     * 
+ * + * string output_tensor_name = 3; + * + * @return The bytes for outputTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputTensorNameBytes() { + java.lang.Object ref = outputTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (displayNameMappingCase_ == 1) { + output.writeMessage(1, (com.google.protobuf.Value) displayNameMapping_); + } + if (displayNameMappingCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayNameMapping_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputTensorName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, outputTensorName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (displayNameMappingCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.protobuf.Value) displayNameMapping_); + } + if (displayNameMappingCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayNameMapping_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputTensorName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, outputTensorName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata other = + (com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata) obj; + + if (!getOutputTensorName().equals(other.getOutputTensorName())) return false; + if (!getDisplayNameMappingCase().equals(other.getDisplayNameMappingCase())) return false; + switch (displayNameMappingCase_) { + case 1: + if (!getIndexDisplayNameMapping().equals(other.getIndexDisplayNameMapping())) + return false; + break; + case 2: + if (!getDisplayNameMappingKey().equals(other.getDisplayNameMappingKey())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OUTPUT_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOutputTensorName().hashCode(); + switch (displayNameMappingCase_) { + case 1: + hash = (37 * hash) + INDEX_DISPLAY_NAME_MAPPING_FIELD_NUMBER; + hash = (53 * hash) + getIndexDisplayNameMapping().hashCode(); + break; + case 2: + hash = (37 * hash) + DISPLAY_NAME_MAPPING_KEY_FIELD_NUMBER; + hash = (53 * hash) + getDisplayNameMappingKey().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Metadata of the prediction output to be explained.
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata) + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata.class, + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (indexDisplayNameMappingBuilder_ != null) { + indexDisplayNameMappingBuilder_.clear(); + } + outputTensorName_ = ""; + displayNameMappingCase_ = 0; + displayNameMapping_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata build() { + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata buildPartial() { + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata result = + new com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.outputTensorName_ = outputTensorName_; + } + } + + private void buildPartialOneofs( + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata result) { + result.displayNameMappingCase_ = displayNameMappingCase_; + result.displayNameMapping_ = this.displayNameMapping_; + if (displayNameMappingCase_ == 1 && indexDisplayNameMappingBuilder_ != null) { + result.displayNameMapping_ = indexDisplayNameMappingBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata) { + return mergeFrom( + (com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata other) { + if (other + == com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + .getDefaultInstance()) return this; + if (!other.getOutputTensorName().isEmpty()) { + outputTensorName_ = other.outputTensorName_; + bitField0_ |= 0x00000004; + onChanged(); + } + switch (other.getDisplayNameMappingCase()) { + case INDEX_DISPLAY_NAME_MAPPING: + { + mergeIndexDisplayNameMapping(other.getIndexDisplayNameMapping()); + break; + } + case DISPLAY_NAME_MAPPING_KEY: + { + displayNameMappingCase_ = 2; + displayNameMapping_ = other.displayNameMapping_; + onChanged(); + break; + } + case DISPLAYNAMEMAPPING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getIndexDisplayNameMappingFieldBuilder().getBuilder(), extensionRegistry); + displayNameMappingCase_ = 1; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + displayNameMappingCase_ = 2; + displayNameMapping_ = s; + break; + } // case 18 + case 26: + { + outputTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int displayNameMappingCase_ = 0; + private java.lang.Object displayNameMapping_; + + public DisplayNameMappingCase getDisplayNameMappingCase() { + return DisplayNameMappingCase.forNumber(displayNameMappingCase_); + } + + public Builder clearDisplayNameMapping() { + displayNameMappingCase_ = 0; + displayNameMapping_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + indexDisplayNameMappingBuilder_; + /** + * + * + *
+       * Static mapping between the index and display name.
+       *
+       * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+       * list of scores of all the classes in a pre-defined order for a
+       * multi-classification Model. It's not feasible if the outputs are
+       * non-deterministic, e.g. the Model produces top-k classes or sort the
+       * outputs by their values.
+       *
+       * The shape of the value must be an n-dimensional array of strings. The
+       * number of dimensions must match that of the outputs to be explained.
+       * The
+       * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+       * is populated by locating in the mapping with
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+       * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + * + * @return Whether the indexDisplayNameMapping field is set. + */ + @java.lang.Override + public boolean hasIndexDisplayNameMapping() { + return displayNameMappingCase_ == 1; + } + /** + * + * + *
+       * Static mapping between the index and display name.
+       *
+       * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+       * list of scores of all the classes in a pre-defined order for a
+       * multi-classification Model. It's not feasible if the outputs are
+       * non-deterministic, e.g. the Model produces top-k classes or sort the
+       * outputs by their values.
+       *
+       * The shape of the value must be an n-dimensional array of strings. The
+       * number of dimensions must match that of the outputs to be explained.
+       * The
+       * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+       * is populated by locating in the mapping with
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+       * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + * + * @return The indexDisplayNameMapping. + */ + @java.lang.Override + public com.google.protobuf.Value getIndexDisplayNameMapping() { + if (indexDisplayNameMappingBuilder_ == null) { + if (displayNameMappingCase_ == 1) { + return (com.google.protobuf.Value) displayNameMapping_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } else { + if (displayNameMappingCase_ == 1) { + return indexDisplayNameMappingBuilder_.getMessage(); + } + return com.google.protobuf.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Static mapping between the index and display name.
+       *
+       * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+       * list of scores of all the classes in a pre-defined order for a
+       * multi-classification Model. It's not feasible if the outputs are
+       * non-deterministic, e.g. the Model produces top-k classes or sort the
+       * outputs by their values.
+       *
+       * The shape of the value must be an n-dimensional array of strings. The
+       * number of dimensions must match that of the outputs to be explained.
+       * The
+       * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+       * is populated by locating in the mapping with
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+       * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + */ + public Builder setIndexDisplayNameMapping(com.google.protobuf.Value value) { + if (indexDisplayNameMappingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + displayNameMapping_ = value; + onChanged(); + } else { + indexDisplayNameMappingBuilder_.setMessage(value); + } + displayNameMappingCase_ = 1; + return this; + } + /** + * + * + *
+       * Static mapping between the index and display name.
+       *
+       * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+       * list of scores of all the classes in a pre-defined order for a
+       * multi-classification Model. It's not feasible if the outputs are
+       * non-deterministic, e.g. the Model produces top-k classes or sort the
+       * outputs by their values.
+       *
+       * The shape of the value must be an n-dimensional array of strings. The
+       * number of dimensions must match that of the outputs to be explained.
+       * The
+       * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+       * is populated by locating in the mapping with
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+       * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + */ + public Builder setIndexDisplayNameMapping(com.google.protobuf.Value.Builder builderForValue) { + if (indexDisplayNameMappingBuilder_ == null) { + displayNameMapping_ = builderForValue.build(); + onChanged(); + } else { + indexDisplayNameMappingBuilder_.setMessage(builderForValue.build()); + } + displayNameMappingCase_ = 1; + return this; + } + /** + * + * + *
+       * Static mapping between the index and display name.
+       *
+       * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+       * list of scores of all the classes in a pre-defined order for a
+       * multi-classification Model. It's not feasible if the outputs are
+       * non-deterministic, e.g. the Model produces top-k classes or sort the
+       * outputs by their values.
+       *
+       * The shape of the value must be an n-dimensional array of strings. The
+       * number of dimensions must match that of the outputs to be explained.
+       * The
+       * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+       * is populated by locating in the mapping with
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+       * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + */ + public Builder mergeIndexDisplayNameMapping(com.google.protobuf.Value value) { + if (indexDisplayNameMappingBuilder_ == null) { + if (displayNameMappingCase_ == 1 + && displayNameMapping_ != com.google.protobuf.Value.getDefaultInstance()) { + displayNameMapping_ = + com.google.protobuf.Value.newBuilder( + (com.google.protobuf.Value) displayNameMapping_) + .mergeFrom(value) + .buildPartial(); + } else { + displayNameMapping_ = value; + } + onChanged(); + } else { + if (displayNameMappingCase_ == 1) { + indexDisplayNameMappingBuilder_.mergeFrom(value); + } else { + indexDisplayNameMappingBuilder_.setMessage(value); + } + } + displayNameMappingCase_ = 1; + return this; + } + /** + * + * + *
+       * Static mapping between the index and display name.
+       *
+       * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+       * list of scores of all the classes in a pre-defined order for a
+       * multi-classification Model. It's not feasible if the outputs are
+       * non-deterministic, e.g. the Model produces top-k classes or sort the
+       * outputs by their values.
+       *
+       * The shape of the value must be an n-dimensional array of strings. The
+       * number of dimensions must match that of the outputs to be explained.
+       * The
+       * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+       * is populated by locating in the mapping with
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+       * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + */ + public Builder clearIndexDisplayNameMapping() { + if (indexDisplayNameMappingBuilder_ == null) { + if (displayNameMappingCase_ == 1) { + displayNameMappingCase_ = 0; + displayNameMapping_ = null; + onChanged(); + } + } else { + if (displayNameMappingCase_ == 1) { + displayNameMappingCase_ = 0; + displayNameMapping_ = null; + } + indexDisplayNameMappingBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Static mapping between the index and display name.
+       *
+       * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+       * list of scores of all the classes in a pre-defined order for a
+       * multi-classification Model. It's not feasible if the outputs are
+       * non-deterministic, e.g. the Model produces top-k classes or sort the
+       * outputs by their values.
+       *
+       * The shape of the value must be an n-dimensional array of strings. The
+       * number of dimensions must match that of the outputs to be explained.
+       * The
+       * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+       * is populated by locating in the mapping with
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+       * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + */ + public com.google.protobuf.Value.Builder getIndexDisplayNameMappingBuilder() { + return getIndexDisplayNameMappingFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Static mapping between the index and display name.
+       *
+       * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+       * list of scores of all the classes in a pre-defined order for a
+       * multi-classification Model. It's not feasible if the outputs are
+       * non-deterministic, e.g. the Model produces top-k classes or sort the
+       * outputs by their values.
+       *
+       * The shape of the value must be an n-dimensional array of strings. The
+       * number of dimensions must match that of the outputs to be explained.
+       * The
+       * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+       * is populated by locating in the mapping with
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+       * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getIndexDisplayNameMappingOrBuilder() { + if ((displayNameMappingCase_ == 1) && (indexDisplayNameMappingBuilder_ != null)) { + return indexDisplayNameMappingBuilder_.getMessageOrBuilder(); + } else { + if (displayNameMappingCase_ == 1) { + return (com.google.protobuf.Value) displayNameMapping_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } + } + /** + * + * + *
+       * Static mapping between the index and display name.
+       *
+       * Use this if the outputs are a deterministic n-dimensional array, e.g. a
+       * list of scores of all the classes in a pre-defined order for a
+       * multi-classification Model. It's not feasible if the outputs are
+       * non-deterministic, e.g. the Model produces top-k classes or sort the
+       * outputs by their values.
+       *
+       * The shape of the value must be an n-dimensional array of strings. The
+       * number of dimensions must match that of the outputs to be explained.
+       * The
+       * [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]
+       * is populated by locating in the mapping with
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index].
+       * 
+ * + * .google.protobuf.Value index_display_name_mapping = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getIndexDisplayNameMappingFieldBuilder() { + if (indexDisplayNameMappingBuilder_ == null) { + if (!(displayNameMappingCase_ == 1)) { + displayNameMapping_ = com.google.protobuf.Value.getDefaultInstance(); + } + indexDisplayNameMappingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + (com.google.protobuf.Value) displayNameMapping_, + getParentForChildren(), + isClean()); + displayNameMapping_ = null; + } + displayNameMappingCase_ = 1; + onChanged(); + return indexDisplayNameMappingBuilder_; + } + + /** + * + * + *
+       * Specify a field name in the prediction to look for the display name.
+       *
+       * Use this if the prediction contains the display names for the outputs.
+       *
+       * The display names in the prediction must have the same shape of the
+       * outputs, so that it can be located by
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+       * for a specific output.
+       * 
+ * + * string display_name_mapping_key = 2; + * + * @return Whether the displayNameMappingKey field is set. + */ + @java.lang.Override + public boolean hasDisplayNameMappingKey() { + return displayNameMappingCase_ == 2; + } + /** + * + * + *
+       * Specify a field name in the prediction to look for the display name.
+       *
+       * Use this if the prediction contains the display names for the outputs.
+       *
+       * The display names in the prediction must have the same shape of the
+       * outputs, so that it can be located by
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+       * for a specific output.
+       * 
+ * + * string display_name_mapping_key = 2; + * + * @return The displayNameMappingKey. + */ + @java.lang.Override + public java.lang.String getDisplayNameMappingKey() { + java.lang.Object ref = ""; + if (displayNameMappingCase_ == 2) { + ref = displayNameMapping_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (displayNameMappingCase_ == 2) { + displayNameMapping_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Specify a field name in the prediction to look for the display name.
+       *
+       * Use this if the prediction contains the display names for the outputs.
+       *
+       * The display names in the prediction must have the same shape of the
+       * outputs, so that it can be located by
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+       * for a specific output.
+       * 
+ * + * string display_name_mapping_key = 2; + * + * @return The bytes for displayNameMappingKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameMappingKeyBytes() { + java.lang.Object ref = ""; + if (displayNameMappingCase_ == 2) { + ref = displayNameMapping_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (displayNameMappingCase_ == 2) { + displayNameMapping_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Specify a field name in the prediction to look for the display name.
+       *
+       * Use this if the prediction contains the display names for the outputs.
+       *
+       * The display names in the prediction must have the same shape of the
+       * outputs, so that it can be located by
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+       * for a specific output.
+       * 
+ * + * string display_name_mapping_key = 2; + * + * @param value The displayNameMappingKey to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameMappingKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayNameMappingCase_ = 2; + displayNameMapping_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Specify a field name in the prediction to look for the display name.
+       *
+       * Use this if the prediction contains the display names for the outputs.
+       *
+       * The display names in the prediction must have the same shape of the
+       * outputs, so that it can be located by
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+       * for a specific output.
+       * 
+ * + * string display_name_mapping_key = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayNameMappingKey() { + if (displayNameMappingCase_ == 2) { + displayNameMappingCase_ = 0; + displayNameMapping_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Specify a field name in the prediction to look for the display name.
+       *
+       * Use this if the prediction contains the display names for the outputs.
+       *
+       * The display names in the prediction must have the same shape of the
+       * outputs, so that it can be located by
+       * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+       * for a specific output.
+       * 
+ * + * string display_name_mapping_key = 2; + * + * @param value The bytes for displayNameMappingKey to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameMappingKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayNameMappingCase_ = 2; + displayNameMapping_ = value; + onChanged(); + return this; + } + + private java.lang.Object outputTensorName_ = ""; + /** + * + * + *
+       * Name of the output tensor. Required and is only applicable to Vertex
+       * AI provided images for Tensorflow.
+       * 
+ * + * string output_tensor_name = 3; + * + * @return The outputTensorName. + */ + public java.lang.String getOutputTensorName() { + java.lang.Object ref = outputTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Name of the output tensor. Required and is only applicable to Vertex
+       * AI provided images for Tensorflow.
+       * 
+ * + * string output_tensor_name = 3; + * + * @return The bytes for outputTensorName. + */ + public com.google.protobuf.ByteString getOutputTensorNameBytes() { + java.lang.Object ref = outputTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Name of the output tensor. Required and is only applicable to Vertex
+       * AI provided images for Tensorflow.
+       * 
+ * + * string output_tensor_name = 3; + * + * @param value The outputTensorName to set. + * @return This builder for chaining. + */ + public Builder setOutputTensorName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputTensorName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the output tensor. Required and is only applicable to Vertex
+       * AI provided images for Tensorflow.
+       * 
+ * + * string output_tensor_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearOutputTensorName() { + outputTensorName_ = getDefaultInstance().getOutputTensorName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Name of the output tensor. Required and is only applicable to Vertex
+       * AI provided images for Tensorflow.
+       * 
+ * + * string output_tensor_name = 3; + * + * @param value The bytes for outputTensorName to set. + * @return This builder for chaining. + */ + public Builder setOutputTensorNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputTensorName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata) + private static final com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata(); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int INPUTS_FIELD_NUMBER = 1; + + private static final class InputsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + inputs_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + internalGetInputs() { + if (inputs_ == null) { + return com.google.protobuf.MapField.emptyMapField(InputsDefaultEntryHolder.defaultEntry); + } + return inputs_; + } + + public int getInputsCount() { + return internalGetInputs().getMap().size(); + } + /** + * + * + *
+   * Required. Map from feature names to feature input metadata. Keys are the
+   * name of the features. Values are the specification of the feature.
+   *
+   * An empty InputMetadata is valid. It describes a text feature which has the
+   * name specified as the key in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The baseline of the empty feature is chosen by Vertex AI.
+   *
+   * For Vertex AI-provided Tensorflow images, the key can be any friendly
+   * name of the feature. Once specified,
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * are keyed by this key (if not grouped with another feature).
+   *
+   * For custom images, the key must match with the key in
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsInputs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetInputs().getMap().containsKey(key); + } + /** Use {@link #getInputsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + getInputs() { + return getInputsMap(); + } + /** + * + * + *
+   * Required. Map from feature names to feature input metadata. Keys are the
+   * name of the features. Values are the specification of the feature.
+   *
+   * An empty InputMetadata is valid. It describes a text feature which has the
+   * name specified as the key in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The baseline of the empty feature is chosen by Vertex AI.
+   *
+   * For Vertex AI-provided Tensorflow images, the key can be any friendly
+   * name of the feature. Once specified,
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * are keyed by this key (if not grouped with another feature).
+   *
+   * For custom images, the key must match with the key in
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + getInputsMap() { + return internalGetInputs().getMap(); + } + /** + * + * + *
+   * Required. Map from feature names to feature input metadata. Keys are the
+   * name of the features. Values are the specification of the feature.
+   *
+   * An empty InputMetadata is valid. It describes a text feature which has the
+   * name specified as the key in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The baseline of the empty feature is chosen by Vertex AI.
+   *
+   * For Vertex AI-provided Tensorflow images, the key can be any friendly
+   * name of the feature. Once specified,
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * are keyed by this key (if not grouped with another feature).
+   *
+   * For custom images, the key must match with the key in
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + getInputsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetInputs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Required. Map from feature names to feature input metadata. Keys are the
+   * name of the features. Values are the specification of the feature.
+   *
+   * An empty InputMetadata is valid. It describes a text feature which has the
+   * name specified as the key in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The baseline of the empty feature is chosen by Vertex AI.
+   *
+   * For Vertex AI-provided Tensorflow images, the key can be any friendly
+   * name of the feature. Once specified,
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * are keyed by this key (if not grouped with another feature).
+   *
+   * For custom images, the key must match with the key in
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata getInputsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetInputs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int OUTPUTS_FIELD_NUMBER = 2; + + private static final class OutputsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + outputs_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + internalGetOutputs() { + if (outputs_ == null) { + return com.google.protobuf.MapField.emptyMapField(OutputsDefaultEntryHolder.defaultEntry); + } + return outputs_; + } + + public int getOutputsCount() { + return internalGetOutputs().getMap().size(); + } + /** + * + * + *
+   * Required. Map from output names to output metadata.
+   *
+   * For Vertex AI-provided Tensorflow images, keys can be any user defined
+   * string that consists of any UTF-8 characters.
+   *
+   * For custom images, keys are the name of the output field in the prediction
+   * to be explained.
+   *
+   * Currently only one key is allowed.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsOutputs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetOutputs().getMap().containsKey(key); + } + /** Use {@link #getOutputsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + getOutputs() { + return getOutputsMap(); + } + /** + * + * + *
+   * Required. Map from output names to output metadata.
+   *
+   * For Vertex AI-provided Tensorflow images, keys can be any user defined
+   * string that consists of any UTF-8 characters.
+   *
+   * For custom images, keys are the name of the output field in the prediction
+   * to be explained.
+   *
+   * Currently only one key is allowed.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + getOutputsMap() { + return internalGetOutputs().getMap(); + } + /** + * + * + *
+   * Required. Map from output names to output metadata.
+   *
+   * For Vertex AI-provided Tensorflow images, keys can be any user defined
+   * string that consists of any UTF-8 characters.
+   *
+   * For custom images, keys are the name of the output field in the prediction
+   * to be explained.
+   *
+   * Currently only one key is allowed.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + getOutputsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + map = internalGetOutputs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Required. Map from output names to output metadata.
+   *
+   * For Vertex AI-provided Tensorflow images, keys can be any user defined
+   * string that consists of any UTF-8 characters.
+   *
+   * For custom images, keys are the name of the output field in the prediction
+   * to be explained.
+   *
+   * Currently only one key is allowed.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata getOutputsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + map = internalGetOutputs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int FEATURE_ATTRIBUTIONS_SCHEMA_URI_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object featureAttributionsSchemaUri_ = ""; + /** + * + * + *
+   * Points to a YAML file stored on Google Cloud Storage describing the format
+   * of the [feature
+   * attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+   * The schema is defined as an OpenAPI 3.0.2 [Schema
+   * Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
+   * AutoML tabular Models always have this field populated by Vertex AI.
+   * Note: The URI given on output may be different, including the URI scheme,
+   * than the one given on input. The output URI will point to a location where
+   * the user only has a read access.
+   * 
+ * + * string feature_attributions_schema_uri = 3; + * + * @return The featureAttributionsSchemaUri. + */ + @java.lang.Override + public java.lang.String getFeatureAttributionsSchemaUri() { + java.lang.Object ref = featureAttributionsSchemaUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + featureAttributionsSchemaUri_ = s; + return s; + } + } + /** + * + * + *
+   * Points to a YAML file stored on Google Cloud Storage describing the format
+   * of the [feature
+   * attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+   * The schema is defined as an OpenAPI 3.0.2 [Schema
+   * Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
+   * AutoML tabular Models always have this field populated by Vertex AI.
+   * Note: The URI given on output may be different, including the URI scheme,
+   * than the one given on input. The output URI will point to a location where
+   * the user only has a read access.
+   * 
+ * + * string feature_attributions_schema_uri = 3; + * + * @return The bytes for featureAttributionsSchemaUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFeatureAttributionsSchemaUriBytes() { + java.lang.Object ref = featureAttributionsSchemaUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + featureAttributionsSchemaUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LATENT_SPACE_SOURCE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object latentSpaceSource_ = ""; + /** + * + * + *
+   * Name of the source to generate embeddings for example based explanations.
+   * 
+ * + * string latent_space_source = 5; + * + * @return The latentSpaceSource. + */ + @java.lang.Override + public java.lang.String getLatentSpaceSource() { + java.lang.Object ref = latentSpaceSource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + latentSpaceSource_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the source to generate embeddings for example based explanations.
+   * 
+ * + * string latent_space_source = 5; + * + * @return The bytes for latentSpaceSource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLatentSpaceSourceBytes() { + java.lang.Object ref = latentSpaceSource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + latentSpaceSource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetInputs(), InputsDefaultEntryHolder.defaultEntry, 1); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetOutputs(), OutputsDefaultEntryHolder.defaultEntry, 2); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(featureAttributionsSchemaUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, featureAttributionsSchemaUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(latentSpaceSource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, latentSpaceSource_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + entry : internalGetInputs().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + inputs__ = + InputsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, inputs__); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + entry : internalGetOutputs().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + outputs__ = + OutputsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, outputs__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(featureAttributionsSchemaUri_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 3, featureAttributionsSchemaUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(latentSpaceSource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, latentSpaceSource_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExplanationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplanationMetadata other = + (com.google.cloud.vertexai.api.ExplanationMetadata) obj; + + if (!internalGetInputs().equals(other.internalGetInputs())) return false; + if (!internalGetOutputs().equals(other.internalGetOutputs())) return false; + if (!getFeatureAttributionsSchemaUri().equals(other.getFeatureAttributionsSchemaUri())) + return false; + if (!getLatentSpaceSource().equals(other.getLatentSpaceSource())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetInputs().getMap().isEmpty()) { + hash = (37 * hash) + INPUTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetInputs().hashCode(); + } + if (!internalGetOutputs().getMap().isEmpty()) { + hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetOutputs().hashCode(); + } + hash = (37 * hash) + FEATURE_ATTRIBUTIONS_SCHEMA_URI_FIELD_NUMBER; + hash = (53 * hash) + getFeatureAttributionsSchemaUri().hashCode(); + hash = (37 * hash) + LATENT_SPACE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getLatentSpaceSource().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ExplanationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata describing the Model's input and output for explanation.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplanationMetadata) + com.google.cloud.vertexai.api.ExplanationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetInputs(); + case 2: + return internalGetOutputs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableInputs(); + case 2: + return internalGetMutableOutputs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadata.class, + com.google.cloud.vertexai.api.ExplanationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ExplanationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableInputs().clear(); + internalGetMutableOutputs().clear(); + featureAttributionsSchemaUri_ = ""; + latentSpaceSource_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationMetadataProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplanationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata build() { + com.google.cloud.vertexai.api.ExplanationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata buildPartial() { + com.google.cloud.vertexai.api.ExplanationMetadata result = + new com.google.cloud.vertexai.api.ExplanationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.ExplanationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.inputs_ = internalGetInputs(); + result.inputs_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.outputs_ = internalGetOutputs(); + result.outputs_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.featureAttributionsSchemaUri_ = featureAttributionsSchemaUri_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.latentSpaceSource_ = latentSpaceSource_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExplanationMetadata) { + return mergeFrom((com.google.cloud.vertexai.api.ExplanationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ExplanationMetadata other) { + if (other == com.google.cloud.vertexai.api.ExplanationMetadata.getDefaultInstance()) + return this; + internalGetMutableInputs().mergeFrom(other.internalGetInputs()); + bitField0_ |= 0x00000001; + internalGetMutableOutputs().mergeFrom(other.internalGetOutputs()); + bitField0_ |= 0x00000002; + if (!other.getFeatureAttributionsSchemaUri().isEmpty()) { + featureAttributionsSchemaUri_ = other.featureAttributionsSchemaUri_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getLatentSpaceSource().isEmpty()) { + latentSpaceSource_ = other.latentSpaceSource_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + inputs__ = + input.readMessage( + InputsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableInputs() + .getMutableMap() + .put(inputs__.getKey(), inputs__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + outputs__ = + input.readMessage( + OutputsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableOutputs() + .getMutableMap() + .put(outputs__.getKey(), outputs__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + featureAttributionsSchemaUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + latentSpaceSource_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + inputs_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + internalGetInputs() { + if (inputs_ == null) { + return com.google.protobuf.MapField.emptyMapField(InputsDefaultEntryHolder.defaultEntry); + } + return inputs_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + internalGetMutableInputs() { + if (inputs_ == null) { + inputs_ = com.google.protobuf.MapField.newMapField(InputsDefaultEntryHolder.defaultEntry); + } + if (!inputs_.isMutable()) { + inputs_ = inputs_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return inputs_; + } + + public int getInputsCount() { + return internalGetInputs().getMap().size(); + } + /** + * + * + *
+     * Required. Map from feature names to feature input metadata. Keys are the
+     * name of the features. Values are the specification of the feature.
+     *
+     * An empty InputMetadata is valid. It describes a text feature which has the
+     * name specified as the key in
+     * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * The baseline of the empty feature is chosen by Vertex AI.
+     *
+     * For Vertex AI-provided Tensorflow images, the key can be any friendly
+     * name of the feature. Once specified,
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * are keyed by this key (if not grouped with another feature).
+     *
+     * For custom images, the key must match with the key in
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsInputs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetInputs().getMap().containsKey(key); + } + /** Use {@link #getInputsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + getInputs() { + return getInputsMap(); + } + /** + * + * + *
+     * Required. Map from feature names to feature input metadata. Keys are the
+     * name of the features. Values are the specification of the feature.
+     *
+     * An empty InputMetadata is valid. It describes a text feature which has the
+     * name specified as the key in
+     * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * The baseline of the empty feature is chosen by Vertex AI.
+     *
+     * For Vertex AI-provided Tensorflow images, the key can be any friendly
+     * name of the feature. Once specified,
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * are keyed by this key (if not grouped with another feature).
+     *
+     * For custom images, the key must match with the key in
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + getInputsMap() { + return internalGetInputs().getMap(); + } + /** + * + * + *
+     * Required. Map from feature names to feature input metadata. Keys are the
+     * name of the features. Values are the specification of the feature.
+     *
+     * An empty InputMetadata is valid. It describes a text feature which has the
+     * name specified as the key in
+     * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * The baseline of the empty feature is chosen by Vertex AI.
+     *
+     * For Vertex AI-provided Tensorflow images, the key can be any friendly
+     * name of the feature. Once specified,
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * are keyed by this key (if not grouped with another feature).
+     *
+     * For custom images, the key must match with the key in
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata + getInputsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + map = internalGetInputs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Required. Map from feature names to feature input metadata. Keys are the
+     * name of the features. Values are the specification of the feature.
+     *
+     * An empty InputMetadata is valid. It describes a text feature which has the
+     * name specified as the key in
+     * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * The baseline of the empty feature is chosen by Vertex AI.
+     *
+     * For Vertex AI-provided Tensorflow images, the key can be any friendly
+     * name of the feature. Once specified,
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * are keyed by this key (if not grouped with another feature).
+     *
+     * For custom images, the key must match with the key in
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata getInputsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + map = internalGetInputs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearInputs() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableInputs().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Required. Map from feature names to feature input metadata. Keys are the
+     * name of the features. Values are the specification of the feature.
+     *
+     * An empty InputMetadata is valid. It describes a text feature which has the
+     * name specified as the key in
+     * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * The baseline of the empty feature is chosen by Vertex AI.
+     *
+     * For Vertex AI-provided Tensorflow images, the key can be any friendly
+     * name of the feature. Once specified,
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * are keyed by this key (if not grouped with another feature).
+     *
+     * For custom images, the key must match with the key in
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeInputs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableInputs().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + getMutableInputs() { + bitField0_ |= 0x00000001; + return internalGetMutableInputs().getMutableMap(); + } + /** + * + * + *
+     * Required. Map from feature names to feature input metadata. Keys are the
+     * name of the features. Values are the specification of the feature.
+     *
+     * An empty InputMetadata is valid. It describes a text feature which has the
+     * name specified as the key in
+     * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * The baseline of the empty feature is chosen by Vertex AI.
+     *
+     * For Vertex AI-provided Tensorflow images, the key can be any friendly
+     * name of the feature. Once specified,
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * are keyed by this key (if not grouped with another feature).
+     *
+     * For custom images, the key must match with the key in
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putInputs( + java.lang.String key, + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableInputs().getMutableMap().put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+     * Required. Map from feature names to feature input metadata. Keys are the
+     * name of the features. Values are the specification of the feature.
+     *
+     * An empty InputMetadata is valid. It describes a text feature which has the
+     * name specified as the key in
+     * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * The baseline of the empty feature is chosen by Vertex AI.
+     *
+     * For Vertex AI-provided Tensorflow images, the key can be any friendly
+     * name of the feature. Once specified,
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * are keyed by this key (if not grouped with another feature).
+     *
+     * For custom images, the key must match with the key in
+     * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putAllInputs( + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata> + values) { + internalGetMutableInputs().getMutableMap().putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + outputs_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + internalGetOutputs() { + if (outputs_ == null) { + return com.google.protobuf.MapField.emptyMapField(OutputsDefaultEntryHolder.defaultEntry); + } + return outputs_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + internalGetMutableOutputs() { + if (outputs_ == null) { + outputs_ = com.google.protobuf.MapField.newMapField(OutputsDefaultEntryHolder.defaultEntry); + } + if (!outputs_.isMutable()) { + outputs_ = outputs_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return outputs_; + } + + public int getOutputsCount() { + return internalGetOutputs().getMap().size(); + } + /** + * + * + *
+     * Required. Map from output names to output metadata.
+     *
+     * For Vertex AI-provided Tensorflow images, keys can be any user defined
+     * string that consists of any UTF-8 characters.
+     *
+     * For custom images, keys are the name of the output field in the prediction
+     * to be explained.
+     *
+     * Currently only one key is allowed.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsOutputs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetOutputs().getMap().containsKey(key); + } + /** Use {@link #getOutputsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + getOutputs() { + return getOutputsMap(); + } + /** + * + * + *
+     * Required. Map from output names to output metadata.
+     *
+     * For Vertex AI-provided Tensorflow images, keys can be any user defined
+     * string that consists of any UTF-8 characters.
+     *
+     * For custom images, keys are the name of the output field in the prediction
+     * to be explained.
+     *
+     * Currently only one key is allowed.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + getOutputsMap() { + return internalGetOutputs().getMap(); + } + /** + * + * + *
+     * Required. Map from output names to output metadata.
+     *
+     * For Vertex AI-provided Tensorflow images, keys can be any user defined
+     * string that consists of any UTF-8 characters.
+     *
+     * For custom images, keys are the name of the output field in the prediction
+     * to be explained.
+     *
+     * Currently only one key is allowed.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata + getOutputsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + map = internalGetOutputs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Required. Map from output names to output metadata.
+     *
+     * For Vertex AI-provided Tensorflow images, keys can be any user defined
+     * string that consists of any UTF-8 characters.
+     *
+     * For custom images, keys are the name of the output field in the prediction
+     * to be explained.
+     *
+     * Currently only one key is allowed.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata getOutputsOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + map = internalGetOutputs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearOutputs() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableOutputs().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Required. Map from output names to output metadata.
+     *
+     * For Vertex AI-provided Tensorflow images, keys can be any user defined
+     * string that consists of any UTF-8 characters.
+     *
+     * For custom images, keys are the name of the output field in the prediction
+     * to be explained.
+     *
+     * Currently only one key is allowed.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeOutputs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableOutputs().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + getMutableOutputs() { + bitField0_ |= 0x00000002; + return internalGetMutableOutputs().getMutableMap(); + } + /** + * + * + *
+     * Required. Map from output names to output metadata.
+     *
+     * For Vertex AI-provided Tensorflow images, keys can be any user defined
+     * string that consists of any UTF-8 characters.
+     *
+     * For custom images, keys are the name of the output field in the prediction
+     * to be explained.
+     *
+     * Currently only one key is allowed.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putOutputs( + java.lang.String key, + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableOutputs().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+     * Required. Map from output names to output metadata.
+     *
+     * For Vertex AI-provided Tensorflow images, keys can be any user defined
+     * string that consists of any UTF-8 characters.
+     *
+     * For custom images, keys are the name of the output field in the prediction
+     * to be explained.
+     *
+     * Currently only one key is allowed.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putAllOutputs( + java.util.Map< + java.lang.String, com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata> + values) { + internalGetMutableOutputs().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; + return this; + } + + private java.lang.Object featureAttributionsSchemaUri_ = ""; + /** + * + * + *
+     * Points to a YAML file stored on Google Cloud Storage describing the format
+     * of the [feature
+     * attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     * The schema is defined as an OpenAPI 3.0.2 [Schema
+     * Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
+     * AutoML tabular Models always have this field populated by Vertex AI.
+     * Note: The URI given on output may be different, including the URI scheme,
+     * than the one given on input. The output URI will point to a location where
+     * the user only has a read access.
+     * 
+ * + * string feature_attributions_schema_uri = 3; + * + * @return The featureAttributionsSchemaUri. + */ + public java.lang.String getFeatureAttributionsSchemaUri() { + java.lang.Object ref = featureAttributionsSchemaUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + featureAttributionsSchemaUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Points to a YAML file stored on Google Cloud Storage describing the format
+     * of the [feature
+     * attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     * The schema is defined as an OpenAPI 3.0.2 [Schema
+     * Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
+     * AutoML tabular Models always have this field populated by Vertex AI.
+     * Note: The URI given on output may be different, including the URI scheme,
+     * than the one given on input. The output URI will point to a location where
+     * the user only has a read access.
+     * 
+ * + * string feature_attributions_schema_uri = 3; + * + * @return The bytes for featureAttributionsSchemaUri. + */ + public com.google.protobuf.ByteString getFeatureAttributionsSchemaUriBytes() { + java.lang.Object ref = featureAttributionsSchemaUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + featureAttributionsSchemaUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Points to a YAML file stored on Google Cloud Storage describing the format
+     * of the [feature
+     * attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     * The schema is defined as an OpenAPI 3.0.2 [Schema
+     * Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
+     * AutoML tabular Models always have this field populated by Vertex AI.
+     * Note: The URI given on output may be different, including the URI scheme,
+     * than the one given on input. The output URI will point to a location where
+     * the user only has a read access.
+     * 
+ * + * string feature_attributions_schema_uri = 3; + * + * @param value The featureAttributionsSchemaUri to set. + * @return This builder for chaining. + */ + public Builder setFeatureAttributionsSchemaUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + featureAttributionsSchemaUri_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Points to a YAML file stored on Google Cloud Storage describing the format
+     * of the [feature
+     * attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     * The schema is defined as an OpenAPI 3.0.2 [Schema
+     * Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
+     * AutoML tabular Models always have this field populated by Vertex AI.
+     * Note: The URI given on output may be different, including the URI scheme,
+     * than the one given on input. The output URI will point to a location where
+     * the user only has a read access.
+     * 
+ * + * string feature_attributions_schema_uri = 3; + * + * @return This builder for chaining. + */ + public Builder clearFeatureAttributionsSchemaUri() { + featureAttributionsSchemaUri_ = getDefaultInstance().getFeatureAttributionsSchemaUri(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Points to a YAML file stored on Google Cloud Storage describing the format
+     * of the [feature
+     * attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+     * The schema is defined as an OpenAPI 3.0.2 [Schema
+     * Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
+     * AutoML tabular Models always have this field populated by Vertex AI.
+     * Note: The URI given on output may be different, including the URI scheme,
+     * than the one given on input. The output URI will point to a location where
+     * the user only has a read access.
+     * 
+ * + * string feature_attributions_schema_uri = 3; + * + * @param value The bytes for featureAttributionsSchemaUri to set. + * @return This builder for chaining. + */ + public Builder setFeatureAttributionsSchemaUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + featureAttributionsSchemaUri_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object latentSpaceSource_ = ""; + /** + * + * + *
+     * Name of the source to generate embeddings for example based explanations.
+     * 
+ * + * string latent_space_source = 5; + * + * @return The latentSpaceSource. + */ + public java.lang.String getLatentSpaceSource() { + java.lang.Object ref = latentSpaceSource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + latentSpaceSource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the source to generate embeddings for example based explanations.
+     * 
+ * + * string latent_space_source = 5; + * + * @return The bytes for latentSpaceSource. + */ + public com.google.protobuf.ByteString getLatentSpaceSourceBytes() { + java.lang.Object ref = latentSpaceSource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + latentSpaceSource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the source to generate embeddings for example based explanations.
+     * 
+ * + * string latent_space_source = 5; + * + * @param value The latentSpaceSource to set. + * @return This builder for chaining. + */ + public Builder setLatentSpaceSource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + latentSpaceSource_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the source to generate embeddings for example based explanations.
+     * 
+ * + * string latent_space_source = 5; + * + * @return This builder for chaining. + */ + public Builder clearLatentSpaceSource() { + latentSpaceSource_ = getDefaultInstance().getLatentSpaceSource(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the source to generate embeddings for example based explanations.
+     * 
+ * + * string latent_space_source = 5; + * + * @param value The bytes for latentSpaceSource to set. + * @return This builder for chaining. + */ + public Builder setLatentSpaceSourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + latentSpaceSource_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplanationMetadata) + private static final com.google.cloud.vertexai.api.ExplanationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExplanationMetadata(); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplanationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataOrBuilder.java new file mode 100644 index 000000000000..9c2414c372e4 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataOrBuilder.java @@ -0,0 +1,343 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation_metadata.proto + +package com.google.cloud.vertexai.api; + +public interface ExplanationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplanationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Map from feature names to feature input metadata. Keys are the
+   * name of the features. Values are the specification of the feature.
+   *
+   * An empty InputMetadata is valid. It describes a text feature which has the
+   * name specified as the key in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The baseline of the empty feature is chosen by Vertex AI.
+   *
+   * For Vertex AI-provided Tensorflow images, the key can be any friendly
+   * name of the feature. Once specified,
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * are keyed by this key (if not grouped with another feature).
+   *
+   * For custom images, the key must match with the key in
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getInputsCount(); + /** + * + * + *
+   * Required. Map from feature names to feature input metadata. Keys are the
+   * name of the features. Values are the specification of the feature.
+   *
+   * An empty InputMetadata is valid. It describes a text feature which has the
+   * name specified as the key in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The baseline of the empty feature is chosen by Vertex AI.
+   *
+   * For Vertex AI-provided Tensorflow images, the key can be any friendly
+   * name of the feature. Once specified,
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * are keyed by this key (if not grouped with another feature).
+   *
+   * For custom images, the key must match with the key in
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean containsInputs(java.lang.String key); + /** Use {@link #getInputsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getInputs(); + /** + * + * + *
+   * Required. Map from feature names to feature input metadata. Keys are the
+   * name of the features. Values are the specification of the feature.
+   *
+   * An empty InputMetadata is valid. It describes a text feature which has the
+   * name specified as the key in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The baseline of the empty feature is chosen by Vertex AI.
+   *
+   * For Vertex AI-provided Tensorflow images, the key can be any friendly
+   * name of the feature. Once specified,
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * are keyed by this key (if not grouped with another feature).
+   *
+   * For custom images, the key must match with the key in
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.Map + getInputsMap(); + /** + * + * + *
+   * Required. Map from feature names to feature input metadata. Keys are the
+   * name of the features. Values are the specification of the feature.
+   *
+   * An empty InputMetadata is valid. It describes a text feature which has the
+   * name specified as the key in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The baseline of the empty feature is chosen by Vertex AI.
+   *
+   * For Vertex AI-provided Tensorflow images, the key can be any friendly
+   * name of the feature. Once specified,
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * are keyed by this key (if not grouped with another feature).
+   *
+   * For custom images, the key must match with the key in
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata getInputsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata defaultValue); + /** + * + * + *
+   * Required. Map from feature names to feature input metadata. Keys are the
+   * name of the features. Values are the specification of the feature.
+   *
+   * An empty InputMetadata is valid. It describes a text feature which has the
+   * name specified as the key in
+   * [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+   * The baseline of the empty feature is chosen by Vertex AI.
+   *
+   * For Vertex AI-provided Tensorflow images, the key can be any friendly
+   * name of the feature. Once specified,
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * are keyed by this key (if not grouped with another feature).
+   *
+   * For custom images, the key must match with the key in
+   * [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances].
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.ExplanationMetadata.InputMetadata getInputsOrThrow( + java.lang.String key); + + /** + * + * + *
+   * Required. Map from output names to output metadata.
+   *
+   * For Vertex AI-provided Tensorflow images, keys can be any user defined
+   * string that consists of any UTF-8 characters.
+   *
+   * For custom images, keys are the name of the output field in the prediction
+   * to be explained.
+   *
+   * Currently only one key is allowed.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getOutputsCount(); + /** + * + * + *
+   * Required. Map from output names to output metadata.
+   *
+   * For Vertex AI-provided Tensorflow images, keys can be any user defined
+   * string that consists of any UTF-8 characters.
+   *
+   * For custom images, keys are the name of the output field in the prediction
+   * to be explained.
+   *
+   * Currently only one key is allowed.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean containsOutputs(java.lang.String key); + /** Use {@link #getOutputsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getOutputs(); + /** + * + * + *
+   * Required. Map from output names to output metadata.
+   *
+   * For Vertex AI-provided Tensorflow images, keys can be any user defined
+   * string that consists of any UTF-8 characters.
+   *
+   * For custom images, keys are the name of the output field in the prediction
+   * to be explained.
+   *
+   * Currently only one key is allowed.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.Map + getOutputsMap(); + /** + * + * + *
+   * Required. Map from output names to output metadata.
+   *
+   * For Vertex AI-provided Tensorflow images, keys can be any user defined
+   * string that consists of any UTF-8 characters.
+   *
+   * For custom images, keys are the name of the output field in the prediction
+   * to be explained.
+   *
+   * Currently only one key is allowed.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata getOutputsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata defaultValue); + /** + * + * + *
+   * Required. Map from output names to output metadata.
+   *
+   * For Vertex AI-provided Tensorflow images, keys can be any user defined
+   * string that consists of any UTF-8 characters.
+   *
+   * For custom images, keys are the name of the output field in the prediction
+   * to be explained.
+   *
+   * Currently only one key is allowed.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadata.OutputMetadata> outputs = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.ExplanationMetadata.OutputMetadata getOutputsOrThrow( + java.lang.String key); + + /** + * + * + *
+   * Points to a YAML file stored on Google Cloud Storage describing the format
+   * of the [feature
+   * attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+   * The schema is defined as an OpenAPI 3.0.2 [Schema
+   * Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
+   * AutoML tabular Models always have this field populated by Vertex AI.
+   * Note: The URI given on output may be different, including the URI scheme,
+   * than the one given on input. The output URI will point to a location where
+   * the user only has a read access.
+   * 
+ * + * string feature_attributions_schema_uri = 3; + * + * @return The featureAttributionsSchemaUri. + */ + java.lang.String getFeatureAttributionsSchemaUri(); + /** + * + * + *
+   * Points to a YAML file stored on Google Cloud Storage describing the format
+   * of the [feature
+   * attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions].
+   * The schema is defined as an OpenAPI 3.0.2 [Schema
+   * Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
+   * AutoML tabular Models always have this field populated by Vertex AI.
+   * Note: The URI given on output may be different, including the URI scheme,
+   * than the one given on input. The output URI will point to a location where
+   * the user only has a read access.
+   * 
+ * + * string feature_attributions_schema_uri = 3; + * + * @return The bytes for featureAttributionsSchemaUri. + */ + com.google.protobuf.ByteString getFeatureAttributionsSchemaUriBytes(); + + /** + * + * + *
+   * Name of the source to generate embeddings for example based explanations.
+   * 
+ * + * string latent_space_source = 5; + * + * @return The latentSpaceSource. + */ + java.lang.String getLatentSpaceSource(); + /** + * + * + *
+   * Name of the source to generate embeddings for example based explanations.
+   * 
+ * + * string latent_space_source = 5; + * + * @return The bytes for latentSpaceSource. + */ + com.google.protobuf.ByteString getLatentSpaceSourceBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataOverride.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataOverride.java new file mode 100644 index 000000000000..a51637e2b616 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataOverride.java @@ -0,0 +1,2084 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The
+ * [ExplanationMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata]
+ * entries that can be overridden at [online
+ * explanation][google.cloud.vertexai.v1beta1.PredictionService.Explain] time.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationMetadataOverride} + */ +public final class ExplanationMetadataOverride extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplanationMetadataOverride) + ExplanationMetadataOverrideOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplanationMetadataOverride.newBuilder() to construct. + private ExplanationMetadataOverride(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplanationMetadataOverride() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplanationMetadataOverride(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetInputs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadataOverride.class, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.Builder.class); + } + + public interface InputMetadataOverrideOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * This overrides the `input_baseline` field of the
+     * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * object of the corresponding feature's input metadata. If it's not
+     * specified, the original baselines are not overridden.
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + java.util.List getInputBaselinesList(); + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * This overrides the `input_baseline` field of the
+     * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * object of the corresponding feature's input metadata. If it's not
+     * specified, the original baselines are not overridden.
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + com.google.protobuf.Value getInputBaselines(int index); + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * This overrides the `input_baseline` field of the
+     * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * object of the corresponding feature's input metadata. If it's not
+     * specified, the original baselines are not overridden.
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + int getInputBaselinesCount(); + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * This overrides the `input_baseline` field of the
+     * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * object of the corresponding feature's input metadata. If it's not
+     * specified, the original baselines are not overridden.
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + java.util.List getInputBaselinesOrBuilderList(); + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * This overrides the `input_baseline` field of the
+     * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * object of the corresponding feature's input metadata. If it's not
+     * specified, the original baselines are not overridden.
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + com.google.protobuf.ValueOrBuilder getInputBaselinesOrBuilder(int index); + } + /** + * + * + *
+   * The [input
+   * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+   * entries to be overridden.
+   * 
+ * + * Protobuf type {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride} + */ + public static final class InputMetadataOverride extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride) + InputMetadataOverrideOrBuilder { + private static final long serialVersionUID = 0L; + // Use InputMetadataOverride.newBuilder() to construct. + private InputMetadataOverride(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InputMetadataOverride() { + inputBaselines_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InputMetadataOverride(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputMetadataOverride_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputMetadataOverride_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride.class, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + .Builder.class); + } + + public static final int INPUT_BASELINES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List inputBaselines_; + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * This overrides the `input_baseline` field of the
+     * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * object of the corresponding feature's input metadata. If it's not
+     * specified, the original baselines are not overridden.
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + @java.lang.Override + public java.util.List getInputBaselinesList() { + return inputBaselines_; + } + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * This overrides the `input_baseline` field of the
+     * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * object of the corresponding feature's input metadata. If it's not
+     * specified, the original baselines are not overridden.
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + @java.lang.Override + public java.util.List + getInputBaselinesOrBuilderList() { + return inputBaselines_; + } + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * This overrides the `input_baseline` field of the
+     * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * object of the corresponding feature's input metadata. If it's not
+     * specified, the original baselines are not overridden.
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + @java.lang.Override + public int getInputBaselinesCount() { + return inputBaselines_.size(); + } + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * This overrides the `input_baseline` field of the
+     * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * object of the corresponding feature's input metadata. If it's not
+     * specified, the original baselines are not overridden.
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + @java.lang.Override + public com.google.protobuf.Value getInputBaselines(int index) { + return inputBaselines_.get(index); + } + /** + * + * + *
+     * Baseline inputs for this feature.
+     *
+     * This overrides the `input_baseline` field of the
+     * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * object of the corresponding feature's input metadata. If it's not
+     * specified, the original baselines are not overridden.
+     * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getInputBaselinesOrBuilder(int index) { + return inputBaselines_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < inputBaselines_.size(); i++) { + output.writeMessage(1, inputBaselines_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < inputBaselines_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, inputBaselines_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride other = + (com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride) obj; + + if (!getInputBaselinesList().equals(other.getInputBaselinesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInputBaselinesCount() > 0) { + hash = (37 * hash) + INPUT_BASELINES_FIELD_NUMBER; + hash = (53 * hash) + getInputBaselinesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The [input
+     * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+     * entries to be overridden.
+     * 
+ * + * Protobuf type {@code + * google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride) + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverrideOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputMetadataOverride_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputMetadataOverride_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + .class, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + .Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (inputBaselinesBuilder_ == null) { + inputBaselines_ = java.util.Collections.emptyList(); + } else { + inputBaselines_ = null; + inputBaselinesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputMetadataOverride_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + build() { + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + buildPartial() { + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride result = + new com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride( + this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride result) { + if (inputBaselinesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + inputBaselines_ = java.util.Collections.unmodifiableList(inputBaselines_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.inputBaselines_ = inputBaselines_; + } else { + result.inputBaselines_ = inputBaselinesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride) { + return mergeFrom( + (com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride other) { + if (other + == com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + .getDefaultInstance()) return this; + if (inputBaselinesBuilder_ == null) { + if (!other.inputBaselines_.isEmpty()) { + if (inputBaselines_.isEmpty()) { + inputBaselines_ = other.inputBaselines_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInputBaselinesIsMutable(); + inputBaselines_.addAll(other.inputBaselines_); + } + onChanged(); + } + } else { + if (!other.inputBaselines_.isEmpty()) { + if (inputBaselinesBuilder_.isEmpty()) { + inputBaselinesBuilder_.dispose(); + inputBaselinesBuilder_ = null; + inputBaselines_ = other.inputBaselines_; + bitField0_ = (bitField0_ & ~0x00000001); + inputBaselinesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInputBaselinesFieldBuilder() + : null; + } else { + inputBaselinesBuilder_.addAllMessages(other.inputBaselines_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Value m = + input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + inputBaselines_.add(m); + } else { + inputBaselinesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List inputBaselines_ = + java.util.Collections.emptyList(); + + private void ensureInputBaselinesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + inputBaselines_ = new java.util.ArrayList(inputBaselines_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + inputBaselinesBuilder_; + + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public java.util.List getInputBaselinesList() { + if (inputBaselinesBuilder_ == null) { + return java.util.Collections.unmodifiableList(inputBaselines_); + } else { + return inputBaselinesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public int getInputBaselinesCount() { + if (inputBaselinesBuilder_ == null) { + return inputBaselines_.size(); + } else { + return inputBaselinesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public com.google.protobuf.Value getInputBaselines(int index) { + if (inputBaselinesBuilder_ == null) { + return inputBaselines_.get(index); + } else { + return inputBaselinesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder setInputBaselines(int index, com.google.protobuf.Value value) { + if (inputBaselinesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputBaselinesIsMutable(); + inputBaselines_.set(index, value); + onChanged(); + } else { + inputBaselinesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder setInputBaselines( + int index, com.google.protobuf.Value.Builder builderForValue) { + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + inputBaselines_.set(index, builderForValue.build()); + onChanged(); + } else { + inputBaselinesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder addInputBaselines(com.google.protobuf.Value value) { + if (inputBaselinesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputBaselinesIsMutable(); + inputBaselines_.add(value); + onChanged(); + } else { + inputBaselinesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder addInputBaselines(int index, com.google.protobuf.Value value) { + if (inputBaselinesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputBaselinesIsMutable(); + inputBaselines_.add(index, value); + onChanged(); + } else { + inputBaselinesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder addInputBaselines(com.google.protobuf.Value.Builder builderForValue) { + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + inputBaselines_.add(builderForValue.build()); + onChanged(); + } else { + inputBaselinesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder addInputBaselines( + int index, com.google.protobuf.Value.Builder builderForValue) { + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + inputBaselines_.add(index, builderForValue.build()); + onChanged(); + } else { + inputBaselinesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder addAllInputBaselines( + java.lang.Iterable values) { + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inputBaselines_); + onChanged(); + } else { + inputBaselinesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder clearInputBaselines() { + if (inputBaselinesBuilder_ == null) { + inputBaselines_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + inputBaselinesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public Builder removeInputBaselines(int index) { + if (inputBaselinesBuilder_ == null) { + ensureInputBaselinesIsMutable(); + inputBaselines_.remove(index); + onChanged(); + } else { + inputBaselinesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public com.google.protobuf.Value.Builder getInputBaselinesBuilder(int index) { + return getInputBaselinesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public com.google.protobuf.ValueOrBuilder getInputBaselinesOrBuilder(int index) { + if (inputBaselinesBuilder_ == null) { + return inputBaselines_.get(index); + } else { + return inputBaselinesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public java.util.List + getInputBaselinesOrBuilderList() { + if (inputBaselinesBuilder_ != null) { + return inputBaselinesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inputBaselines_); + } + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public com.google.protobuf.Value.Builder addInputBaselinesBuilder() { + return getInputBaselinesFieldBuilder() + .addBuilder(com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public com.google.protobuf.Value.Builder addInputBaselinesBuilder(int index) { + return getInputBaselinesFieldBuilder() + .addBuilder(index, com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+       * Baseline inputs for this feature.
+       *
+       * This overrides the `input_baseline` field of the
+       * [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata]
+       * object of the corresponding feature's input metadata. If it's not
+       * specified, the original baselines are not overridden.
+       * 
+ * + * repeated .google.protobuf.Value input_baselines = 1; + */ + public java.util.List getInputBaselinesBuilderList() { + return getInputBaselinesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getInputBaselinesFieldBuilder() { + if (inputBaselinesBuilder_ == null) { + inputBaselinesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + inputBaselines_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + inputBaselines_ = null; + } + return inputBaselinesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride) + private static final com.google.cloud.vertexai.api.ExplanationMetadataOverride + .InputMetadataOverride + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride(); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InputMetadataOverride parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int INPUTS_FIELD_NUMBER = 1; + + private static final class InputsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.vertexai.api.ExplanationMetadataOverride + .InputMetadataOverride.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + inputs_; + + private com.google.protobuf.MapField< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + internalGetInputs() { + if (inputs_ == null) { + return com.google.protobuf.MapField.emptyMapField(InputsDefaultEntryHolder.defaultEntry); + } + return inputs_; + } + + public int getInputsCount() { + return internalGetInputs().getMap().size(); + } + /** + * + * + *
+   * Required. Overrides the [input
+   * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+   * the features. The key is the name of the feature to be overridden. The keys
+   * specified here must exist in the input metadata to be overridden. If a
+   * feature is not specified here, the corresponding feature's input metadata
+   * is not overridden.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsInputs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetInputs().getMap().containsKey(key); + } + /** Use {@link #getInputsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + getInputs() { + return getInputsMap(); + } + /** + * + * + *
+   * Required. Overrides the [input
+   * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+   * the features. The key is the name of the feature to be overridden. The keys
+   * specified here must exist in the input metadata to be overridden. If a
+   * feature is not specified here, the corresponding feature's input metadata
+   * is not overridden.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + getInputsMap() { + return internalGetInputs().getMap(); + } + /** + * + * + *
+   * Required. Overrides the [input
+   * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+   * the features. The key is the name of the feature to be overridden. The keys
+   * specified here must exist in the input metadata to be overridden. If a
+   * feature is not specified here, the corresponding feature's input metadata
+   * is not overridden.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.ExplanationMetadataOverride + .InputMetadataOverride + getInputsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + map = internalGetInputs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Required. Overrides the [input
+   * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+   * the features. The key is the name of the feature to be overridden. The keys
+   * specified here must exist in the input metadata to be overridden. If a
+   * feature is not specified here, the corresponding feature's input metadata
+   * is not overridden.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + getInputsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + map = internalGetInputs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetInputs(), InputsDefaultEntryHolder.defaultEntry, 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + entry : internalGetInputs().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + inputs__ = + InputsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, inputs__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExplanationMetadataOverride)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplanationMetadataOverride other = + (com.google.cloud.vertexai.api.ExplanationMetadataOverride) obj; + + if (!internalGetInputs().equals(other.internalGetInputs())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetInputs().getMap().isEmpty()) { + hash = (37 * hash) + INPUTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetInputs().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.ExplanationMetadataOverride prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The
+   * [ExplanationMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata]
+   * entries that can be overridden at [online
+   * explanation][google.cloud.vertexai.v1beta1.PredictionService.Explain] time.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationMetadataOverride} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplanationMetadataOverride) + com.google.cloud.vertexai.api.ExplanationMetadataOverrideOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetInputs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableInputs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationMetadataOverride.class, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ExplanationMetadataOverride.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableInputs().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplanationMetadataOverride.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride build() { + com.google.cloud.vertexai.api.ExplanationMetadataOverride result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride buildPartial() { + com.google.cloud.vertexai.api.ExplanationMetadataOverride result = + new com.google.cloud.vertexai.api.ExplanationMetadataOverride(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.ExplanationMetadataOverride result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.inputs_ = internalGetInputs(); + result.inputs_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExplanationMetadataOverride) { + return mergeFrom((com.google.cloud.vertexai.api.ExplanationMetadataOverride) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ExplanationMetadataOverride other) { + if (other == com.google.cloud.vertexai.api.ExplanationMetadataOverride.getDefaultInstance()) + return this; + internalGetMutableInputs().mergeFrom(other.internalGetInputs()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.MapEntry< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride + .InputMetadataOverride> + inputs__ = + input.readMessage( + InputsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableInputs() + .getMutableMap() + .put(inputs__.getKey(), inputs__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + inputs_; + + private com.google.protobuf.MapField< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + internalGetInputs() { + if (inputs_ == null) { + return com.google.protobuf.MapField.emptyMapField(InputsDefaultEntryHolder.defaultEntry); + } + return inputs_; + } + + private com.google.protobuf.MapField< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + internalGetMutableInputs() { + if (inputs_ == null) { + inputs_ = com.google.protobuf.MapField.newMapField(InputsDefaultEntryHolder.defaultEntry); + } + if (!inputs_.isMutable()) { + inputs_ = inputs_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return inputs_; + } + + public int getInputsCount() { + return internalGetInputs().getMap().size(); + } + /** + * + * + *
+     * Required. Overrides the [input
+     * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+     * the features. The key is the name of the feature to be overridden. The keys
+     * specified here must exist in the input metadata to be overridden. If a
+     * feature is not specified here, the corresponding feature's input metadata
+     * is not overridden.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsInputs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetInputs().getMap().containsKey(key); + } + /** Use {@link #getInputsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + getInputs() { + return getInputsMap(); + } + /** + * + * + *
+     * Required. Overrides the [input
+     * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+     * the features. The key is the name of the feature to be overridden. The keys
+     * specified here must exist in the input metadata to be overridden. If a
+     * feature is not specified here, the corresponding feature's input metadata
+     * is not overridden.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + getInputsMap() { + return internalGetInputs().getMap(); + } + /** + * + * + *
+     * Required. Overrides the [input
+     * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+     * the features. The key is the name of the feature to be overridden. The keys
+     * specified here must exist in the input metadata to be overridden. If a
+     * feature is not specified here, the corresponding feature's input metadata
+     * is not overridden.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.ExplanationMetadataOverride + .InputMetadataOverride + getInputsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + map = internalGetInputs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Required. Overrides the [input
+     * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+     * the features. The key is the name of the feature to be overridden. The keys
+     * specified here must exist in the input metadata to be overridden. If a
+     * feature is not specified here, the corresponding feature's input metadata
+     * is not overridden.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + getInputsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + map = internalGetInputs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearInputs() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableInputs().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Required. Overrides the [input
+     * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+     * the features. The key is the name of the feature to be overridden. The keys
+     * specified here must exist in the input metadata to be overridden. If a
+     * feature is not specified here, the corresponding feature's input metadata
+     * is not overridden.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeInputs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableInputs().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + getMutableInputs() { + bitField0_ |= 0x00000001; + return internalGetMutableInputs().getMutableMap(); + } + /** + * + * + *
+     * Required. Overrides the [input
+     * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+     * the features. The key is the name of the feature to be overridden. The keys
+     * specified here must exist in the input metadata to be overridden. If a
+     * feature is not specified here, the corresponding feature's input metadata
+     * is not overridden.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putInputs( + java.lang.String key, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableInputs().getMutableMap().put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+     * Required. Overrides the [input
+     * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+     * the features. The key is the name of the feature to be overridden. The keys
+     * specified here must exist in the input metadata to be overridden. If a
+     * feature is not specified here, the corresponding feature's input metadata
+     * is not overridden.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putAllInputs( + java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + values) { + internalGetMutableInputs().getMutableMap().putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplanationMetadataOverride) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplanationMetadataOverride) + private static final com.google.cloud.vertexai.api.ExplanationMetadataOverride DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExplanationMetadataOverride(); + } + + public static com.google.cloud.vertexai.api.ExplanationMetadataOverride getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplanationMetadataOverride parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataOverrideOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataOverrideOrBuilder.java new file mode 100644 index 000000000000..e30ac8d4291c --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataOverrideOrBuilder.java @@ -0,0 +1,127 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface ExplanationMetadataOverrideOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplanationMetadataOverride) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Overrides the [input
+   * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+   * the features. The key is the name of the feature to be overridden. The keys
+   * specified here must exist in the input metadata to be overridden. If a
+   * feature is not specified here, the corresponding feature's input metadata
+   * is not overridden.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getInputsCount(); + /** + * + * + *
+   * Required. Overrides the [input
+   * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+   * the features. The key is the name of the feature to be overridden. The keys
+   * specified here must exist in the input metadata to be overridden. If a
+   * feature is not specified here, the corresponding feature's input metadata
+   * is not overridden.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean containsInputs(java.lang.String key); + /** Use {@link #getInputsMap()} instead. */ + @java.lang.Deprecated + java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + getInputs(); + /** + * + * + *
+   * Required. Overrides the [input
+   * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+   * the features. The key is the name of the feature to be overridden. The keys
+   * specified here must exist in the input metadata to be overridden. If a
+   * feature is not specified here, the corresponding feature's input metadata
+   * is not overridden.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.Map< + java.lang.String, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride> + getInputsMap(); + /** + * + * + *
+   * Required. Overrides the [input
+   * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+   * the features. The key is the name of the feature to be overridden. The keys
+   * specified here must exist in the input metadata to be overridden. If a
+   * feature is not specified here, the corresponding feature's input metadata
+   * is not overridden.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + getInputsOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride + defaultValue); + /** + * + * + *
+   * Required. Overrides the [input
+   * metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of
+   * the features. The key is the name of the feature to be overridden. The keys
+   * specified here must exist in the input metadata to be overridden. If a
+   * feature is not specified here, the corresponding feature's input metadata
+   * is not overridden.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride.InputMetadataOverride> inputs = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.ExplanationMetadataOverride.InputMetadataOverride getInputsOrThrow( + java.lang.String key); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataProto.java new file mode 100644 index 000000000000..44a0954156ec --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationMetadataProto.java @@ -0,0 +1,243 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation_metadata.proto + +package com.google.cloud.vertexai.api; + +public final class ExplanationMetadataProto { + private ExplanationMetadataProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_FeatureValueDomain_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_FeatureValueDomain_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_Visualization_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_Visualization_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n8google/cloud/vertexai/v1beta1/explanat" + + "ion_metadata.proto\022\035google.cloud.vertexa" + + "i.v1beta1\032\037google/api/field_behavior.pro" + + "to\032\034google/protobuf/struct.proto\"\362\022\n\023Exp" + + "lanationMetadata\022T\n\006inputs\030\001 \003(\0132>.googl" + + "e.cloud.vertexai.v1beta1.ExplanationMeta" + + "data.InputsEntryB\004\342A\001\002\022V\n\007outputs\030\002 \003(\0132" + + "?.google.cloud.vertexai.v1beta1.Explanat" + + "ionMetadata.OutputsEntryB\004\342A\001\002\022\'\n\037featur" + + "e_attributions_schema_uri\030\003 \001(\t\022\033\n\023laten" + + "t_space_source\030\005 \001(\t\032\331\r\n\rInputMetadata\022/" + + "\n\017input_baselines\030\001 \003(\0132\026.google.protobu" + + "f.Value\022\031\n\021input_tensor_name\030\002 \001(\t\022[\n\010en" + + "coding\030\003 \001(\0162I.google.cloud.vertexai.v1b" + + "eta1.ExplanationMetadata.InputMetadata.E" + + "ncoding\022\020\n\010modality\030\004 \001(\t\022q\n\024feature_val" + + "ue_domain\030\005 \001(\0132S.google.cloud.vertexai." + + "v1beta1.ExplanationMetadata.InputMetadat" + + "a.FeatureValueDomain\022\033\n\023indices_tensor_n" + + "ame\030\006 \001(\t\022\037\n\027dense_shape_tensor_name\030\007 \001" + + "(\t\022\035\n\025index_feature_mapping\030\010 \003(\t\022\033\n\023enc" + + "oded_tensor_name\030\t \001(\t\0221\n\021encoded_baseli" + + "nes\030\n \003(\0132\026.google.protobuf.Value\022e\n\rvis" + + "ualization\030\013 \001(\0132N.google.cloud.vertexai" + + ".v1beta1.ExplanationMetadata.InputMetada" + + "ta.Visualization\022\022\n\ngroup_name\030\014 \001(\t\032j\n\022" + + "FeatureValueDomain\022\021\n\tmin_value\030\001 \001(\002\022\021\n" + + "\tmax_value\030\002 \001(\002\022\025\n\roriginal_mean\030\003 \001(\002\022" + + "\027\n\017original_stddev\030\004 \001(\002\032\342\006\n\rVisualizati" + + "on\022a\n\004type\030\001 \001(\0162S.google.cloud.vertexai" + + ".v1beta1.ExplanationMetadata.InputMetada" + + "ta.Visualization.Type\022i\n\010polarity\030\002 \001(\0162" + + "W.google.cloud.vertexai.v1beta1.Explanat" + + "ionMetadata.InputMetadata.Visualization." + + "Polarity\022j\n\tcolor_map\030\003 \001(\0162W.google.clo" + + "ud.vertexai.v1beta1.ExplanationMetadata." + + "InputMetadata.Visualization.ColorMap\022\037\n\027" + + "clip_percent_upperbound\030\004 \001(\002\022\037\n\027clip_pe" + + "rcent_lowerbound\030\005 \001(\002\022p\n\014overlay_type\030\006" + + " \001(\0162Z.google.cloud.vertexai.v1beta1.Exp" + + "lanationMetadata.InputMetadata.Visualiza" + + "tion.OverlayType\"6\n\004Type\022\024\n\020TYPE_UNSPECI" + + "FIED\020\000\022\n\n\006PIXELS\020\001\022\014\n\010OUTLINES\020\002\"J\n\010Pola" + + "rity\022\030\n\024POLARITY_UNSPECIFIED\020\000\022\014\n\010POSITI" + + "VE\020\001\022\014\n\010NEGATIVE\020\002\022\010\n\004BOTH\020\003\"{\n\010ColorMap" + + "\022\031\n\025COLOR_MAP_UNSPECIFIED\020\000\022\016\n\nPINK_GREE" + + "N\020\001\022\013\n\007VIRIDIS\020\002\022\007\n\003RED\020\003\022\t\n\005GREEN\020\004\022\r\n\t" + + "RED_GREEN\020\006\022\024\n\020PINK_WHITE_GREEN\020\005\"b\n\013Ove" + + "rlayType\022\034\n\030OVERLAY_TYPE_UNSPECIFIED\020\000\022\010" + + "\n\004NONE\020\001\022\014\n\010ORIGINAL\020\002\022\r\n\tGRAYSCALE\020\003\022\016\n" + + "\nMASK_BLACK\020\004\"\240\001\n\010Encoding\022\030\n\024ENCODING_U" + + "NSPECIFIED\020\000\022\014\n\010IDENTITY\020\001\022\023\n\017BAG_OF_FEA" + + "TURES\020\002\022\032\n\026BAG_OF_FEATURES_SPARSE\020\003\022\r\n\tI" + + "NDICATOR\020\004\022\026\n\022COMBINED_EMBEDDING\020\005\022\024\n\020CO" + + "NCAT_EMBEDDING\020\006\032\246\001\n\016OutputMetadata\022<\n\032i" + + "ndex_display_name_mapping\030\001 \001(\0132\026.google" + + ".protobuf.ValueH\000\022\"\n\030display_name_mappin" + + "g_key\030\002 \001(\tH\000\022\032\n\022output_tensor_name\030\003 \001(" + + "\tB\026\n\024display_name_mapping\032o\n\013InputsEntry" + + "\022\013\n\003key\030\001 \001(\t\022O\n\005value\030\002 \001(\0132@.google.cl" + + "oud.vertexai.v1beta1.ExplanationMetadata" + + ".InputMetadata:\0028\001\032q\n\014OutputsEntry\022\013\n\003ke" + + "y\030\001 \001(\t\022P\n\005value\030\002 \001(\0132A.google.cloud.ve" + + "rtexai.v1beta1.ExplanationMetadata.Outpu" + + "tMetadata:\0028\001B\335\001\n\035com.google.cloud.verte" + + "xai.apiB\030ExplanationMetadataProtoP\001Z=clo" + + "ud.google.com/go/vertexai/apiv1beta1/ver" + + "texaipb;vertexaipb\252\002\035Google.Cloud.Vertex" + + "AI.V1Beta1\312\002\035Google\\Cloud\\VertexAI\\V1bet" + + "a1\352\002 Google::Cloud::VertexAI::V1beta1b\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_descriptor, + new java.lang.String[] { + "Inputs", "Outputs", "FeatureAttributionsSchemaUri", "LatentSpaceSource", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_descriptor, + new java.lang.String[] { + "InputBaselines", + "InputTensorName", + "Encoding", + "Modality", + "FeatureValueDomain", + "IndicesTensorName", + "DenseShapeTensorName", + "IndexFeatureMapping", + "EncodedTensorName", + "EncodedBaselines", + "Visualization", + "GroupName", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_FeatureValueDomain_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_FeatureValueDomain_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_FeatureValueDomain_descriptor, + new java.lang.String[] { + "MinValue", "MaxValue", "OriginalMean", "OriginalStddev", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_Visualization_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_Visualization_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputMetadata_Visualization_descriptor, + new java.lang.String[] { + "Type", + "Polarity", + "ColorMap", + "ClipPercentUpperbound", + "ClipPercentLowerbound", + "OverlayType", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputMetadata_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputMetadata_descriptor, + new java.lang.String[] { + "IndexDisplayNameMapping", + "DisplayNameMappingKey", + "OutputTensorName", + "DisplayNameMapping", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputsEntry_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_InputsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputsEntry_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadata_OutputsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationOrBuilder.java new file mode 100644 index 000000000000..f3d6581ea63e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationOrBuilder.java @@ -0,0 +1,254 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface ExplanationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Explanation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Feature attributions grouped by predicted outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * If users set
+   * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+   * the attributions are sorted by
+   * [instance_output_value][Attributions.instance_output_value] in descending
+   * order. If
+   * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+   * is specified, the attributions are stored by
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * in the same order as they appear in the output_indices.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getAttributionsList(); + /** + * + * + *
+   * Output only. Feature attributions grouped by predicted outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * If users set
+   * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+   * the attributions are sorted by
+   * [instance_output_value][Attributions.instance_output_value] in descending
+   * order. If
+   * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+   * is specified, the attributions are stored by
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * in the same order as they appear in the output_indices.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.Attribution getAttributions(int index); + /** + * + * + *
+   * Output only. Feature attributions grouped by predicted outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * If users set
+   * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+   * the attributions are sorted by
+   * [instance_output_value][Attributions.instance_output_value] in descending
+   * order. If
+   * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+   * is specified, the attributions are stored by
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * in the same order as they appear in the output_indices.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getAttributionsCount(); + /** + * + * + *
+   * Output only. Feature attributions grouped by predicted outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * If users set
+   * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+   * the attributions are sorted by
+   * [instance_output_value][Attributions.instance_output_value] in descending
+   * order. If
+   * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+   * is specified, the attributions are stored by
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * in the same order as they appear in the output_indices.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getAttributionsOrBuilderList(); + /** + * + * + *
+   * Output only. Feature attributions grouped by predicted outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * If users set
+   * [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k],
+   * the attributions are sorted by
+   * [instance_output_value][Attributions.instance_output_value] in descending
+   * order. If
+   * [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices]
+   * is specified, the attributions are stored by
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * in the same order as they appear in the output_indices.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.AttributionOrBuilder getAttributionsOrBuilder(int index); + + /** + * + * + *
+   * Output only. List of the nearest neighbors for example-based explanations.
+   *
+   * For models deployed with the examples explanations feature enabled, the
+   * attributions field is empty and instead the neighbors field is populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getNeighborsList(); + /** + * + * + *
+   * Output only. List of the nearest neighbors for example-based explanations.
+   *
+   * For models deployed with the examples explanations feature enabled, the
+   * attributions field is empty and instead the neighbors field is populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.Neighbor getNeighbors(int index); + /** + * + * + *
+   * Output only. List of the nearest neighbors for example-based explanations.
+   *
+   * For models deployed with the examples explanations feature enabled, the
+   * attributions field is empty and instead the neighbors field is populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getNeighborsCount(); + /** + * + * + *
+   * Output only. List of the nearest neighbors for example-based explanations.
+   *
+   * For models deployed with the examples explanations feature enabled, the
+   * attributions field is empty and instead the neighbors field is populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getNeighborsOrBuilderList(); + /** + * + * + *
+   * Output only. List of the nearest neighbors for example-based explanations.
+   *
+   * For models deployed with the examples explanations feature enabled, the
+   * attributions field is empty and instead the neighbors field is populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Neighbor neighbors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.NeighborOrBuilder getNeighborsOrBuilder(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationParameters.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationParameters.java new file mode 100644 index 000000000000..58da84245cb3 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationParameters.java @@ -0,0 +1,2437 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Parameters to configure explaining for Model's predictions.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationParameters} + */ +public final class ExplanationParameters extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplanationParameters) + ExplanationParametersOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplanationParameters.newBuilder() to construct. + private ExplanationParameters(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplanationParameters() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplanationParameters(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationParameters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationParameters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationParameters.class, + com.google.cloud.vertexai.api.ExplanationParameters.Builder.class); + } + + private int methodCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object method_; + + public enum MethodCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SAMPLED_SHAPLEY_ATTRIBUTION(1), + INTEGRATED_GRADIENTS_ATTRIBUTION(2), + XRAI_ATTRIBUTION(3), + EXAMPLES(7), + METHOD_NOT_SET(0); + private final int value; + + private MethodCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MethodCase valueOf(int value) { + return forNumber(value); + } + + public static MethodCase forNumber(int value) { + switch (value) { + case 1: + return SAMPLED_SHAPLEY_ATTRIBUTION; + case 2: + return INTEGRATED_GRADIENTS_ATTRIBUTION; + case 3: + return XRAI_ATTRIBUTION; + case 7: + return EXAMPLES; + case 0: + return METHOD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MethodCase getMethodCase() { + return MethodCase.forNumber(methodCase_); + } + + public static final int SAMPLED_SHAPLEY_ATTRIBUTION_FIELD_NUMBER = 1; + /** + * + * + *
+   * An attribution method that approximates Shapley values for features that
+   * contribute to the label being predicted. A sampling strategy is used to
+   * approximate the value rather than considering all subsets of features.
+   * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + * + * @return Whether the sampledShapleyAttribution field is set. + */ + @java.lang.Override + public boolean hasSampledShapleyAttribution() { + return methodCase_ == 1; + } + /** + * + * + *
+   * An attribution method that approximates Shapley values for features that
+   * contribute to the label being predicted. A sampling strategy is used to
+   * approximate the value rather than considering all subsets of features.
+   * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + * + * @return The sampledShapleyAttribution. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SampledShapleyAttribution getSampledShapleyAttribution() { + if (methodCase_ == 1) { + return (com.google.cloud.vertexai.api.SampledShapleyAttribution) method_; + } + return com.google.cloud.vertexai.api.SampledShapleyAttribution.getDefaultInstance(); + } + /** + * + * + *
+   * An attribution method that approximates Shapley values for features that
+   * contribute to the label being predicted. A sampling strategy is used to
+   * approximate the value rather than considering all subsets of features.
+   * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SampledShapleyAttributionOrBuilder + getSampledShapleyAttributionOrBuilder() { + if (methodCase_ == 1) { + return (com.google.cloud.vertexai.api.SampledShapleyAttribution) method_; + } + return com.google.cloud.vertexai.api.SampledShapleyAttribution.getDefaultInstance(); + } + + public static final int INTEGRATED_GRADIENTS_ATTRIBUTION_FIELD_NUMBER = 2; + /** + * + * + *
+   * An attribution method that computes Aumann-Shapley values taking
+   * advantage of the model's fully differentiable structure. Refer to this
+   * paper for more details: https://arxiv.org/abs/1703.01365
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + * + * @return Whether the integratedGradientsAttribution field is set. + */ + @java.lang.Override + public boolean hasIntegratedGradientsAttribution() { + return methodCase_ == 2; + } + /** + * + * + *
+   * An attribution method that computes Aumann-Shapley values taking
+   * advantage of the model's fully differentiable structure. Refer to this
+   * paper for more details: https://arxiv.org/abs/1703.01365
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + * + * @return The integratedGradientsAttribution. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.IntegratedGradientsAttribution + getIntegratedGradientsAttribution() { + if (methodCase_ == 2) { + return (com.google.cloud.vertexai.api.IntegratedGradientsAttribution) method_; + } + return com.google.cloud.vertexai.api.IntegratedGradientsAttribution.getDefaultInstance(); + } + /** + * + * + *
+   * An attribution method that computes Aumann-Shapley values taking
+   * advantage of the model's fully differentiable structure. Refer to this
+   * paper for more details: https://arxiv.org/abs/1703.01365
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.IntegratedGradientsAttributionOrBuilder + getIntegratedGradientsAttributionOrBuilder() { + if (methodCase_ == 2) { + return (com.google.cloud.vertexai.api.IntegratedGradientsAttribution) method_; + } + return com.google.cloud.vertexai.api.IntegratedGradientsAttribution.getDefaultInstance(); + } + + public static final int XRAI_ATTRIBUTION_FIELD_NUMBER = 3; + /** + * + * + *
+   * An attribution method that redistributes Integrated Gradients
+   * attribution to segmented regions, taking advantage of the model's fully
+   * differentiable structure. Refer to this paper for
+   * more details: https://arxiv.org/abs/1906.02825
+   *
+   * XRAI currently performs better on natural images, like a picture of a
+   * house or an animal. If the images are taken in artificial environments,
+   * like a lab or manufacturing line, or from diagnostic equipment, like
+   * x-rays or quality-control cameras, use Integrated Gradients instead.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + * + * @return Whether the xraiAttribution field is set. + */ + @java.lang.Override + public boolean hasXraiAttribution() { + return methodCase_ == 3; + } + /** + * + * + *
+   * An attribution method that redistributes Integrated Gradients
+   * attribution to segmented regions, taking advantage of the model's fully
+   * differentiable structure. Refer to this paper for
+   * more details: https://arxiv.org/abs/1906.02825
+   *
+   * XRAI currently performs better on natural images, like a picture of a
+   * house or an animal. If the images are taken in artificial environments,
+   * like a lab or manufacturing line, or from diagnostic equipment, like
+   * x-rays or quality-control cameras, use Integrated Gradients instead.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + * + * @return The xraiAttribution. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.XraiAttribution getXraiAttribution() { + if (methodCase_ == 3) { + return (com.google.cloud.vertexai.api.XraiAttribution) method_; + } + return com.google.cloud.vertexai.api.XraiAttribution.getDefaultInstance(); + } + /** + * + * + *
+   * An attribution method that redistributes Integrated Gradients
+   * attribution to segmented regions, taking advantage of the model's fully
+   * differentiable structure. Refer to this paper for
+   * more details: https://arxiv.org/abs/1906.02825
+   *
+   * XRAI currently performs better on natural images, like a picture of a
+   * house or an animal. If the images are taken in artificial environments,
+   * like a lab or manufacturing line, or from diagnostic equipment, like
+   * x-rays or quality-control cameras, use Integrated Gradients instead.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.XraiAttributionOrBuilder getXraiAttributionOrBuilder() { + if (methodCase_ == 3) { + return (com.google.cloud.vertexai.api.XraiAttribution) method_; + } + return com.google.cloud.vertexai.api.XraiAttribution.getDefaultInstance(); + } + + public static final int EXAMPLES_FIELD_NUMBER = 7; + /** + * + * + *
+   * Example-based explanations that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + * + * @return Whether the examples field is set. + */ + @java.lang.Override + public boolean hasExamples() { + return methodCase_ == 7; + } + /** + * + * + *
+   * Example-based explanations that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + * + * @return The examples. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Examples getExamples() { + if (methodCase_ == 7) { + return (com.google.cloud.vertexai.api.Examples) method_; + } + return com.google.cloud.vertexai.api.Examples.getDefaultInstance(); + } + /** + * + * + *
+   * Example-based explanations that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesOrBuilder getExamplesOrBuilder() { + if (methodCase_ == 7) { + return (com.google.cloud.vertexai.api.Examples) method_; + } + return com.google.cloud.vertexai.api.Examples.getDefaultInstance(); + } + + public static final int TOP_K_FIELD_NUMBER = 4; + private int topK_ = 0; + /** + * + * + *
+   * If populated, returns attributions for top K indices of outputs
+   * (defaults to 1). Only applies to Models that predicts more than one outputs
+   * (e,g, multi-class Models). When set to -1, returns explanations for all
+   * outputs.
+   * 
+ * + * int32 top_k = 4; + * + * @return The topK. + */ + @java.lang.Override + public int getTopK() { + return topK_; + } + + public static final int OUTPUT_INDICES_FIELD_NUMBER = 5; + private com.google.protobuf.ListValue outputIndices_; + /** + * + * + *
+   * If populated, only returns attributions that have
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * contained in output_indices. It must be an ndarray of integers, with the
+   * same shape of the output it's explaining.
+   *
+   * If not populated, returns attributions for
+   * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+   * indices of outputs. If neither top_k nor output_indices is populated,
+   * returns the argmax index of the outputs.
+   *
+   * Only applicable to Models that predict multiple outputs (e,g, multi-class
+   * Models that predict multiple classes).
+   * 
+ * + * .google.protobuf.ListValue output_indices = 5; + * + * @return Whether the outputIndices field is set. + */ + @java.lang.Override + public boolean hasOutputIndices() { + return outputIndices_ != null; + } + /** + * + * + *
+   * If populated, only returns attributions that have
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * contained in output_indices. It must be an ndarray of integers, with the
+   * same shape of the output it's explaining.
+   *
+   * If not populated, returns attributions for
+   * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+   * indices of outputs. If neither top_k nor output_indices is populated,
+   * returns the argmax index of the outputs.
+   *
+   * Only applicable to Models that predict multiple outputs (e,g, multi-class
+   * Models that predict multiple classes).
+   * 
+ * + * .google.protobuf.ListValue output_indices = 5; + * + * @return The outputIndices. + */ + @java.lang.Override + public com.google.protobuf.ListValue getOutputIndices() { + return outputIndices_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : outputIndices_; + } + /** + * + * + *
+   * If populated, only returns attributions that have
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * contained in output_indices. It must be an ndarray of integers, with the
+   * same shape of the output it's explaining.
+   *
+   * If not populated, returns attributions for
+   * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+   * indices of outputs. If neither top_k nor output_indices is populated,
+   * returns the argmax index of the outputs.
+   *
+   * Only applicable to Models that predict multiple outputs (e,g, multi-class
+   * Models that predict multiple classes).
+   * 
+ * + * .google.protobuf.ListValue output_indices = 5; + */ + @java.lang.Override + public com.google.protobuf.ListValueOrBuilder getOutputIndicesOrBuilder() { + return outputIndices_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : outputIndices_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (methodCase_ == 1) { + output.writeMessage(1, (com.google.cloud.vertexai.api.SampledShapleyAttribution) method_); + } + if (methodCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.vertexai.api.IntegratedGradientsAttribution) method_); + } + if (methodCase_ == 3) { + output.writeMessage(3, (com.google.cloud.vertexai.api.XraiAttribution) method_); + } + if (topK_ != 0) { + output.writeInt32(4, topK_); + } + if (outputIndices_ != null) { + output.writeMessage(5, getOutputIndices()); + } + if (methodCase_ == 7) { + output.writeMessage(7, (com.google.cloud.vertexai.api.Examples) method_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (methodCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.vertexai.api.SampledShapleyAttribution) method_); + } + if (methodCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.vertexai.api.IntegratedGradientsAttribution) method_); + } + if (methodCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.vertexai.api.XraiAttribution) method_); + } + if (topK_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, topK_); + } + if (outputIndices_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getOutputIndices()); + } + if (methodCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.vertexai.api.Examples) method_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExplanationParameters)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplanationParameters other = + (com.google.cloud.vertexai.api.ExplanationParameters) obj; + + if (getTopK() != other.getTopK()) return false; + if (hasOutputIndices() != other.hasOutputIndices()) return false; + if (hasOutputIndices()) { + if (!getOutputIndices().equals(other.getOutputIndices())) return false; + } + if (!getMethodCase().equals(other.getMethodCase())) return false; + switch (methodCase_) { + case 1: + if (!getSampledShapleyAttribution().equals(other.getSampledShapleyAttribution())) + return false; + break; + case 2: + if (!getIntegratedGradientsAttribution().equals(other.getIntegratedGradientsAttribution())) + return false; + break; + case 3: + if (!getXraiAttribution().equals(other.getXraiAttribution())) return false; + break; + case 7: + if (!getExamples().equals(other.getExamples())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TOP_K_FIELD_NUMBER; + hash = (53 * hash) + getTopK(); + if (hasOutputIndices()) { + hash = (37 * hash) + OUTPUT_INDICES_FIELD_NUMBER; + hash = (53 * hash) + getOutputIndices().hashCode(); + } + switch (methodCase_) { + case 1: + hash = (37 * hash) + SAMPLED_SHAPLEY_ATTRIBUTION_FIELD_NUMBER; + hash = (53 * hash) + getSampledShapleyAttribution().hashCode(); + break; + case 2: + hash = (37 * hash) + INTEGRATED_GRADIENTS_ATTRIBUTION_FIELD_NUMBER; + hash = (53 * hash) + getIntegratedGradientsAttribution().hashCode(); + break; + case 3: + hash = (37 * hash) + XRAI_ATTRIBUTION_FIELD_NUMBER; + hash = (53 * hash) + getXraiAttribution().hashCode(); + break; + case 7: + hash = (37 * hash) + EXAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getExamples().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ExplanationParameters prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Parameters to configure explaining for Model's predictions.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationParameters} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplanationParameters) + com.google.cloud.vertexai.api.ExplanationParametersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationParameters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationParameters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationParameters.class, + com.google.cloud.vertexai.api.ExplanationParameters.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ExplanationParameters.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (sampledShapleyAttributionBuilder_ != null) { + sampledShapleyAttributionBuilder_.clear(); + } + if (integratedGradientsAttributionBuilder_ != null) { + integratedGradientsAttributionBuilder_.clear(); + } + if (xraiAttributionBuilder_ != null) { + xraiAttributionBuilder_.clear(); + } + if (examplesBuilder_ != null) { + examplesBuilder_.clear(); + } + topK_ = 0; + outputIndices_ = null; + if (outputIndicesBuilder_ != null) { + outputIndicesBuilder_.dispose(); + outputIndicesBuilder_ = null; + } + methodCase_ = 0; + method_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationParameters_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationParameters getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationParameters build() { + com.google.cloud.vertexai.api.ExplanationParameters result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationParameters buildPartial() { + com.google.cloud.vertexai.api.ExplanationParameters result = + new com.google.cloud.vertexai.api.ExplanationParameters(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.ExplanationParameters result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.topK_ = topK_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.outputIndices_ = + outputIndicesBuilder_ == null ? outputIndices_ : outputIndicesBuilder_.build(); + } + } + + private void buildPartialOneofs(com.google.cloud.vertexai.api.ExplanationParameters result) { + result.methodCase_ = methodCase_; + result.method_ = this.method_; + if (methodCase_ == 1 && sampledShapleyAttributionBuilder_ != null) { + result.method_ = sampledShapleyAttributionBuilder_.build(); + } + if (methodCase_ == 2 && integratedGradientsAttributionBuilder_ != null) { + result.method_ = integratedGradientsAttributionBuilder_.build(); + } + if (methodCase_ == 3 && xraiAttributionBuilder_ != null) { + result.method_ = xraiAttributionBuilder_.build(); + } + if (methodCase_ == 7 && examplesBuilder_ != null) { + result.method_ = examplesBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExplanationParameters) { + return mergeFrom((com.google.cloud.vertexai.api.ExplanationParameters) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ExplanationParameters other) { + if (other == com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance()) + return this; + if (other.getTopK() != 0) { + setTopK(other.getTopK()); + } + if (other.hasOutputIndices()) { + mergeOutputIndices(other.getOutputIndices()); + } + switch (other.getMethodCase()) { + case SAMPLED_SHAPLEY_ATTRIBUTION: + { + mergeSampledShapleyAttribution(other.getSampledShapleyAttribution()); + break; + } + case INTEGRATED_GRADIENTS_ATTRIBUTION: + { + mergeIntegratedGradientsAttribution(other.getIntegratedGradientsAttribution()); + break; + } + case XRAI_ATTRIBUTION: + { + mergeXraiAttribution(other.getXraiAttribution()); + break; + } + case EXAMPLES: + { + mergeExamples(other.getExamples()); + break; + } + case METHOD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getSampledShapleyAttributionFieldBuilder().getBuilder(), extensionRegistry); + methodCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + getIntegratedGradientsAttributionFieldBuilder().getBuilder(), + extensionRegistry); + methodCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getXraiAttributionFieldBuilder().getBuilder(), extensionRegistry); + methodCase_ = 3; + break; + } // case 26 + case 32: + { + topK_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 32 + case 42: + { + input.readMessage(getOutputIndicesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 58: + { + input.readMessage(getExamplesFieldBuilder().getBuilder(), extensionRegistry); + methodCase_ = 7; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int methodCase_ = 0; + private java.lang.Object method_; + + public MethodCase getMethodCase() { + return MethodCase.forNumber(methodCase_); + } + + public Builder clearMethod() { + methodCase_ = 0; + method_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.SampledShapleyAttribution, + com.google.cloud.vertexai.api.SampledShapleyAttribution.Builder, + com.google.cloud.vertexai.api.SampledShapleyAttributionOrBuilder> + sampledShapleyAttributionBuilder_; + /** + * + * + *
+     * An attribution method that approximates Shapley values for features that
+     * contribute to the label being predicted. A sampling strategy is used to
+     * approximate the value rather than considering all subsets of features.
+     * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + * + * @return Whether the sampledShapleyAttribution field is set. + */ + @java.lang.Override + public boolean hasSampledShapleyAttribution() { + return methodCase_ == 1; + } + /** + * + * + *
+     * An attribution method that approximates Shapley values for features that
+     * contribute to the label being predicted. A sampling strategy is used to
+     * approximate the value rather than considering all subsets of features.
+     * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + * + * @return The sampledShapleyAttribution. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SampledShapleyAttribution getSampledShapleyAttribution() { + if (sampledShapleyAttributionBuilder_ == null) { + if (methodCase_ == 1) { + return (com.google.cloud.vertexai.api.SampledShapleyAttribution) method_; + } + return com.google.cloud.vertexai.api.SampledShapleyAttribution.getDefaultInstance(); + } else { + if (methodCase_ == 1) { + return sampledShapleyAttributionBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.SampledShapleyAttribution.getDefaultInstance(); + } + } + /** + * + * + *
+     * An attribution method that approximates Shapley values for features that
+     * contribute to the label being predicted. A sampling strategy is used to
+     * approximate the value rather than considering all subsets of features.
+     * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + */ + public Builder setSampledShapleyAttribution( + com.google.cloud.vertexai.api.SampledShapleyAttribution value) { + if (sampledShapleyAttributionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + method_ = value; + onChanged(); + } else { + sampledShapleyAttributionBuilder_.setMessage(value); + } + methodCase_ = 1; + return this; + } + /** + * + * + *
+     * An attribution method that approximates Shapley values for features that
+     * contribute to the label being predicted. A sampling strategy is used to
+     * approximate the value rather than considering all subsets of features.
+     * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + */ + public Builder setSampledShapleyAttribution( + com.google.cloud.vertexai.api.SampledShapleyAttribution.Builder builderForValue) { + if (sampledShapleyAttributionBuilder_ == null) { + method_ = builderForValue.build(); + onChanged(); + } else { + sampledShapleyAttributionBuilder_.setMessage(builderForValue.build()); + } + methodCase_ = 1; + return this; + } + /** + * + * + *
+     * An attribution method that approximates Shapley values for features that
+     * contribute to the label being predicted. A sampling strategy is used to
+     * approximate the value rather than considering all subsets of features.
+     * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + */ + public Builder mergeSampledShapleyAttribution( + com.google.cloud.vertexai.api.SampledShapleyAttribution value) { + if (sampledShapleyAttributionBuilder_ == null) { + if (methodCase_ == 1 + && method_ + != com.google.cloud.vertexai.api.SampledShapleyAttribution.getDefaultInstance()) { + method_ = + com.google.cloud.vertexai.api.SampledShapleyAttribution.newBuilder( + (com.google.cloud.vertexai.api.SampledShapleyAttribution) method_) + .mergeFrom(value) + .buildPartial(); + } else { + method_ = value; + } + onChanged(); + } else { + if (methodCase_ == 1) { + sampledShapleyAttributionBuilder_.mergeFrom(value); + } else { + sampledShapleyAttributionBuilder_.setMessage(value); + } + } + methodCase_ = 1; + return this; + } + /** + * + * + *
+     * An attribution method that approximates Shapley values for features that
+     * contribute to the label being predicted. A sampling strategy is used to
+     * approximate the value rather than considering all subsets of features.
+     * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + */ + public Builder clearSampledShapleyAttribution() { + if (sampledShapleyAttributionBuilder_ == null) { + if (methodCase_ == 1) { + methodCase_ = 0; + method_ = null; + onChanged(); + } + } else { + if (methodCase_ == 1) { + methodCase_ = 0; + method_ = null; + } + sampledShapleyAttributionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * An attribution method that approximates Shapley values for features that
+     * contribute to the label being predicted. A sampling strategy is used to
+     * approximate the value rather than considering all subsets of features.
+     * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + */ + public com.google.cloud.vertexai.api.SampledShapleyAttribution.Builder + getSampledShapleyAttributionBuilder() { + return getSampledShapleyAttributionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An attribution method that approximates Shapley values for features that
+     * contribute to the label being predicted. A sampling strategy is used to
+     * approximate the value rather than considering all subsets of features.
+     * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SampledShapleyAttributionOrBuilder + getSampledShapleyAttributionOrBuilder() { + if ((methodCase_ == 1) && (sampledShapleyAttributionBuilder_ != null)) { + return sampledShapleyAttributionBuilder_.getMessageOrBuilder(); + } else { + if (methodCase_ == 1) { + return (com.google.cloud.vertexai.api.SampledShapleyAttribution) method_; + } + return com.google.cloud.vertexai.api.SampledShapleyAttribution.getDefaultInstance(); + } + } + /** + * + * + *
+     * An attribution method that approximates Shapley values for features that
+     * contribute to the label being predicted. A sampling strategy is used to
+     * approximate the value rather than considering all subsets of features.
+     * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.SampledShapleyAttribution, + com.google.cloud.vertexai.api.SampledShapleyAttribution.Builder, + com.google.cloud.vertexai.api.SampledShapleyAttributionOrBuilder> + getSampledShapleyAttributionFieldBuilder() { + if (sampledShapleyAttributionBuilder_ == null) { + if (!(methodCase_ == 1)) { + method_ = com.google.cloud.vertexai.api.SampledShapleyAttribution.getDefaultInstance(); + } + sampledShapleyAttributionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.SampledShapleyAttribution, + com.google.cloud.vertexai.api.SampledShapleyAttribution.Builder, + com.google.cloud.vertexai.api.SampledShapleyAttributionOrBuilder>( + (com.google.cloud.vertexai.api.SampledShapleyAttribution) method_, + getParentForChildren(), + isClean()); + method_ = null; + } + methodCase_ = 1; + onChanged(); + return sampledShapleyAttributionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.IntegratedGradientsAttribution, + com.google.cloud.vertexai.api.IntegratedGradientsAttribution.Builder, + com.google.cloud.vertexai.api.IntegratedGradientsAttributionOrBuilder> + integratedGradientsAttributionBuilder_; + /** + * + * + *
+     * An attribution method that computes Aumann-Shapley values taking
+     * advantage of the model's fully differentiable structure. Refer to this
+     * paper for more details: https://arxiv.org/abs/1703.01365
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + * + * @return Whether the integratedGradientsAttribution field is set. + */ + @java.lang.Override + public boolean hasIntegratedGradientsAttribution() { + return methodCase_ == 2; + } + /** + * + * + *
+     * An attribution method that computes Aumann-Shapley values taking
+     * advantage of the model's fully differentiable structure. Refer to this
+     * paper for more details: https://arxiv.org/abs/1703.01365
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + * + * @return The integratedGradientsAttribution. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.IntegratedGradientsAttribution + getIntegratedGradientsAttribution() { + if (integratedGradientsAttributionBuilder_ == null) { + if (methodCase_ == 2) { + return (com.google.cloud.vertexai.api.IntegratedGradientsAttribution) method_; + } + return com.google.cloud.vertexai.api.IntegratedGradientsAttribution.getDefaultInstance(); + } else { + if (methodCase_ == 2) { + return integratedGradientsAttributionBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.IntegratedGradientsAttribution.getDefaultInstance(); + } + } + /** + * + * + *
+     * An attribution method that computes Aumann-Shapley values taking
+     * advantage of the model's fully differentiable structure. Refer to this
+     * paper for more details: https://arxiv.org/abs/1703.01365
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + */ + public Builder setIntegratedGradientsAttribution( + com.google.cloud.vertexai.api.IntegratedGradientsAttribution value) { + if (integratedGradientsAttributionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + method_ = value; + onChanged(); + } else { + integratedGradientsAttributionBuilder_.setMessage(value); + } + methodCase_ = 2; + return this; + } + /** + * + * + *
+     * An attribution method that computes Aumann-Shapley values taking
+     * advantage of the model's fully differentiable structure. Refer to this
+     * paper for more details: https://arxiv.org/abs/1703.01365
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + */ + public Builder setIntegratedGradientsAttribution( + com.google.cloud.vertexai.api.IntegratedGradientsAttribution.Builder builderForValue) { + if (integratedGradientsAttributionBuilder_ == null) { + method_ = builderForValue.build(); + onChanged(); + } else { + integratedGradientsAttributionBuilder_.setMessage(builderForValue.build()); + } + methodCase_ = 2; + return this; + } + /** + * + * + *
+     * An attribution method that computes Aumann-Shapley values taking
+     * advantage of the model's fully differentiable structure. Refer to this
+     * paper for more details: https://arxiv.org/abs/1703.01365
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + */ + public Builder mergeIntegratedGradientsAttribution( + com.google.cloud.vertexai.api.IntegratedGradientsAttribution value) { + if (integratedGradientsAttributionBuilder_ == null) { + if (methodCase_ == 2 + && method_ + != com.google.cloud.vertexai.api.IntegratedGradientsAttribution + .getDefaultInstance()) { + method_ = + com.google.cloud.vertexai.api.IntegratedGradientsAttribution.newBuilder( + (com.google.cloud.vertexai.api.IntegratedGradientsAttribution) method_) + .mergeFrom(value) + .buildPartial(); + } else { + method_ = value; + } + onChanged(); + } else { + if (methodCase_ == 2) { + integratedGradientsAttributionBuilder_.mergeFrom(value); + } else { + integratedGradientsAttributionBuilder_.setMessage(value); + } + } + methodCase_ = 2; + return this; + } + /** + * + * + *
+     * An attribution method that computes Aumann-Shapley values taking
+     * advantage of the model's fully differentiable structure. Refer to this
+     * paper for more details: https://arxiv.org/abs/1703.01365
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + */ + public Builder clearIntegratedGradientsAttribution() { + if (integratedGradientsAttributionBuilder_ == null) { + if (methodCase_ == 2) { + methodCase_ = 0; + method_ = null; + onChanged(); + } + } else { + if (methodCase_ == 2) { + methodCase_ = 0; + method_ = null; + } + integratedGradientsAttributionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * An attribution method that computes Aumann-Shapley values taking
+     * advantage of the model's fully differentiable structure. Refer to this
+     * paper for more details: https://arxiv.org/abs/1703.01365
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + */ + public com.google.cloud.vertexai.api.IntegratedGradientsAttribution.Builder + getIntegratedGradientsAttributionBuilder() { + return getIntegratedGradientsAttributionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An attribution method that computes Aumann-Shapley values taking
+     * advantage of the model's fully differentiable structure. Refer to this
+     * paper for more details: https://arxiv.org/abs/1703.01365
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.IntegratedGradientsAttributionOrBuilder + getIntegratedGradientsAttributionOrBuilder() { + if ((methodCase_ == 2) && (integratedGradientsAttributionBuilder_ != null)) { + return integratedGradientsAttributionBuilder_.getMessageOrBuilder(); + } else { + if (methodCase_ == 2) { + return (com.google.cloud.vertexai.api.IntegratedGradientsAttribution) method_; + } + return com.google.cloud.vertexai.api.IntegratedGradientsAttribution.getDefaultInstance(); + } + } + /** + * + * + *
+     * An attribution method that computes Aumann-Shapley values taking
+     * advantage of the model's fully differentiable structure. Refer to this
+     * paper for more details: https://arxiv.org/abs/1703.01365
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.IntegratedGradientsAttribution, + com.google.cloud.vertexai.api.IntegratedGradientsAttribution.Builder, + com.google.cloud.vertexai.api.IntegratedGradientsAttributionOrBuilder> + getIntegratedGradientsAttributionFieldBuilder() { + if (integratedGradientsAttributionBuilder_ == null) { + if (!(methodCase_ == 2)) { + method_ = + com.google.cloud.vertexai.api.IntegratedGradientsAttribution.getDefaultInstance(); + } + integratedGradientsAttributionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.IntegratedGradientsAttribution, + com.google.cloud.vertexai.api.IntegratedGradientsAttribution.Builder, + com.google.cloud.vertexai.api.IntegratedGradientsAttributionOrBuilder>( + (com.google.cloud.vertexai.api.IntegratedGradientsAttribution) method_, + getParentForChildren(), + isClean()); + method_ = null; + } + methodCase_ = 2; + onChanged(); + return integratedGradientsAttributionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.XraiAttribution, + com.google.cloud.vertexai.api.XraiAttribution.Builder, + com.google.cloud.vertexai.api.XraiAttributionOrBuilder> + xraiAttributionBuilder_; + /** + * + * + *
+     * An attribution method that redistributes Integrated Gradients
+     * attribution to segmented regions, taking advantage of the model's fully
+     * differentiable structure. Refer to this paper for
+     * more details: https://arxiv.org/abs/1906.02825
+     *
+     * XRAI currently performs better on natural images, like a picture of a
+     * house or an animal. If the images are taken in artificial environments,
+     * like a lab or manufacturing line, or from diagnostic equipment, like
+     * x-rays or quality-control cameras, use Integrated Gradients instead.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + * + * @return Whether the xraiAttribution field is set. + */ + @java.lang.Override + public boolean hasXraiAttribution() { + return methodCase_ == 3; + } + /** + * + * + *
+     * An attribution method that redistributes Integrated Gradients
+     * attribution to segmented regions, taking advantage of the model's fully
+     * differentiable structure. Refer to this paper for
+     * more details: https://arxiv.org/abs/1906.02825
+     *
+     * XRAI currently performs better on natural images, like a picture of a
+     * house or an animal. If the images are taken in artificial environments,
+     * like a lab or manufacturing line, or from diagnostic equipment, like
+     * x-rays or quality-control cameras, use Integrated Gradients instead.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + * + * @return The xraiAttribution. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.XraiAttribution getXraiAttribution() { + if (xraiAttributionBuilder_ == null) { + if (methodCase_ == 3) { + return (com.google.cloud.vertexai.api.XraiAttribution) method_; + } + return com.google.cloud.vertexai.api.XraiAttribution.getDefaultInstance(); + } else { + if (methodCase_ == 3) { + return xraiAttributionBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.XraiAttribution.getDefaultInstance(); + } + } + /** + * + * + *
+     * An attribution method that redistributes Integrated Gradients
+     * attribution to segmented regions, taking advantage of the model's fully
+     * differentiable structure. Refer to this paper for
+     * more details: https://arxiv.org/abs/1906.02825
+     *
+     * XRAI currently performs better on natural images, like a picture of a
+     * house or an animal. If the images are taken in artificial environments,
+     * like a lab or manufacturing line, or from diagnostic equipment, like
+     * x-rays or quality-control cameras, use Integrated Gradients instead.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + */ + public Builder setXraiAttribution(com.google.cloud.vertexai.api.XraiAttribution value) { + if (xraiAttributionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + method_ = value; + onChanged(); + } else { + xraiAttributionBuilder_.setMessage(value); + } + methodCase_ = 3; + return this; + } + /** + * + * + *
+     * An attribution method that redistributes Integrated Gradients
+     * attribution to segmented regions, taking advantage of the model's fully
+     * differentiable structure. Refer to this paper for
+     * more details: https://arxiv.org/abs/1906.02825
+     *
+     * XRAI currently performs better on natural images, like a picture of a
+     * house or an animal. If the images are taken in artificial environments,
+     * like a lab or manufacturing line, or from diagnostic equipment, like
+     * x-rays or quality-control cameras, use Integrated Gradients instead.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + */ + public Builder setXraiAttribution( + com.google.cloud.vertexai.api.XraiAttribution.Builder builderForValue) { + if (xraiAttributionBuilder_ == null) { + method_ = builderForValue.build(); + onChanged(); + } else { + xraiAttributionBuilder_.setMessage(builderForValue.build()); + } + methodCase_ = 3; + return this; + } + /** + * + * + *
+     * An attribution method that redistributes Integrated Gradients
+     * attribution to segmented regions, taking advantage of the model's fully
+     * differentiable structure. Refer to this paper for
+     * more details: https://arxiv.org/abs/1906.02825
+     *
+     * XRAI currently performs better on natural images, like a picture of a
+     * house or an animal. If the images are taken in artificial environments,
+     * like a lab or manufacturing line, or from diagnostic equipment, like
+     * x-rays or quality-control cameras, use Integrated Gradients instead.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + */ + public Builder mergeXraiAttribution(com.google.cloud.vertexai.api.XraiAttribution value) { + if (xraiAttributionBuilder_ == null) { + if (methodCase_ == 3 + && method_ != com.google.cloud.vertexai.api.XraiAttribution.getDefaultInstance()) { + method_ = + com.google.cloud.vertexai.api.XraiAttribution.newBuilder( + (com.google.cloud.vertexai.api.XraiAttribution) method_) + .mergeFrom(value) + .buildPartial(); + } else { + method_ = value; + } + onChanged(); + } else { + if (methodCase_ == 3) { + xraiAttributionBuilder_.mergeFrom(value); + } else { + xraiAttributionBuilder_.setMessage(value); + } + } + methodCase_ = 3; + return this; + } + /** + * + * + *
+     * An attribution method that redistributes Integrated Gradients
+     * attribution to segmented regions, taking advantage of the model's fully
+     * differentiable structure. Refer to this paper for
+     * more details: https://arxiv.org/abs/1906.02825
+     *
+     * XRAI currently performs better on natural images, like a picture of a
+     * house or an animal. If the images are taken in artificial environments,
+     * like a lab or manufacturing line, or from diagnostic equipment, like
+     * x-rays or quality-control cameras, use Integrated Gradients instead.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + */ + public Builder clearXraiAttribution() { + if (xraiAttributionBuilder_ == null) { + if (methodCase_ == 3) { + methodCase_ = 0; + method_ = null; + onChanged(); + } + } else { + if (methodCase_ == 3) { + methodCase_ = 0; + method_ = null; + } + xraiAttributionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * An attribution method that redistributes Integrated Gradients
+     * attribution to segmented regions, taking advantage of the model's fully
+     * differentiable structure. Refer to this paper for
+     * more details: https://arxiv.org/abs/1906.02825
+     *
+     * XRAI currently performs better on natural images, like a picture of a
+     * house or an animal. If the images are taken in artificial environments,
+     * like a lab or manufacturing line, or from diagnostic equipment, like
+     * x-rays or quality-control cameras, use Integrated Gradients instead.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + */ + public com.google.cloud.vertexai.api.XraiAttribution.Builder getXraiAttributionBuilder() { + return getXraiAttributionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An attribution method that redistributes Integrated Gradients
+     * attribution to segmented regions, taking advantage of the model's fully
+     * differentiable structure. Refer to this paper for
+     * more details: https://arxiv.org/abs/1906.02825
+     *
+     * XRAI currently performs better on natural images, like a picture of a
+     * house or an animal. If the images are taken in artificial environments,
+     * like a lab or manufacturing line, or from diagnostic equipment, like
+     * x-rays or quality-control cameras, use Integrated Gradients instead.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.XraiAttributionOrBuilder getXraiAttributionOrBuilder() { + if ((methodCase_ == 3) && (xraiAttributionBuilder_ != null)) { + return xraiAttributionBuilder_.getMessageOrBuilder(); + } else { + if (methodCase_ == 3) { + return (com.google.cloud.vertexai.api.XraiAttribution) method_; + } + return com.google.cloud.vertexai.api.XraiAttribution.getDefaultInstance(); + } + } + /** + * + * + *
+     * An attribution method that redistributes Integrated Gradients
+     * attribution to segmented regions, taking advantage of the model's fully
+     * differentiable structure. Refer to this paper for
+     * more details: https://arxiv.org/abs/1906.02825
+     *
+     * XRAI currently performs better on natural images, like a picture of a
+     * house or an animal. If the images are taken in artificial environments,
+     * like a lab or manufacturing line, or from diagnostic equipment, like
+     * x-rays or quality-control cameras, use Integrated Gradients instead.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.XraiAttribution, + com.google.cloud.vertexai.api.XraiAttribution.Builder, + com.google.cloud.vertexai.api.XraiAttributionOrBuilder> + getXraiAttributionFieldBuilder() { + if (xraiAttributionBuilder_ == null) { + if (!(methodCase_ == 3)) { + method_ = com.google.cloud.vertexai.api.XraiAttribution.getDefaultInstance(); + } + xraiAttributionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.XraiAttribution, + com.google.cloud.vertexai.api.XraiAttribution.Builder, + com.google.cloud.vertexai.api.XraiAttributionOrBuilder>( + (com.google.cloud.vertexai.api.XraiAttribution) method_, + getParentForChildren(), + isClean()); + method_ = null; + } + methodCase_ = 3; + onChanged(); + return xraiAttributionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Examples, + com.google.cloud.vertexai.api.Examples.Builder, + com.google.cloud.vertexai.api.ExamplesOrBuilder> + examplesBuilder_; + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + * + * @return Whether the examples field is set. + */ + @java.lang.Override + public boolean hasExamples() { + return methodCase_ == 7; + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + * + * @return The examples. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Examples getExamples() { + if (examplesBuilder_ == null) { + if (methodCase_ == 7) { + return (com.google.cloud.vertexai.api.Examples) method_; + } + return com.google.cloud.vertexai.api.Examples.getDefaultInstance(); + } else { + if (methodCase_ == 7) { + return examplesBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.Examples.getDefaultInstance(); + } + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + */ + public Builder setExamples(com.google.cloud.vertexai.api.Examples value) { + if (examplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + method_ = value; + onChanged(); + } else { + examplesBuilder_.setMessage(value); + } + methodCase_ = 7; + return this; + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + */ + public Builder setExamples(com.google.cloud.vertexai.api.Examples.Builder builderForValue) { + if (examplesBuilder_ == null) { + method_ = builderForValue.build(); + onChanged(); + } else { + examplesBuilder_.setMessage(builderForValue.build()); + } + methodCase_ = 7; + return this; + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + */ + public Builder mergeExamples(com.google.cloud.vertexai.api.Examples value) { + if (examplesBuilder_ == null) { + if (methodCase_ == 7 + && method_ != com.google.cloud.vertexai.api.Examples.getDefaultInstance()) { + method_ = + com.google.cloud.vertexai.api.Examples.newBuilder( + (com.google.cloud.vertexai.api.Examples) method_) + .mergeFrom(value) + .buildPartial(); + } else { + method_ = value; + } + onChanged(); + } else { + if (methodCase_ == 7) { + examplesBuilder_.mergeFrom(value); + } else { + examplesBuilder_.setMessage(value); + } + } + methodCase_ = 7; + return this; + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + */ + public Builder clearExamples() { + if (examplesBuilder_ == null) { + if (methodCase_ == 7) { + methodCase_ = 0; + method_ = null; + onChanged(); + } + } else { + if (methodCase_ == 7) { + methodCase_ = 0; + method_ = null; + } + examplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + */ + public com.google.cloud.vertexai.api.Examples.Builder getExamplesBuilder() { + return getExamplesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesOrBuilder getExamplesOrBuilder() { + if ((methodCase_ == 7) && (examplesBuilder_ != null)) { + return examplesBuilder_.getMessageOrBuilder(); + } else { + if (methodCase_ == 7) { + return (com.google.cloud.vertexai.api.Examples) method_; + } + return com.google.cloud.vertexai.api.Examples.getDefaultInstance(); + } + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Examples, + com.google.cloud.vertexai.api.Examples.Builder, + com.google.cloud.vertexai.api.ExamplesOrBuilder> + getExamplesFieldBuilder() { + if (examplesBuilder_ == null) { + if (!(methodCase_ == 7)) { + method_ = com.google.cloud.vertexai.api.Examples.getDefaultInstance(); + } + examplesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Examples, + com.google.cloud.vertexai.api.Examples.Builder, + com.google.cloud.vertexai.api.ExamplesOrBuilder>( + (com.google.cloud.vertexai.api.Examples) method_, + getParentForChildren(), + isClean()); + method_ = null; + } + methodCase_ = 7; + onChanged(); + return examplesBuilder_; + } + + private int topK_; + /** + * + * + *
+     * If populated, returns attributions for top K indices of outputs
+     * (defaults to 1). Only applies to Models that predicts more than one outputs
+     * (e,g, multi-class Models). When set to -1, returns explanations for all
+     * outputs.
+     * 
+ * + * int32 top_k = 4; + * + * @return The topK. + */ + @java.lang.Override + public int getTopK() { + return topK_; + } + /** + * + * + *
+     * If populated, returns attributions for top K indices of outputs
+     * (defaults to 1). Only applies to Models that predicts more than one outputs
+     * (e,g, multi-class Models). When set to -1, returns explanations for all
+     * outputs.
+     * 
+ * + * int32 top_k = 4; + * + * @param value The topK to set. + * @return This builder for chaining. + */ + public Builder setTopK(int value) { + + topK_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * If populated, returns attributions for top K indices of outputs
+     * (defaults to 1). Only applies to Models that predicts more than one outputs
+     * (e,g, multi-class Models). When set to -1, returns explanations for all
+     * outputs.
+     * 
+ * + * int32 top_k = 4; + * + * @return This builder for chaining. + */ + public Builder clearTopK() { + bitField0_ = (bitField0_ & ~0x00000010); + topK_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ListValue outputIndices_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + outputIndicesBuilder_; + /** + * + * + *
+     * If populated, only returns attributions that have
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * contained in output_indices. It must be an ndarray of integers, with the
+     * same shape of the output it's explaining.
+     *
+     * If not populated, returns attributions for
+     * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+     * indices of outputs. If neither top_k nor output_indices is populated,
+     * returns the argmax index of the outputs.
+     *
+     * Only applicable to Models that predict multiple outputs (e,g, multi-class
+     * Models that predict multiple classes).
+     * 
+ * + * .google.protobuf.ListValue output_indices = 5; + * + * @return Whether the outputIndices field is set. + */ + public boolean hasOutputIndices() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * If populated, only returns attributions that have
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * contained in output_indices. It must be an ndarray of integers, with the
+     * same shape of the output it's explaining.
+     *
+     * If not populated, returns attributions for
+     * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+     * indices of outputs. If neither top_k nor output_indices is populated,
+     * returns the argmax index of the outputs.
+     *
+     * Only applicable to Models that predict multiple outputs (e,g, multi-class
+     * Models that predict multiple classes).
+     * 
+ * + * .google.protobuf.ListValue output_indices = 5; + * + * @return The outputIndices. + */ + public com.google.protobuf.ListValue getOutputIndices() { + if (outputIndicesBuilder_ == null) { + return outputIndices_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : outputIndices_; + } else { + return outputIndicesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If populated, only returns attributions that have
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * contained in output_indices. It must be an ndarray of integers, with the
+     * same shape of the output it's explaining.
+     *
+     * If not populated, returns attributions for
+     * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+     * indices of outputs. If neither top_k nor output_indices is populated,
+     * returns the argmax index of the outputs.
+     *
+     * Only applicable to Models that predict multiple outputs (e,g, multi-class
+     * Models that predict multiple classes).
+     * 
+ * + * .google.protobuf.ListValue output_indices = 5; + */ + public Builder setOutputIndices(com.google.protobuf.ListValue value) { + if (outputIndicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputIndices_ = value; + } else { + outputIndicesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * If populated, only returns attributions that have
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * contained in output_indices. It must be an ndarray of integers, with the
+     * same shape of the output it's explaining.
+     *
+     * If not populated, returns attributions for
+     * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+     * indices of outputs. If neither top_k nor output_indices is populated,
+     * returns the argmax index of the outputs.
+     *
+     * Only applicable to Models that predict multiple outputs (e,g, multi-class
+     * Models that predict multiple classes).
+     * 
+ * + * .google.protobuf.ListValue output_indices = 5; + */ + public Builder setOutputIndices(com.google.protobuf.ListValue.Builder builderForValue) { + if (outputIndicesBuilder_ == null) { + outputIndices_ = builderForValue.build(); + } else { + outputIndicesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * If populated, only returns attributions that have
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * contained in output_indices. It must be an ndarray of integers, with the
+     * same shape of the output it's explaining.
+     *
+     * If not populated, returns attributions for
+     * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+     * indices of outputs. If neither top_k nor output_indices is populated,
+     * returns the argmax index of the outputs.
+     *
+     * Only applicable to Models that predict multiple outputs (e,g, multi-class
+     * Models that predict multiple classes).
+     * 
+ * + * .google.protobuf.ListValue output_indices = 5; + */ + public Builder mergeOutputIndices(com.google.protobuf.ListValue value) { + if (outputIndicesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && outputIndices_ != null + && outputIndices_ != com.google.protobuf.ListValue.getDefaultInstance()) { + getOutputIndicesBuilder().mergeFrom(value); + } else { + outputIndices_ = value; + } + } else { + outputIndicesBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * If populated, only returns attributions that have
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * contained in output_indices. It must be an ndarray of integers, with the
+     * same shape of the output it's explaining.
+     *
+     * If not populated, returns attributions for
+     * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+     * indices of outputs. If neither top_k nor output_indices is populated,
+     * returns the argmax index of the outputs.
+     *
+     * Only applicable to Models that predict multiple outputs (e,g, multi-class
+     * Models that predict multiple classes).
+     * 
+ * + * .google.protobuf.ListValue output_indices = 5; + */ + public Builder clearOutputIndices() { + bitField0_ = (bitField0_ & ~0x00000020); + outputIndices_ = null; + if (outputIndicesBuilder_ != null) { + outputIndicesBuilder_.dispose(); + outputIndicesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * If populated, only returns attributions that have
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * contained in output_indices. It must be an ndarray of integers, with the
+     * same shape of the output it's explaining.
+     *
+     * If not populated, returns attributions for
+     * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+     * indices of outputs. If neither top_k nor output_indices is populated,
+     * returns the argmax index of the outputs.
+     *
+     * Only applicable to Models that predict multiple outputs (e,g, multi-class
+     * Models that predict multiple classes).
+     * 
+ * + * .google.protobuf.ListValue output_indices = 5; + */ + public com.google.protobuf.ListValue.Builder getOutputIndicesBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getOutputIndicesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If populated, only returns attributions that have
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * contained in output_indices. It must be an ndarray of integers, with the
+     * same shape of the output it's explaining.
+     *
+     * If not populated, returns attributions for
+     * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+     * indices of outputs. If neither top_k nor output_indices is populated,
+     * returns the argmax index of the outputs.
+     *
+     * Only applicable to Models that predict multiple outputs (e,g, multi-class
+     * Models that predict multiple classes).
+     * 
+ * + * .google.protobuf.ListValue output_indices = 5; + */ + public com.google.protobuf.ListValueOrBuilder getOutputIndicesOrBuilder() { + if (outputIndicesBuilder_ != null) { + return outputIndicesBuilder_.getMessageOrBuilder(); + } else { + return outputIndices_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : outputIndices_; + } + } + /** + * + * + *
+     * If populated, only returns attributions that have
+     * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * contained in output_indices. It must be an ndarray of integers, with the
+     * same shape of the output it's explaining.
+     *
+     * If not populated, returns attributions for
+     * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+     * indices of outputs. If neither top_k nor output_indices is populated,
+     * returns the argmax index of the outputs.
+     *
+     * Only applicable to Models that predict multiple outputs (e,g, multi-class
+     * Models that predict multiple classes).
+     * 
+ * + * .google.protobuf.ListValue output_indices = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + getOutputIndicesFieldBuilder() { + if (outputIndicesBuilder_ == null) { + outputIndicesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder>( + getOutputIndices(), getParentForChildren(), isClean()); + outputIndices_ = null; + } + return outputIndicesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplanationParameters) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplanationParameters) + private static final com.google.cloud.vertexai.api.ExplanationParameters DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExplanationParameters(); + } + + public static com.google.cloud.vertexai.api.ExplanationParameters getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplanationParameters parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationParameters getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationParametersOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationParametersOrBuilder.java new file mode 100644 index 000000000000..faf534aca2e9 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationParametersOrBuilder.java @@ -0,0 +1,304 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface ExplanationParametersOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplanationParameters) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An attribution method that approximates Shapley values for features that
+   * contribute to the label being predicted. A sampling strategy is used to
+   * approximate the value rather than considering all subsets of features.
+   * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + * + * @return Whether the sampledShapleyAttribution field is set. + */ + boolean hasSampledShapleyAttribution(); + /** + * + * + *
+   * An attribution method that approximates Shapley values for features that
+   * contribute to the label being predicted. A sampling strategy is used to
+   * approximate the value rather than considering all subsets of features.
+   * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + * + * @return The sampledShapleyAttribution. + */ + com.google.cloud.vertexai.api.SampledShapleyAttribution getSampledShapleyAttribution(); + /** + * + * + *
+   * An attribution method that approximates Shapley values for features that
+   * contribute to the label being predicted. A sampling strategy is used to
+   * approximate the value rather than considering all subsets of features.
+   * Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SampledShapleyAttribution sampled_shapley_attribution = 1; + * + */ + com.google.cloud.vertexai.api.SampledShapleyAttributionOrBuilder + getSampledShapleyAttributionOrBuilder(); + + /** + * + * + *
+   * An attribution method that computes Aumann-Shapley values taking
+   * advantage of the model's fully differentiable structure. Refer to this
+   * paper for more details: https://arxiv.org/abs/1703.01365
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + * + * @return Whether the integratedGradientsAttribution field is set. + */ + boolean hasIntegratedGradientsAttribution(); + /** + * + * + *
+   * An attribution method that computes Aumann-Shapley values taking
+   * advantage of the model's fully differentiable structure. Refer to this
+   * paper for more details: https://arxiv.org/abs/1703.01365
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + * + * @return The integratedGradientsAttribution. + */ + com.google.cloud.vertexai.api.IntegratedGradientsAttribution getIntegratedGradientsAttribution(); + /** + * + * + *
+   * An attribution method that computes Aumann-Shapley values taking
+   * advantage of the model's fully differentiable structure. Refer to this
+   * paper for more details: https://arxiv.org/abs/1703.01365
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution integrated_gradients_attribution = 2; + * + */ + com.google.cloud.vertexai.api.IntegratedGradientsAttributionOrBuilder + getIntegratedGradientsAttributionOrBuilder(); + + /** + * + * + *
+   * An attribution method that redistributes Integrated Gradients
+   * attribution to segmented regions, taking advantage of the model's fully
+   * differentiable structure. Refer to this paper for
+   * more details: https://arxiv.org/abs/1906.02825
+   *
+   * XRAI currently performs better on natural images, like a picture of a
+   * house or an animal. If the images are taken in artificial environments,
+   * like a lab or manufacturing line, or from diagnostic equipment, like
+   * x-rays or quality-control cameras, use Integrated Gradients instead.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + * + * @return Whether the xraiAttribution field is set. + */ + boolean hasXraiAttribution(); + /** + * + * + *
+   * An attribution method that redistributes Integrated Gradients
+   * attribution to segmented regions, taking advantage of the model's fully
+   * differentiable structure. Refer to this paper for
+   * more details: https://arxiv.org/abs/1906.02825
+   *
+   * XRAI currently performs better on natural images, like a picture of a
+   * house or an animal. If the images are taken in artificial environments,
+   * like a lab or manufacturing line, or from diagnostic equipment, like
+   * x-rays or quality-control cameras, use Integrated Gradients instead.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + * + * @return The xraiAttribution. + */ + com.google.cloud.vertexai.api.XraiAttribution getXraiAttribution(); + /** + * + * + *
+   * An attribution method that redistributes Integrated Gradients
+   * attribution to segmented regions, taking advantage of the model's fully
+   * differentiable structure. Refer to this paper for
+   * more details: https://arxiv.org/abs/1906.02825
+   *
+   * XRAI currently performs better on natural images, like a picture of a
+   * house or an animal. If the images are taken in artificial environments,
+   * like a lab or manufacturing line, or from diagnostic equipment, like
+   * x-rays or quality-control cameras, use Integrated Gradients instead.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.XraiAttribution xrai_attribution = 3; + */ + com.google.cloud.vertexai.api.XraiAttributionOrBuilder getXraiAttributionOrBuilder(); + + /** + * + * + *
+   * Example-based explanations that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + * + * @return Whether the examples field is set. + */ + boolean hasExamples(); + /** + * + * + *
+   * Example-based explanations that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + * + * @return The examples. + */ + com.google.cloud.vertexai.api.Examples getExamples(); + /** + * + * + *
+   * Example-based explanations that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Examples examples = 7; + */ + com.google.cloud.vertexai.api.ExamplesOrBuilder getExamplesOrBuilder(); + + /** + * + * + *
+   * If populated, returns attributions for top K indices of outputs
+   * (defaults to 1). Only applies to Models that predicts more than one outputs
+   * (e,g, multi-class Models). When set to -1, returns explanations for all
+   * outputs.
+   * 
+ * + * int32 top_k = 4; + * + * @return The topK. + */ + int getTopK(); + + /** + * + * + *
+   * If populated, only returns attributions that have
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * contained in output_indices. It must be an ndarray of integers, with the
+   * same shape of the output it's explaining.
+   *
+   * If not populated, returns attributions for
+   * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+   * indices of outputs. If neither top_k nor output_indices is populated,
+   * returns the argmax index of the outputs.
+   *
+   * Only applicable to Models that predict multiple outputs (e,g, multi-class
+   * Models that predict multiple classes).
+   * 
+ * + * .google.protobuf.ListValue output_indices = 5; + * + * @return Whether the outputIndices field is set. + */ + boolean hasOutputIndices(); + /** + * + * + *
+   * If populated, only returns attributions that have
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * contained in output_indices. It must be an ndarray of integers, with the
+   * same shape of the output it's explaining.
+   *
+   * If not populated, returns attributions for
+   * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+   * indices of outputs. If neither top_k nor output_indices is populated,
+   * returns the argmax index of the outputs.
+   *
+   * Only applicable to Models that predict multiple outputs (e,g, multi-class
+   * Models that predict multiple classes).
+   * 
+ * + * .google.protobuf.ListValue output_indices = 5; + * + * @return The outputIndices. + */ + com.google.protobuf.ListValue getOutputIndices(); + /** + * + * + *
+   * If populated, only returns attributions that have
+   * [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * contained in output_indices. It must be an ndarray of integers, with the
+   * same shape of the output it's explaining.
+   *
+   * If not populated, returns attributions for
+   * [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k]
+   * indices of outputs. If neither top_k nor output_indices is populated,
+   * returns the argmax index of the outputs.
+   *
+   * Only applicable to Models that predict multiple outputs (e,g, multi-class
+   * Models that predict multiple classes).
+   * 
+ * + * .google.protobuf.ListValue output_indices = 5; + */ + com.google.protobuf.ListValueOrBuilder getOutputIndicesOrBuilder(); + + com.google.cloud.vertexai.api.ExplanationParameters.MethodCase getMethodCase(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationProto.java new file mode 100644 index 000000000000..dae8fd23bba5 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationProto.java @@ -0,0 +1,459 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public final class ExplanationProto { + private ExplanationProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Explanation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Explanation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ModelExplanation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ModelExplanation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Attribution_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Attribution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Neighbor_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Neighbor_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationParameters_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationParameters_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_SampledShapleyAttribution_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_SampledShapleyAttribution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_IntegratedGradientsAttribution_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_IntegratedGradientsAttribution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_XraiAttribution_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_XraiAttribution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_SmoothGradConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_SmoothGradConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_NoiseSigmaForFeature_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_NoiseSigmaForFeature_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_BlurBaselineConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_BlurBaselineConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Examples_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Examples_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Examples_ExampleGcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Examples_ExampleGcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Presets_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Presets_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationSpecOverride_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationSpecOverride_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputMetadataOverride_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputMetadataOverride_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExamplesOverride_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExamplesOverride_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExamplesRestrictionsNamespace_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExamplesRestrictionsNamespace_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n/google/cloud/vertexai/v1beta1/explanat" + + "ion.proto\022\035google.cloud.vertexai.v1beta1" + + "\032\037google/api/field_behavior.proto\0328googl" + + "e/cloud/vertexai/v1beta1/explanation_met" + + "adata.proto\032&google/cloud/vertexai/v1bet" + + "a1/io.proto\032\034google/protobuf/struct.prot" + + "o\"\227\001\n\013Explanation\022F\n\014attributions\030\001 \003(\0132" + + "*.google.cloud.vertexai.v1beta1.Attribut" + + "ionB\004\342A\001\003\022@\n\tneighbors\030\002 \003(\0132\'.google.cl" + + "oud.vertexai.v1beta1.NeighborB\004\342A\001\003\"_\n\020M" + + "odelExplanation\022K\n\021mean_attributions\030\001 \003" + + "(\0132*.google.cloud.vertexai.v1beta1.Attri" + + "butionB\004\342A\001\003\"\220\002\n\013Attribution\022#\n\025baseline" + + "_output_value\030\001 \001(\001B\004\342A\001\003\022#\n\025instance_ou" + + "tput_value\030\002 \001(\001B\004\342A\001\003\022:\n\024feature_attrib" + + "utions\030\003 \001(\0132\026.google.protobuf.ValueB\004\342A" + + "\001\003\022\032\n\014output_index\030\004 \003(\005B\004\342A\001\003\022!\n\023output" + + "_display_name\030\005 \001(\tB\004\342A\001\003\022!\n\023approximati" + + "on_error\030\006 \001(\001B\004\342A\001\003\022\031\n\013output_name\030\007 \001(" + + "\tB\004\342A\001\003\"F\n\010Neighbor\022\031\n\013neighbor_id\030\001 \001(\t" + + "B\004\342A\001\003\022\037\n\021neighbor_distance\030\002 \001(\001B\004\342A\001\003\"" + + "\255\001\n\017ExplanationSpec\022N\n\nparameters\030\001 \001(\0132" + + "4.google.cloud.vertexai.v1beta1.Explanat" + + "ionParametersB\004\342A\001\002\022J\n\010metadata\030\002 \001(\01322." + + "google.cloud.vertexai.v1beta1.Explanatio" + + "nMetadataB\004\342A\001\001\"\271\003\n\025ExplanationParameter" + + "s\022_\n\033sampled_shapley_attribution\030\001 \001(\01328" + + ".google.cloud.vertexai.v1beta1.SampledSh" + + "apleyAttributionH\000\022i\n integrated_gradien" + + "ts_attribution\030\002 \001(\0132=.google.cloud.vert" + + "exai.v1beta1.IntegratedGradientsAttribut" + + "ionH\000\022J\n\020xrai_attribution\030\003 \001(\0132..google" + + ".cloud.vertexai.v1beta1.XraiAttributionH" + + "\000\022;\n\010examples\030\007 \001(\0132\'.google.cloud.verte" + + "xai.v1beta1.ExamplesH\000\022\r\n\005top_k\030\004 \001(\005\0222\n" + + "\016output_indices\030\005 \001(\0132\032.google.protobuf." + + "ListValueB\010\n\006method\"5\n\031SampledShapleyAtt" + + "ribution\022\030\n\npath_count\030\001 \001(\005B\004\342A\001\002\"\330\001\n\036I" + + "ntegratedGradientsAttribution\022\030\n\nstep_co" + + "unt\030\001 \001(\005B\004\342A\001\002\022K\n\022smooth_grad_config\030\002 " + + "\001(\0132/.google.cloud.vertexai.v1beta1.Smoo" + + "thGradConfig\022O\n\024blur_baseline_config\030\003 \001" + + "(\01321.google.cloud.vertexai.v1beta1.BlurB" + + "aselineConfig\"\311\001\n\017XraiAttribution\022\030\n\nste" + + "p_count\030\001 \001(\005B\004\342A\001\002\022K\n\022smooth_grad_confi" + + "g\030\002 \001(\0132/.google.cloud.vertexai.v1beta1." + + "SmoothGradConfig\022O\n\024blur_baseline_config" + + "\030\003 \001(\01321.google.cloud.vertexai.v1beta1.B" + + "lurBaselineConfig\"\254\001\n\020SmoothGradConfig\022\025" + + "\n\013noise_sigma\030\001 \001(\002H\000\022O\n\023feature_noise_s" + + "igma\030\002 \001(\01320.google.cloud.vertexai.v1bet" + + "a1.FeatureNoiseSigmaH\000\022\032\n\022noisy_sample_c" + + "ount\030\003 \001(\005B\024\n\022GradientNoiseSigma\"\244\001\n\021Fea" + + "tureNoiseSigma\022Z\n\013noise_sigma\030\001 \003(\0132E.go" + + "ogle.cloud.vertexai.v1beta1.FeatureNoise" + + "Sigma.NoiseSigmaForFeature\0323\n\024NoiseSigma" + + "ForFeature\022\014\n\004name\030\001 \001(\t\022\r\n\005sigma\030\002 \001(\002\"" + + ",\n\022BlurBaselineConfig\022\026\n\016max_blur_sigma\030" + + "\001 \001(\002\"\254\004\n\010Examples\022V\n\022example_gcs_source" + + "\030\005 \001(\01328.google.cloud.vertexai.v1beta1.E" + + "xamples.ExampleGcsSourceH\000\022@\n\036nearest_ne" + + "ighbor_search_config\030\002 \001(\0132\026.google.prot" + + "obuf.ValueH\001\0229\n\007presets\030\004 \001(\0132&.google.c" + + "loud.vertexai.v1beta1.PresetsH\001\022<\n\ngcs_s" + + "ource\030\001 \001(\0132(.google.cloud.vertexai.v1be" + + "ta1.GcsSource\022\026\n\016neighbor_count\030\003 \001(\005\032\340\001" + + "\n\020ExampleGcsSource\022X\n\013data_format\030\001 \001(\0162" + + "C.google.cloud.vertexai.v1beta1.Examples" + + ".ExampleGcsSource.DataFormat\022<\n\ngcs_sour" + + "ce\030\002 \001(\0132(.google.cloud.vertexai.v1beta1" + + ".GcsSource\"4\n\nDataFormat\022\033\n\027DATA_FORMAT_" + + "UNSPECIFIED\020\000\022\t\n\005JSONL\020\001B\010\n\006sourceB\010\n\006co" + + "nfig\"\200\002\n\007Presets\022@\n\005query\030\001 \001(\0162,.google" + + ".cloud.vertexai.v1beta1.Presets.QueryH\000\210" + + "\001\001\022A\n\010modality\030\002 \001(\0162/.google.cloud.vert" + + "exai.v1beta1.Presets.Modality\"\036\n\005Query\022\013" + + "\n\007PRECISE\020\000\022\010\n\004FAST\020\001\"F\n\010Modality\022\030\n\024MOD" + + "ALITY_UNSPECIFIED\020\000\022\t\n\005IMAGE\020\001\022\010\n\004TEXT\020\002" + + "\022\013\n\007TABULAR\020\003B\010\n\006_query\"\375\001\n\027ExplanationS" + + "pecOverride\022H\n\nparameters\030\001 \001(\01324.google" + + ".cloud.vertexai.v1beta1.ExplanationParam" + + "eters\022L\n\010metadata\030\002 \001(\0132:.google.cloud.v" + + "ertexai.v1beta1.ExplanationMetadataOverr" + + "ide\022J\n\021examples_override\030\003 \001(\0132/.google." + + "cloud.vertexai.v1beta1.ExamplesOverride\"" + + "\306\002\n\033ExplanationMetadataOverride\022\\\n\006input" + + "s\030\001 \003(\0132F.google.cloud.vertexai.v1beta1." + + "ExplanationMetadataOverride.InputsEntryB" + + "\004\342A\001\002\032H\n\025InputMetadataOverride\022/\n\017input_" + + "baselines\030\001 \003(\0132\026.google.protobuf.Value\032" + + "\177\n\013InputsEntry\022\013\n\003key\030\001 \001(\t\022_\n\005value\030\002 \001" + + "(\0132P.google.cloud.vertexai.v1beta1.Expla" + + "nationMetadataOverride.InputMetadataOver" + + "ride:\0028\001\"\314\002\n\020ExamplesOverride\022\026\n\016neighbo" + + "r_count\030\001 \001(\005\022\026\n\016crowding_count\030\002 \001(\005\022R\n" + + "\014restrictions\030\003 \003(\0132<.google.cloud.verte" + + "xai.v1beta1.ExamplesRestrictionsNamespac" + + "e\022\031\n\021return_embeddings\030\004 \001(\010\022O\n\013data_for" + + "mat\030\005 \001(\0162:.google.cloud.vertexai.v1beta" + + "1.ExamplesOverride.DataFormat\"H\n\nDataFor" + + "mat\022\033\n\027DATA_FORMAT_UNSPECIFIED\020\000\022\r\n\tINST" + + "ANCES\020\001\022\016\n\nEMBEDDINGS\020\002\"T\n\035ExamplesRestr" + + "ictionsNamespace\022\026\n\016namespace_name\030\001 \001(\t" + + "\022\r\n\005allow\030\002 \003(\t\022\014\n\004deny\030\003 \003(\tB\325\001\n\035com.go" + + "ogle.cloud.vertexai.apiB\020ExplanationProt" + + "oP\001Z=cloud.google.com/go/vertexai/apiv1b" + + "eta1/vertexaipb;vertexaipb\252\002\035Google.Clou" + + "d.VertexAI.V1Beta1\312\002\035Google\\Cloud\\Vertex" + + "AI\\V1beta1\352\002 Google::Cloud::VertexAI::V1" + + "beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.vertexai.api.ExplanationMetadataProto.getDescriptor(), + com.google.cloud.vertexai.api.IoProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_Explanation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_Explanation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Explanation_descriptor, + new java.lang.String[] { + "Attributions", "Neighbors", + }); + internal_static_google_cloud_vertexai_v1beta1_ModelExplanation_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vertexai_v1beta1_ModelExplanation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ModelExplanation_descriptor, + new java.lang.String[] { + "MeanAttributions", + }); + internal_static_google_cloud_vertexai_v1beta1_Attribution_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vertexai_v1beta1_Attribution_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Attribution_descriptor, + new java.lang.String[] { + "BaselineOutputValue", + "InstanceOutputValue", + "FeatureAttributions", + "OutputIndex", + "OutputDisplayName", + "ApproximationError", + "OutputName", + }); + internal_static_google_cloud_vertexai_v1beta1_Neighbor_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vertexai_v1beta1_Neighbor_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Neighbor_descriptor, + new java.lang.String[] { + "NeighborId", "NeighborDistance", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationSpec_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vertexai_v1beta1_ExplanationSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationSpec_descriptor, + new java.lang.String[] { + "Parameters", "Metadata", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationParameters_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vertexai_v1beta1_ExplanationParameters_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationParameters_descriptor, + new java.lang.String[] { + "SampledShapleyAttribution", + "IntegratedGradientsAttribution", + "XraiAttribution", + "Examples", + "TopK", + "OutputIndices", + "Method", + }); + internal_static_google_cloud_vertexai_v1beta1_SampledShapleyAttribution_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_vertexai_v1beta1_SampledShapleyAttribution_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_SampledShapleyAttribution_descriptor, + new java.lang.String[] { + "PathCount", + }); + internal_static_google_cloud_vertexai_v1beta1_IntegratedGradientsAttribution_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_vertexai_v1beta1_IntegratedGradientsAttribution_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_IntegratedGradientsAttribution_descriptor, + new java.lang.String[] { + "StepCount", "SmoothGradConfig", "BlurBaselineConfig", + }); + internal_static_google_cloud_vertexai_v1beta1_XraiAttribution_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_vertexai_v1beta1_XraiAttribution_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_XraiAttribution_descriptor, + new java.lang.String[] { + "StepCount", "SmoothGradConfig", "BlurBaselineConfig", + }); + internal_static_google_cloud_vertexai_v1beta1_SmoothGradConfig_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_vertexai_v1beta1_SmoothGradConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_SmoothGradConfig_descriptor, + new java.lang.String[] { + "NoiseSigma", "FeatureNoiseSigma", "NoisySampleCount", "GradientNoiseSigma", + }); + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_descriptor, + new java.lang.String[] { + "NoiseSigma", + }); + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_NoiseSigmaForFeature_descriptor = + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_NoiseSigmaForFeature_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_NoiseSigmaForFeature_descriptor, + new java.lang.String[] { + "Name", "Sigma", + }); + internal_static_google_cloud_vertexai_v1beta1_BlurBaselineConfig_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_vertexai_v1beta1_BlurBaselineConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_BlurBaselineConfig_descriptor, + new java.lang.String[] { + "MaxBlurSigma", + }); + internal_static_google_cloud_vertexai_v1beta1_Examples_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_vertexai_v1beta1_Examples_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Examples_descriptor, + new java.lang.String[] { + "ExampleGcsSource", + "NearestNeighborSearchConfig", + "Presets", + "GcsSource", + "NeighborCount", + "Source", + "Config", + }); + internal_static_google_cloud_vertexai_v1beta1_Examples_ExampleGcsSource_descriptor = + internal_static_google_cloud_vertexai_v1beta1_Examples_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_Examples_ExampleGcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Examples_ExampleGcsSource_descriptor, + new java.lang.String[] { + "DataFormat", "GcsSource", + }); + internal_static_google_cloud_vertexai_v1beta1_Presets_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_vertexai_v1beta1_Presets_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Presets_descriptor, + new java.lang.String[] { + "Query", "Modality", "Query", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationSpecOverride_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_vertexai_v1beta1_ExplanationSpecOverride_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationSpecOverride_descriptor, + new java.lang.String[] { + "Parameters", "Metadata", "ExamplesOverride", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_descriptor, + new java.lang.String[] { + "Inputs", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputMetadataOverride_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputMetadataOverride_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputMetadataOverride_descriptor, + new java.lang.String[] { + "InputBaselines", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputsEntry_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplanationMetadataOverride_InputsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_vertexai_v1beta1_ExamplesOverride_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_vertexai_v1beta1_ExamplesOverride_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExamplesOverride_descriptor, + new java.lang.String[] { + "NeighborCount", "CrowdingCount", "Restrictions", "ReturnEmbeddings", "DataFormat", + }); + internal_static_google_cloud_vertexai_v1beta1_ExamplesRestrictionsNamespace_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_vertexai_v1beta1_ExamplesRestrictionsNamespace_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExamplesRestrictionsNamespace_descriptor, + new java.lang.String[] { + "NamespaceName", "Allow", "Deny", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.vertexai.api.ExplanationMetadataProto.getDescriptor(); + com.google.cloud.vertexai.api.IoProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpec.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpec.java new file mode 100644 index 000000000000..9dfb6bb55e21 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpec.java @@ -0,0 +1,1020 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Specification of Model explanation.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationSpec} + */ +public final class ExplanationSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplanationSpec) + ExplanationSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplanationSpec.newBuilder() to construct. + private ExplanationSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplanationSpec() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplanationSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationSpec.class, + com.google.cloud.vertexai.api.ExplanationSpec.Builder.class); + } + + public static final int PARAMETERS_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.ExplanationParameters parameters_; + /** + * + * + *
+   * Required. Parameters that configure explaining of the Model's predictions.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * Required. Parameters that configure explaining of the Model's predictions.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The parameters. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationParameters getParameters() { + return parameters_ == null + ? com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance() + : parameters_; + } + /** + * + * + *
+   * Required. Parameters that configure explaining of the Model's predictions.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationParametersOrBuilder getParametersOrBuilder() { + return parameters_ == null + ? com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance() + : parameters_; + } + + public static final int METADATA_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.ExplanationMetadata metadata_; + /** + * + * + *
+   * Optional. Metadata describing the Model's input and output for explanation.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Optional. Metadata describing the Model's input and output for explanation.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadata getMetadata() { + return metadata_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+   * Optional. Metadata describing the Model's input and output for explanation.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.getDefaultInstance() + : metadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (parameters_ != null) { + output.writeMessage(1, getParameters()); + } + if (metadata_ != null) { + output.writeMessage(2, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getParameters()); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExplanationSpec)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplanationSpec other = + (com.google.cloud.vertexai.api.ExplanationSpec) obj; + + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ExplanationSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Specification of Model explanation.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplanationSpec) + com.google.cloud.vertexai.api.ExplanationSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationSpec.class, + com.google.cloud.vertexai.api.ExplanationSpec.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ExplanationSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpec getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplanationSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpec build() { + com.google.cloud.vertexai.api.ExplanationSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpec buildPartial() { + com.google.cloud.vertexai.api.ExplanationSpec result = + new com.google.cloud.vertexai.api.ExplanationSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.ExplanationSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parameters_ = parametersBuilder_ == null ? parameters_ : parametersBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExplanationSpec) { + return mergeFrom((com.google.cloud.vertexai.api.ExplanationSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ExplanationSpec other) { + if (other == com.google.cloud.vertexai.api.ExplanationSpec.getDefaultInstance()) return this; + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.ExplanationParameters parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationParameters, + com.google.cloud.vertexai.api.ExplanationParameters.Builder, + com.google.cloud.vertexai.api.ExplanationParametersOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * Required. Parameters that configure explaining of the Model's predictions.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Parameters that configure explaining of the Model's predictions.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The parameters. + */ + public com.google.cloud.vertexai.api.ExplanationParameters getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null + ? com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance() + : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Parameters that configure explaining of the Model's predictions.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setParameters(com.google.cloud.vertexai.api.ExplanationParameters value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + } else { + parametersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parameters that configure explaining of the Model's predictions.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setParameters( + com.google.cloud.vertexai.api.ExplanationParameters.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parameters that configure explaining of the Model's predictions.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeParameters(com.google.cloud.vertexai.api.ExplanationParameters value) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && parameters_ != null + && parameters_ + != com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance()) { + getParametersBuilder().mergeFrom(value); + } else { + parameters_ = value; + } + } else { + parametersBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parameters that configure explaining of the Model's predictions.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearParameters() { + bitField0_ = (bitField0_ & ~0x00000001); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parameters that configure explaining of the Model's predictions.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.ExplanationParameters.Builder getParametersBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Parameters that configure explaining of the Model's predictions.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.ExplanationParametersOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null + ? com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance() + : parameters_; + } + } + /** + * + * + *
+     * Required. Parameters that configure explaining of the Model's predictions.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationParameters, + com.google.cloud.vertexai.api.ExplanationParameters.Builder, + com.google.cloud.vertexai.api.ExplanationParametersOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationParameters, + com.google.cloud.vertexai.api.ExplanationParameters.Builder, + com.google.cloud.vertexai.api.ExplanationParametersOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + private com.google.cloud.vertexai.api.ExplanationMetadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadata, + com.google.cloud.vertexai.api.ExplanationMetadata.Builder, + com.google.cloud.vertexai.api.ExplanationMetadataOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Optional. Metadata describing the Model's input and output for explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. Metadata describing the Model's input and output for explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The metadata. + */ + public com.google.cloud.vertexai.api.ExplanationMetadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Metadata describing the Model's input and output for explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMetadata(com.google.cloud.vertexai.api.ExplanationMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Metadata describing the Model's input and output for explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMetadata( + com.google.cloud.vertexai.api.ExplanationMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Metadata describing the Model's input and output for explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeMetadata(com.google.cloud.vertexai.api.ExplanationMetadata value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && metadata_ != null + && metadata_ + != com.google.cloud.vertexai.api.ExplanationMetadata.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Metadata describing the Model's input and output for explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000002); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Metadata describing the Model's input and output for explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.ExplanationMetadata.Builder getMetadataBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Metadata describing the Model's input and output for explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.ExplanationMetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadata.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+     * Optional. Metadata describing the Model's input and output for explanation.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadata, + com.google.cloud.vertexai.api.ExplanationMetadata.Builder, + com.google.cloud.vertexai.api.ExplanationMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadata, + com.google.cloud.vertexai.api.ExplanationMetadata.Builder, + com.google.cloud.vertexai.api.ExplanationMetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplanationSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplanationSpec) + private static final com.google.cloud.vertexai.api.ExplanationSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExplanationSpec(); + } + + public static com.google.cloud.vertexai.api.ExplanationSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplanationSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpecOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpecOrBuilder.java new file mode 100644 index 000000000000..3a25a4430383 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpecOrBuilder.java @@ -0,0 +1,107 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface ExplanationSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplanationSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parameters that configure explaining of the Model's predictions.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * Required. Parameters that configure explaining of the Model's predictions.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The parameters. + */ + com.google.cloud.vertexai.api.ExplanationParameters getParameters(); + /** + * + * + *
+   * Required. Parameters that configure explaining of the Model's predictions.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.ExplanationParametersOrBuilder getParametersOrBuilder(); + + /** + * + * + *
+   * Optional. Metadata describing the Model's input and output for explanation.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Optional. Metadata describing the Model's input and output for explanation.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The metadata. + */ + com.google.cloud.vertexai.api.ExplanationMetadata getMetadata(); + /** + * + * + *
+   * Optional. Metadata describing the Model's input and output for explanation.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.ExplanationMetadata metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.ExplanationMetadataOrBuilder getMetadataOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpecOverride.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpecOverride.java new file mode 100644 index 000000000000..2e0688e808c8 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpecOverride.java @@ -0,0 +1,1271 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec]
+ * entries that can be overridden at [online
+ * explanation][google.cloud.vertexai.v1beta1.PredictionService.Explain] time.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationSpecOverride} + */ +public final class ExplanationSpecOverride extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ExplanationSpecOverride) + ExplanationSpecOverrideOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplanationSpecOverride.newBuilder() to construct. + private ExplanationSpecOverride(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplanationSpecOverride() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplanationSpecOverride(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationSpecOverride_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationSpecOverride_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationSpecOverride.class, + com.google.cloud.vertexai.api.ExplanationSpecOverride.Builder.class); + } + + public static final int PARAMETERS_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.ExplanationParameters parameters_; + /** + * + * + *
+   * The parameters to be overridden. Note that the
+   * attribution method cannot be changed. If not specified,
+   * no parameter is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * The parameters to be overridden. Note that the
+   * attribution method cannot be changed. If not specified,
+   * no parameter is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationParameters getParameters() { + return parameters_ == null + ? com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance() + : parameters_; + } + /** + * + * + *
+   * The parameters to be overridden. Note that the
+   * attribution method cannot be changed. If not specified,
+   * no parameter is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationParametersOrBuilder getParametersOrBuilder() { + return parameters_ == null + ? com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance() + : parameters_; + } + + public static final int METADATA_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.ExplanationMetadataOverride metadata_; + /** + * + * + *
+   * The metadata to be overridden. If not specified, no metadata is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * The metadata to be overridden. If not specified, no metadata is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverride getMetadata() { + return metadata_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadataOverride.getDefaultInstance() + : metadata_; + } + /** + * + * + *
+   * The metadata to be overridden. If not specified, no metadata is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationMetadataOverrideOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadataOverride.getDefaultInstance() + : metadata_; + } + + public static final int EXAMPLES_OVERRIDE_FIELD_NUMBER = 3; + private com.google.cloud.vertexai.api.ExamplesOverride examplesOverride_; + /** + * + * + *
+   * The example-based explanations parameter overrides.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + * + * @return Whether the examplesOverride field is set. + */ + @java.lang.Override + public boolean hasExamplesOverride() { + return examplesOverride_ != null; + } + /** + * + * + *
+   * The example-based explanations parameter overrides.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + * + * @return The examplesOverride. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesOverride getExamplesOverride() { + return examplesOverride_ == null + ? com.google.cloud.vertexai.api.ExamplesOverride.getDefaultInstance() + : examplesOverride_; + } + /** + * + * + *
+   * The example-based explanations parameter overrides.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ExamplesOverrideOrBuilder getExamplesOverrideOrBuilder() { + return examplesOverride_ == null + ? com.google.cloud.vertexai.api.ExamplesOverride.getDefaultInstance() + : examplesOverride_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (parameters_ != null) { + output.writeMessage(1, getParameters()); + } + if (metadata_ != null) { + output.writeMessage(2, getMetadata()); + } + if (examplesOverride_ != null) { + output.writeMessage(3, getExamplesOverride()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getParameters()); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetadata()); + } + if (examplesOverride_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExamplesOverride()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ExplanationSpecOverride)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ExplanationSpecOverride other = + (com.google.cloud.vertexai.api.ExplanationSpecOverride) obj; + + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (hasExamplesOverride() != other.hasExamplesOverride()) return false; + if (hasExamplesOverride()) { + if (!getExamplesOverride().equals(other.getExamplesOverride())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (hasExamplesOverride()) { + hash = (37 * hash) + EXAMPLES_OVERRIDE_FIELD_NUMBER; + hash = (53 * hash) + getExamplesOverride().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.ExplanationSpecOverride prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec]
+   * entries that can be overridden at [online
+   * explanation][google.cloud.vertexai.v1beta1.PredictionService.Explain] time.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ExplanationSpecOverride} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ExplanationSpecOverride) + com.google.cloud.vertexai.api.ExplanationSpecOverrideOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationSpecOverride_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationSpecOverride_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ExplanationSpecOverride.class, + com.google.cloud.vertexai.api.ExplanationSpecOverride.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ExplanationSpecOverride.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + examplesOverride_ = null; + if (examplesOverrideBuilder_ != null) { + examplesOverrideBuilder_.dispose(); + examplesOverrideBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ExplanationSpecOverride_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpecOverride getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ExplanationSpecOverride.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpecOverride build() { + com.google.cloud.vertexai.api.ExplanationSpecOverride result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpecOverride buildPartial() { + com.google.cloud.vertexai.api.ExplanationSpecOverride result = + new com.google.cloud.vertexai.api.ExplanationSpecOverride(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.ExplanationSpecOverride result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parameters_ = parametersBuilder_ == null ? parameters_ : parametersBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.examplesOverride_ = + examplesOverrideBuilder_ == null ? examplesOverride_ : examplesOverrideBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ExplanationSpecOverride) { + return mergeFrom((com.google.cloud.vertexai.api.ExplanationSpecOverride) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ExplanationSpecOverride other) { + if (other == com.google.cloud.vertexai.api.ExplanationSpecOverride.getDefaultInstance()) + return this; + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (other.hasExamplesOverride()) { + mergeExamplesOverride(other.getExamplesOverride()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getExamplesOverrideFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.ExplanationParameters parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationParameters, + com.google.cloud.vertexai.api.ExplanationParameters.Builder, + com.google.cloud.vertexai.api.ExplanationParametersOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * The parameters to be overridden. Note that the
+     * attribution method cannot be changed. If not specified,
+     * no parameter is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The parameters to be overridden. Note that the
+     * attribution method cannot be changed. If not specified,
+     * no parameter is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + * + * @return The parameters. + */ + public com.google.cloud.vertexai.api.ExplanationParameters getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null + ? com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance() + : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The parameters to be overridden. Note that the
+     * attribution method cannot be changed. If not specified,
+     * no parameter is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + */ + public Builder setParameters(com.google.cloud.vertexai.api.ExplanationParameters value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + } else { + parametersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters to be overridden. Note that the
+     * attribution method cannot be changed. If not specified,
+     * no parameter is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + */ + public Builder setParameters( + com.google.cloud.vertexai.api.ExplanationParameters.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters to be overridden. Note that the
+     * attribution method cannot be changed. If not specified,
+     * no parameter is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + */ + public Builder mergeParameters(com.google.cloud.vertexai.api.ExplanationParameters value) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && parameters_ != null + && parameters_ + != com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance()) { + getParametersBuilder().mergeFrom(value); + } else { + parameters_ = value; + } + } else { + parametersBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters to be overridden. Note that the
+     * attribution method cannot be changed. If not specified,
+     * no parameter is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + */ + public Builder clearParameters() { + bitField0_ = (bitField0_ & ~0x00000001); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters to be overridden. Note that the
+     * attribution method cannot be changed. If not specified,
+     * no parameter is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + */ + public com.google.cloud.vertexai.api.ExplanationParameters.Builder getParametersBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The parameters to be overridden. Note that the
+     * attribution method cannot be changed. If not specified,
+     * no parameter is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + */ + public com.google.cloud.vertexai.api.ExplanationParametersOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null + ? com.google.cloud.vertexai.api.ExplanationParameters.getDefaultInstance() + : parameters_; + } + } + /** + * + * + *
+     * The parameters to be overridden. Note that the
+     * attribution method cannot be changed. If not specified,
+     * no parameter is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationParameters, + com.google.cloud.vertexai.api.ExplanationParameters.Builder, + com.google.cloud.vertexai.api.ExplanationParametersOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationParameters, + com.google.cloud.vertexai.api.ExplanationParameters.Builder, + com.google.cloud.vertexai.api.ExplanationParametersOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + private com.google.cloud.vertexai.api.ExplanationMetadataOverride metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadataOverride, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.Builder, + com.google.cloud.vertexai.api.ExplanationMetadataOverrideOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * The metadata to be overridden. If not specified, no metadata is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The metadata to be overridden. If not specified, no metadata is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + * + * @return The metadata. + */ + public com.google.cloud.vertexai.api.ExplanationMetadataOverride getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadataOverride.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The metadata to be overridden. If not specified, no metadata is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + */ + public Builder setMetadata(com.google.cloud.vertexai.api.ExplanationMetadataOverride value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The metadata to be overridden. If not specified, no metadata is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + */ + public Builder setMetadata( + com.google.cloud.vertexai.api.ExplanationMetadataOverride.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The metadata to be overridden. If not specified, no metadata is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + */ + public Builder mergeMetadata(com.google.cloud.vertexai.api.ExplanationMetadataOverride value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && metadata_ != null + && metadata_ + != com.google.cloud.vertexai.api.ExplanationMetadataOverride.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The metadata to be overridden. If not specified, no metadata is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000002); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The metadata to be overridden. If not specified, no metadata is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + */ + public com.google.cloud.vertexai.api.ExplanationMetadataOverride.Builder getMetadataBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The metadata to be overridden. If not specified, no metadata is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + */ + public com.google.cloud.vertexai.api.ExplanationMetadataOverrideOrBuilder + getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.cloud.vertexai.api.ExplanationMetadataOverride.getDefaultInstance() + : metadata_; + } + } + /** + * + * + *
+     * The metadata to be overridden. If not specified, no metadata is overridden.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadataOverride, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.Builder, + com.google.cloud.vertexai.api.ExplanationMetadataOverrideOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExplanationMetadataOverride, + com.google.cloud.vertexai.api.ExplanationMetadataOverride.Builder, + com.google.cloud.vertexai.api.ExplanationMetadataOverrideOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private com.google.cloud.vertexai.api.ExamplesOverride examplesOverride_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExamplesOverride, + com.google.cloud.vertexai.api.ExamplesOverride.Builder, + com.google.cloud.vertexai.api.ExamplesOverrideOrBuilder> + examplesOverrideBuilder_; + /** + * + * + *
+     * The example-based explanations parameter overrides.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + * + * @return Whether the examplesOverride field is set. + */ + public boolean hasExamplesOverride() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The example-based explanations parameter overrides.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + * + * @return The examplesOverride. + */ + public com.google.cloud.vertexai.api.ExamplesOverride getExamplesOverride() { + if (examplesOverrideBuilder_ == null) { + return examplesOverride_ == null + ? com.google.cloud.vertexai.api.ExamplesOverride.getDefaultInstance() + : examplesOverride_; + } else { + return examplesOverrideBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The example-based explanations parameter overrides.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + */ + public Builder setExamplesOverride(com.google.cloud.vertexai.api.ExamplesOverride value) { + if (examplesOverrideBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + examplesOverride_ = value; + } else { + examplesOverrideBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The example-based explanations parameter overrides.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + */ + public Builder setExamplesOverride( + com.google.cloud.vertexai.api.ExamplesOverride.Builder builderForValue) { + if (examplesOverrideBuilder_ == null) { + examplesOverride_ = builderForValue.build(); + } else { + examplesOverrideBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The example-based explanations parameter overrides.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + */ + public Builder mergeExamplesOverride(com.google.cloud.vertexai.api.ExamplesOverride value) { + if (examplesOverrideBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && examplesOverride_ != null + && examplesOverride_ + != com.google.cloud.vertexai.api.ExamplesOverride.getDefaultInstance()) { + getExamplesOverrideBuilder().mergeFrom(value); + } else { + examplesOverride_ = value; + } + } else { + examplesOverrideBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The example-based explanations parameter overrides.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + */ + public Builder clearExamplesOverride() { + bitField0_ = (bitField0_ & ~0x00000004); + examplesOverride_ = null; + if (examplesOverrideBuilder_ != null) { + examplesOverrideBuilder_.dispose(); + examplesOverrideBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The example-based explanations parameter overrides.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + */ + public com.google.cloud.vertexai.api.ExamplesOverride.Builder getExamplesOverrideBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getExamplesOverrideFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The example-based explanations parameter overrides.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + */ + public com.google.cloud.vertexai.api.ExamplesOverrideOrBuilder getExamplesOverrideOrBuilder() { + if (examplesOverrideBuilder_ != null) { + return examplesOverrideBuilder_.getMessageOrBuilder(); + } else { + return examplesOverride_ == null + ? com.google.cloud.vertexai.api.ExamplesOverride.getDefaultInstance() + : examplesOverride_; + } + } + /** + * + * + *
+     * The example-based explanations parameter overrides.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExamplesOverride, + com.google.cloud.vertexai.api.ExamplesOverride.Builder, + com.google.cloud.vertexai.api.ExamplesOverrideOrBuilder> + getExamplesOverrideFieldBuilder() { + if (examplesOverrideBuilder_ == null) { + examplesOverrideBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ExamplesOverride, + com.google.cloud.vertexai.api.ExamplesOverride.Builder, + com.google.cloud.vertexai.api.ExamplesOverrideOrBuilder>( + getExamplesOverride(), getParentForChildren(), isClean()); + examplesOverride_ = null; + } + return examplesOverrideBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ExplanationSpecOverride) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ExplanationSpecOverride) + private static final com.google.cloud.vertexai.api.ExplanationSpecOverride DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ExplanationSpecOverride(); + } + + public static com.google.cloud.vertexai.api.ExplanationSpecOverride getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplanationSpecOverride parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ExplanationSpecOverride getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpecOverrideOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpecOverrideOrBuilder.java new file mode 100644 index 000000000000..4282c383e430 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ExplanationSpecOverrideOrBuilder.java @@ -0,0 +1,136 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface ExplanationSpecOverrideOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ExplanationSpecOverride) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The parameters to be overridden. Note that the
+   * attribution method cannot be changed. If not specified,
+   * no parameter is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * The parameters to be overridden. Note that the
+   * attribution method cannot be changed. If not specified,
+   * no parameter is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + * + * @return The parameters. + */ + com.google.cloud.vertexai.api.ExplanationParameters getParameters(); + /** + * + * + *
+   * The parameters to be overridden. Note that the
+   * attribution method cannot be changed. If not specified,
+   * no parameter is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationParameters parameters = 1; + */ + com.google.cloud.vertexai.api.ExplanationParametersOrBuilder getParametersOrBuilder(); + + /** + * + * + *
+   * The metadata to be overridden. If not specified, no metadata is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * The metadata to be overridden. If not specified, no metadata is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + * + * @return The metadata. + */ + com.google.cloud.vertexai.api.ExplanationMetadataOverride getMetadata(); + /** + * + * + *
+   * The metadata to be overridden. If not specified, no metadata is overridden.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExplanationMetadataOverride metadata = 2; + */ + com.google.cloud.vertexai.api.ExplanationMetadataOverrideOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+   * The example-based explanations parameter overrides.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + * + * @return Whether the examplesOverride field is set. + */ + boolean hasExamplesOverride(); + /** + * + * + *
+   * The example-based explanations parameter overrides.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + * + * @return The examplesOverride. + */ + com.google.cloud.vertexai.api.ExamplesOverride getExamplesOverride(); + /** + * + * + *
+   * The example-based explanations parameter overrides.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.ExamplesOverride examples_override = 3; + */ + com.google.cloud.vertexai.api.ExamplesOverrideOrBuilder getExamplesOverrideOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FeatureNoiseSigma.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FeatureNoiseSigma.java new file mode 100644 index 000000000000..b3abf906dd59 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FeatureNoiseSigma.java @@ -0,0 +1,1826 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Noise sigma by features. Noise sigma represents the standard deviation of the
+ * gaussian kernel that will be used to add noise to interpolated inputs prior
+ * to computing gradients.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FeatureNoiseSigma} + */ +public final class FeatureNoiseSigma extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.FeatureNoiseSigma) + FeatureNoiseSigmaOrBuilder { + private static final long serialVersionUID = 0L; + // Use FeatureNoiseSigma.newBuilder() to construct. + private FeatureNoiseSigma(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FeatureNoiseSigma() { + noiseSigma_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FeatureNoiseSigma(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FeatureNoiseSigma.class, + com.google.cloud.vertexai.api.FeatureNoiseSigma.Builder.class); + } + + public interface NoiseSigmaForFeatureOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the input feature for which noise sigma is provided. The
+     * features are defined in
+     * [explanation metadata
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * The name of the input feature for which noise sigma is provided. The
+     * features are defined in
+     * [explanation metadata
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * This represents the standard deviation of the Gaussian kernel that will
+     * be used to add noise to the feature prior to computing gradients. Similar
+     * to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * but represents the noise added to the current feature. Defaults to 0.1.
+     * 
+ * + * float sigma = 2; + * + * @return The sigma. + */ + float getSigma(); + } + /** + * + * + *
+   * Noise sigma for a single feature.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature} + */ + public static final class NoiseSigmaForFeature extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature) + NoiseSigmaForFeatureOrBuilder { + private static final long serialVersionUID = 0L; + // Use NoiseSigmaForFeature.newBuilder() to construct. + private NoiseSigmaForFeature(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NoiseSigmaForFeature() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NoiseSigmaForFeature(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_NoiseSigmaForFeature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_NoiseSigmaForFeature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.class, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the input feature for which noise sigma is provided. The
+     * features are defined in
+     * [explanation metadata
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the input feature for which noise sigma is provided. The
+     * features are defined in
+     * [explanation metadata
+     * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIGMA_FIELD_NUMBER = 2; + private float sigma_ = 0F; + /** + * + * + *
+     * This represents the standard deviation of the Gaussian kernel that will
+     * be used to add noise to the feature prior to computing gradients. Similar
+     * to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * but represents the noise added to the current feature. Defaults to 0.1.
+     * 
+ * + * float sigma = 2; + * + * @return The sigma. + */ + @java.lang.Override + public float getSigma() { + return sigma_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (java.lang.Float.floatToRawIntBits(sigma_) != 0) { + output.writeFloat(2, sigma_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (java.lang.Float.floatToRawIntBits(sigma_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, sigma_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature other = + (com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature) obj; + + if (!getName().equals(other.getName())) return false; + if (java.lang.Float.floatToIntBits(getSigma()) + != java.lang.Float.floatToIntBits(other.getSigma())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + SIGMA_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getSigma()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Noise sigma for a single feature.
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature) + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeatureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_NoiseSigmaForFeature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_NoiseSigmaForFeature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.class, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + sigma_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_NoiseSigmaForFeature_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature build() { + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature buildPartial() { + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature result = + new com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sigma_ = sigma_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature) { + return mergeFrom( + (com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature other) { + if (other + == com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getSigma() != 0F) { + setSigma(other.getSigma()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: + { + sigma_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * The name of the input feature for which noise sigma is provided. The
+       * features are defined in
+       * [explanation metadata
+       * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the input feature for which noise sigma is provided. The
+       * features are defined in
+       * [explanation metadata
+       * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the input feature for which noise sigma is provided. The
+       * features are defined in
+       * [explanation metadata
+       * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+       * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the input feature for which noise sigma is provided. The
+       * features are defined in
+       * [explanation metadata
+       * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the input feature for which noise sigma is provided. The
+       * features are defined in
+       * [explanation metadata
+       * inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs].
+       * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private float sigma_; + /** + * + * + *
+       * This represents the standard deviation of the Gaussian kernel that will
+       * be used to add noise to the feature prior to computing gradients. Similar
+       * to
+       * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+       * but represents the noise added to the current feature. Defaults to 0.1.
+       * 
+ * + * float sigma = 2; + * + * @return The sigma. + */ + @java.lang.Override + public float getSigma() { + return sigma_; + } + /** + * + * + *
+       * This represents the standard deviation of the Gaussian kernel that will
+       * be used to add noise to the feature prior to computing gradients. Similar
+       * to
+       * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+       * but represents the noise added to the current feature. Defaults to 0.1.
+       * 
+ * + * float sigma = 2; + * + * @param value The sigma to set. + * @return This builder for chaining. + */ + public Builder setSigma(float value) { + + sigma_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * This represents the standard deviation of the Gaussian kernel that will
+       * be used to add noise to the feature prior to computing gradients. Similar
+       * to
+       * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+       * but represents the noise added to the current feature. Defaults to 0.1.
+       * 
+ * + * float sigma = 2; + * + * @return This builder for chaining. + */ + public Builder clearSigma() { + bitField0_ = (bitField0_ & ~0x00000002); + sigma_ = 0F; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature) + private static final com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature(); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NoiseSigmaForFeature parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NOISE_SIGMA_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + noiseSigma_; + /** + * + * + *
+   * Noise sigma per feature. No noise is added to features that are not set.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + @java.lang.Override + public java.util.List + getNoiseSigmaList() { + return noiseSigma_; + } + /** + * + * + *
+   * Noise sigma per feature. No noise is added to features that are not set.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeatureOrBuilder> + getNoiseSigmaOrBuilderList() { + return noiseSigma_; + } + /** + * + * + *
+   * Noise sigma per feature. No noise is added to features that are not set.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + @java.lang.Override + public int getNoiseSigmaCount() { + return noiseSigma_.size(); + } + /** + * + * + *
+   * Noise sigma per feature. No noise is added to features that are not set.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature getNoiseSigma( + int index) { + return noiseSigma_.get(index); + } + /** + * + * + *
+   * Noise sigma per feature. No noise is added to features that are not set.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeatureOrBuilder + getNoiseSigmaOrBuilder(int index) { + return noiseSigma_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < noiseSigma_.size(); i++) { + output.writeMessage(1, noiseSigma_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < noiseSigma_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, noiseSigma_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.FeatureNoiseSigma)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.FeatureNoiseSigma other = + (com.google.cloud.vertexai.api.FeatureNoiseSigma) obj; + + if (!getNoiseSigmaList().equals(other.getNoiseSigmaList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNoiseSigmaCount() > 0) { + hash = (37 * hash) + NOISE_SIGMA_FIELD_NUMBER; + hash = (53 * hash) + getNoiseSigmaList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.FeatureNoiseSigma prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Noise sigma by features. Noise sigma represents the standard deviation of the
+   * gaussian kernel that will be used to add noise to interpolated inputs prior
+   * to computing gradients.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FeatureNoiseSigma} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.FeatureNoiseSigma) + com.google.cloud.vertexai.api.FeatureNoiseSigmaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FeatureNoiseSigma.class, + com.google.cloud.vertexai.api.FeatureNoiseSigma.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.FeatureNoiseSigma.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (noiseSigmaBuilder_ == null) { + noiseSigma_ = java.util.Collections.emptyList(); + } else { + noiseSigma_ = null; + noiseSigmaBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_FeatureNoiseSigma_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.FeatureNoiseSigma.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma build() { + com.google.cloud.vertexai.api.FeatureNoiseSigma result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma buildPartial() { + com.google.cloud.vertexai.api.FeatureNoiseSigma result = + new com.google.cloud.vertexai.api.FeatureNoiseSigma(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.FeatureNoiseSigma result) { + if (noiseSigmaBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + noiseSigma_ = java.util.Collections.unmodifiableList(noiseSigma_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.noiseSigma_ = noiseSigma_; + } else { + result.noiseSigma_ = noiseSigmaBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.FeatureNoiseSigma result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.FeatureNoiseSigma) { + return mergeFrom((com.google.cloud.vertexai.api.FeatureNoiseSigma) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.FeatureNoiseSigma other) { + if (other == com.google.cloud.vertexai.api.FeatureNoiseSigma.getDefaultInstance()) + return this; + if (noiseSigmaBuilder_ == null) { + if (!other.noiseSigma_.isEmpty()) { + if (noiseSigma_.isEmpty()) { + noiseSigma_ = other.noiseSigma_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNoiseSigmaIsMutable(); + noiseSigma_.addAll(other.noiseSigma_); + } + onChanged(); + } + } else { + if (!other.noiseSigma_.isEmpty()) { + if (noiseSigmaBuilder_.isEmpty()) { + noiseSigmaBuilder_.dispose(); + noiseSigmaBuilder_ = null; + noiseSigma_ = other.noiseSigma_; + bitField0_ = (bitField0_ & ~0x00000001); + noiseSigmaBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNoiseSigmaFieldBuilder() + : null; + } else { + noiseSigmaBuilder_.addAllMessages(other.noiseSigma_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature m = + input.readMessage( + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + .parser(), + extensionRegistry); + if (noiseSigmaBuilder_ == null) { + ensureNoiseSigmaIsMutable(); + noiseSigma_.add(m); + } else { + noiseSigmaBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + noiseSigma_ = java.util.Collections.emptyList(); + + private void ensureNoiseSigmaIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + noiseSigma_ = + new java.util.ArrayList< + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature>(noiseSigma_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeatureOrBuilder> + noiseSigmaBuilder_; + + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public java.util.List + getNoiseSigmaList() { + if (noiseSigmaBuilder_ == null) { + return java.util.Collections.unmodifiableList(noiseSigma_); + } else { + return noiseSigmaBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public int getNoiseSigmaCount() { + if (noiseSigmaBuilder_ == null) { + return noiseSigma_.size(); + } else { + return noiseSigmaBuilder_.getCount(); + } + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature getNoiseSigma( + int index) { + if (noiseSigmaBuilder_ == null) { + return noiseSigma_.get(index); + } else { + return noiseSigmaBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public Builder setNoiseSigma( + int index, com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature value) { + if (noiseSigmaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNoiseSigmaIsMutable(); + noiseSigma_.set(index, value); + onChanged(); + } else { + noiseSigmaBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public Builder setNoiseSigma( + int index, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder + builderForValue) { + if (noiseSigmaBuilder_ == null) { + ensureNoiseSigmaIsMutable(); + noiseSigma_.set(index, builderForValue.build()); + onChanged(); + } else { + noiseSigmaBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public Builder addNoiseSigma( + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature value) { + if (noiseSigmaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNoiseSigmaIsMutable(); + noiseSigma_.add(value); + onChanged(); + } else { + noiseSigmaBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public Builder addNoiseSigma( + int index, com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature value) { + if (noiseSigmaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNoiseSigmaIsMutable(); + noiseSigma_.add(index, value); + onChanged(); + } else { + noiseSigmaBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public Builder addNoiseSigma( + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder + builderForValue) { + if (noiseSigmaBuilder_ == null) { + ensureNoiseSigmaIsMutable(); + noiseSigma_.add(builderForValue.build()); + onChanged(); + } else { + noiseSigmaBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public Builder addNoiseSigma( + int index, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder + builderForValue) { + if (noiseSigmaBuilder_ == null) { + ensureNoiseSigmaIsMutable(); + noiseSigma_.add(index, builderForValue.build()); + onChanged(); + } else { + noiseSigmaBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public Builder addAllNoiseSigma( + java.lang.Iterable< + ? extends com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature> + values) { + if (noiseSigmaBuilder_ == null) { + ensureNoiseSigmaIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, noiseSigma_); + onChanged(); + } else { + noiseSigmaBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public Builder clearNoiseSigma() { + if (noiseSigmaBuilder_ == null) { + noiseSigma_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + noiseSigmaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public Builder removeNoiseSigma(int index) { + if (noiseSigmaBuilder_ == null) { + ensureNoiseSigmaIsMutable(); + noiseSigma_.remove(index); + onChanged(); + } else { + noiseSigmaBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder + getNoiseSigmaBuilder(int index) { + return getNoiseSigmaFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeatureOrBuilder + getNoiseSigmaOrBuilder(int index) { + if (noiseSigmaBuilder_ == null) { + return noiseSigma_.get(index); + } else { + return noiseSigmaBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeatureOrBuilder> + getNoiseSigmaOrBuilderList() { + if (noiseSigmaBuilder_ != null) { + return noiseSigmaBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(noiseSigma_); + } + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder + addNoiseSigmaBuilder() { + return getNoiseSigmaFieldBuilder() + .addBuilder( + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + .getDefaultInstance()); + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder + addNoiseSigmaBuilder(int index) { + return getNoiseSigmaFieldBuilder() + .addBuilder( + index, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature + .getDefaultInstance()); + } + /** + * + * + *
+     * Noise sigma per feature. No noise is added to features that are not set.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + public java.util.List< + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder> + getNoiseSigmaBuilderList() { + return getNoiseSigmaFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeatureOrBuilder> + getNoiseSigmaFieldBuilder() { + if (noiseSigmaBuilder_ == null) { + noiseSigmaBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature.Builder, + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeatureOrBuilder>( + noiseSigma_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + noiseSigma_ = null; + } + return noiseSigmaBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.FeatureNoiseSigma) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.FeatureNoiseSigma) + private static final com.google.cloud.vertexai.api.FeatureNoiseSigma DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.FeatureNoiseSigma(); + } + + public static com.google.cloud.vertexai.api.FeatureNoiseSigma getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FeatureNoiseSigma parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FeatureNoiseSigmaOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FeatureNoiseSigmaOrBuilder.java new file mode 100644 index 000000000000..1a840307bf51 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FeatureNoiseSigmaOrBuilder.java @@ -0,0 +1,90 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface FeatureNoiseSigmaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.FeatureNoiseSigma) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Noise sigma per feature. No noise is added to features that are not set.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + java.util.List + getNoiseSigmaList(); + /** + * + * + *
+   * Noise sigma per feature. No noise is added to features that are not set.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeature getNoiseSigma(int index); + /** + * + * + *
+   * Noise sigma per feature. No noise is added to features that are not set.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + int getNoiseSigmaCount(); + /** + * + * + *
+   * Noise sigma per feature. No noise is added to features that are not set.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + java.util.List< + ? extends com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeatureOrBuilder> + getNoiseSigmaOrBuilderList(); + /** + * + * + *
+   * Noise sigma per feature. No noise is added to features that are not set.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FeatureNoiseSigma.NoiseSigmaForFeature noise_sigma = 1; + * + */ + com.google.cloud.vertexai.api.FeatureNoiseSigma.NoiseSigmaForFeatureOrBuilder + getNoiseSigmaOrBuilder(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FileData.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FileData.java new file mode 100644 index 000000000000..b1d5fad9e7ff --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FileData.java @@ -0,0 +1,804 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * URI based data.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FileData} + */ +public final class FileData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.FileData) + FileDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use FileData.newBuilder() to construct. + private FileData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FileData() { + mimeType_ = ""; + fileUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FileData(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_FileData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_FileData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FileData.class, + com.google.cloud.vertexai.api.FileData.Builder.class); + } + + public static final int MIME_TYPE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object mimeType_ = ""; + /** + * + * + *
+   * Required. The IANA standard MIME type of the source data.
+   * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + @java.lang.Override + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The IANA standard MIME type of the source data.
+   * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_URI_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object fileUri_ = ""; + /** + * + * + *
+   * Required. URI.
+   * 
+ * + * string file_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fileUri. + */ + @java.lang.Override + public java.lang.String getFileUri() { + java.lang.Object ref = fileUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fileUri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. URI.
+   * 
+ * + * string file_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fileUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFileUriBytes() { + java.lang.Object ref = fileUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fileUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mimeType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fileUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fileUri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mimeType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fileUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fileUri_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.FileData)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.FileData other = (com.google.cloud.vertexai.api.FileData) obj; + + if (!getMimeType().equals(other.getMimeType())) return false; + if (!getFileUri().equals(other.getFileUri())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + hash = (37 * hash) + FILE_URI_FIELD_NUMBER; + hash = (53 * hash) + getFileUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.FileData parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FileData parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FileData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FileData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FileData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FileData parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FileData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FileData parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FileData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FileData parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FileData parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FileData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.FileData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * URI based data.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FileData} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.FileData) + com.google.cloud.vertexai.api.FileDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_FileData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_FileData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FileData.class, + com.google.cloud.vertexai.api.FileData.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.FileData.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mimeType_ = ""; + fileUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_FileData_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FileData getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.FileData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FileData build() { + com.google.cloud.vertexai.api.FileData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FileData buildPartial() { + com.google.cloud.vertexai.api.FileData result = + new com.google.cloud.vertexai.api.FileData(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.FileData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mimeType_ = mimeType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fileUri_ = fileUri_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.FileData) { + return mergeFrom((com.google.cloud.vertexai.api.FileData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.FileData other) { + if (other == com.google.cloud.vertexai.api.FileData.getDefaultInstance()) return this; + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFileUri().isEmpty()) { + fileUri_ = other.fileUri_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + mimeType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + fileUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object mimeType_ = ""; + /** + * + * + *
+     * Required. The IANA standard MIME type of the source data.
+     * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The IANA standard MIME type of the source data.
+     * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The IANA standard MIME type of the source data.
+     * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + mimeType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IANA standard MIME type of the source data.
+     * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMimeType() { + mimeType_ = getDefaultInstance().getMimeType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IANA standard MIME type of the source data.
+     * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + mimeType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object fileUri_ = ""; + /** + * + * + *
+     * Required. URI.
+     * 
+ * + * string file_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fileUri. + */ + public java.lang.String getFileUri() { + java.lang.Object ref = fileUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fileUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. URI.
+     * 
+ * + * string file_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fileUri. + */ + public com.google.protobuf.ByteString getFileUriBytes() { + java.lang.Object ref = fileUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fileUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. URI.
+     * 
+ * + * string file_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The fileUri to set. + * @return This builder for chaining. + */ + public Builder setFileUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fileUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URI.
+     * 
+ * + * string file_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFileUri() { + fileUri_ = getDefaultInstance().getFileUri(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URI.
+     * 
+ * + * string file_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for fileUri to set. + * @return This builder for chaining. + */ + public Builder setFileUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fileUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.FileData) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.FileData) + private static final com.google.cloud.vertexai.api.FileData DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.FileData(); + } + + public static com.google.cloud.vertexai.api.FileData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FileData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FileDataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FileDataOrBuilder.java new file mode 100644 index 000000000000..242f2ceb5dc3 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FileDataOrBuilder.java @@ -0,0 +1,75 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface FileDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.FileData) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The IANA standard MIME type of the source data.
+   * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mimeType. + */ + java.lang.String getMimeType(); + /** + * + * + *
+   * Required. The IANA standard MIME type of the source data.
+   * 
+ * + * string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mimeType. + */ + com.google.protobuf.ByteString getMimeTypeBytes(); + + /** + * + * + *
+   * Required. URI.
+   * 
+ * + * string file_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fileUri. + */ + java.lang.String getFileUri(); + /** + * + * + *
+   * Required. URI.
+   * 
+ * + * string file_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fileUri. + */ + com.google.protobuf.ByteString getFileUriBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionCall.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionCall.java new file mode 100644 index 000000000000..30f1e405074b --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionCall.java @@ -0,0 +1,901 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/tool.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A predicted [FunctionCall] returned from the model that contains a string
+ * representing the [FunctionDeclaration.name] and a structured JSON object
+ * containing the parameters and their values.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FunctionCall} + */ +public final class FunctionCall extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.FunctionCall) + FunctionCallOrBuilder { + private static final long serialVersionUID = 0L; + // Use FunctionCall.newBuilder() to construct. + private FunctionCall(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FunctionCall() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FunctionCall(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionCall_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionCall_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FunctionCall.class, + com.google.cloud.vertexai.api.FunctionCall.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the function to call.
+   * Matches [FunctionDeclaration.name].
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the function to call.
+   * Matches [FunctionDeclaration.name].
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ARGS_FIELD_NUMBER = 2; + private com.google.protobuf.Struct args_; + /** + * + * + *
+   * Optional. Required. The function parameters and values in JSON object
+   * format. See [FunctionDeclaration.parameters] for parameter details.
+   * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the args field is set. + */ + @java.lang.Override + public boolean hasArgs() { + return args_ != null; + } + /** + * + * + *
+   * Optional. Required. The function parameters and values in JSON object
+   * format. See [FunctionDeclaration.parameters] for parameter details.
+   * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The args. + */ + @java.lang.Override + public com.google.protobuf.Struct getArgs() { + return args_ == null ? com.google.protobuf.Struct.getDefaultInstance() : args_; + } + /** + * + * + *
+   * Optional. Required. The function parameters and values in JSON object
+   * format. See [FunctionDeclaration.parameters] for parameter details.
+   * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getArgsOrBuilder() { + return args_ == null ? com.google.protobuf.Struct.getDefaultInstance() : args_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (args_ != null) { + output.writeMessage(2, getArgs()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (args_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getArgs()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.FunctionCall)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.FunctionCall other = + (com.google.cloud.vertexai.api.FunctionCall) obj; + + if (!getName().equals(other.getName())) return false; + if (hasArgs() != other.hasArgs()) return false; + if (hasArgs()) { + if (!getArgs().equals(other.getArgs())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasArgs()) { + hash = (37 * hash) + ARGS_FIELD_NUMBER; + hash = (53 * hash) + getArgs().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.FunctionCall parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FunctionCall parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.FunctionCall prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A predicted [FunctionCall] returned from the model that contains a string
+   * representing the [FunctionDeclaration.name] and a structured JSON object
+   * containing the parameters and their values.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FunctionCall} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.FunctionCall) + com.google.cloud.vertexai.api.FunctionCallOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionCall_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionCall_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FunctionCall.class, + com.google.cloud.vertexai.api.FunctionCall.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.FunctionCall.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + args_ = null; + if (argsBuilder_ != null) { + argsBuilder_.dispose(); + argsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionCall_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionCall getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.FunctionCall.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionCall build() { + com.google.cloud.vertexai.api.FunctionCall result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionCall buildPartial() { + com.google.cloud.vertexai.api.FunctionCall result = + new com.google.cloud.vertexai.api.FunctionCall(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.FunctionCall result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.args_ = argsBuilder_ == null ? args_ : argsBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.FunctionCall) { + return mergeFrom((com.google.cloud.vertexai.api.FunctionCall) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.FunctionCall other) { + if (other == com.google.cloud.vertexai.api.FunctionCall.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasArgs()) { + mergeArgs(other.getArgs()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getArgsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the function to call.
+     * Matches [FunctionDeclaration.name].
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Matches [FunctionDeclaration.name].
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Matches [FunctionDeclaration.name].
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Matches [FunctionDeclaration.name].
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Matches [FunctionDeclaration.name].
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Struct args_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + argsBuilder_; + /** + * + * + *
+     * Optional. Required. The function parameters and values in JSON object
+     * format. See [FunctionDeclaration.parameters] for parameter details.
+     * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the args field is set. + */ + public boolean hasArgs() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. Required. The function parameters and values in JSON object
+     * format. See [FunctionDeclaration.parameters] for parameter details.
+     * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The args. + */ + public com.google.protobuf.Struct getArgs() { + if (argsBuilder_ == null) { + return args_ == null ? com.google.protobuf.Struct.getDefaultInstance() : args_; + } else { + return argsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Required. The function parameters and values in JSON object
+     * format. See [FunctionDeclaration.parameters] for parameter details.
+     * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setArgs(com.google.protobuf.Struct value) { + if (argsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + args_ = value; + } else { + argsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required. The function parameters and values in JSON object
+     * format. See [FunctionDeclaration.parameters] for parameter details.
+     * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setArgs(com.google.protobuf.Struct.Builder builderForValue) { + if (argsBuilder_ == null) { + args_ = builderForValue.build(); + } else { + argsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required. The function parameters and values in JSON object
+     * format. See [FunctionDeclaration.parameters] for parameter details.
+     * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder mergeArgs(com.google.protobuf.Struct value) { + if (argsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && args_ != null + && args_ != com.google.protobuf.Struct.getDefaultInstance()) { + getArgsBuilder().mergeFrom(value); + } else { + args_ = value; + } + } else { + argsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required. The function parameters and values in JSON object
+     * format. See [FunctionDeclaration.parameters] for parameter details.
+     * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearArgs() { + bitField0_ = (bitField0_ & ~0x00000002); + args_ = null; + if (argsBuilder_ != null) { + argsBuilder_.dispose(); + argsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required. The function parameters and values in JSON object
+     * format. See [FunctionDeclaration.parameters] for parameter details.
+     * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.Struct.Builder getArgsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getArgsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Required. The function parameters and values in JSON object
+     * format. See [FunctionDeclaration.parameters] for parameter details.
+     * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.StructOrBuilder getArgsOrBuilder() { + if (argsBuilder_ != null) { + return argsBuilder_.getMessageOrBuilder(); + } else { + return args_ == null ? com.google.protobuf.Struct.getDefaultInstance() : args_; + } + } + /** + * + * + *
+     * Optional. Required. The function parameters and values in JSON object
+     * format. See [FunctionDeclaration.parameters] for parameter details.
+     * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getArgsFieldBuilder() { + if (argsBuilder_ == null) { + argsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>(getArgs(), getParentForChildren(), isClean()); + args_ = null; + } + return argsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.FunctionCall) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.FunctionCall) + private static final com.google.cloud.vertexai.api.FunctionCall DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.FunctionCall(); + } + + public static com.google.cloud.vertexai.api.FunctionCall getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FunctionCall parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionCall getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionCallOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionCallOrBuilder.java new file mode 100644 index 000000000000..546f9b55deae --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionCallOrBuilder.java @@ -0,0 +1,90 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/tool.proto + +package com.google.cloud.vertexai.api; + +public interface FunctionCallOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.FunctionCall) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the function to call.
+   * Matches [FunctionDeclaration.name].
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the function to call.
+   * Matches [FunctionDeclaration.name].
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Required. The function parameters and values in JSON object
+   * format. See [FunctionDeclaration.parameters] for parameter details.
+   * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the args field is set. + */ + boolean hasArgs(); + /** + * + * + *
+   * Optional. Required. The function parameters and values in JSON object
+   * format. See [FunctionDeclaration.parameters] for parameter details.
+   * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The args. + */ + com.google.protobuf.Struct getArgs(); + /** + * + * + *
+   * Optional. Required. The function parameters and values in JSON object
+   * format. See [FunctionDeclaration.parameters] for parameter details.
+   * 
+ * + * .google.protobuf.Struct args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.protobuf.StructOrBuilder getArgsOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionDeclaration.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionDeclaration.java new file mode 100644 index 000000000000..9f3092f534ed --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionDeclaration.java @@ -0,0 +1,1262 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/tool.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Structured representation of a function declaration as defined by the
+ * [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included
+ * in this declaration are the function name and parameters. This
+ * FunctionDeclaration is a representation of a block of code that can be used
+ * as a `Tool` by the model and executed by the client.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FunctionDeclaration} + */ +public final class FunctionDeclaration extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.FunctionDeclaration) + FunctionDeclarationOrBuilder { + private static final long serialVersionUID = 0L; + // Use FunctionDeclaration.newBuilder() to construct. + private FunctionDeclaration(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FunctionDeclaration() { + name_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FunctionDeclaration(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionDeclaration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionDeclaration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FunctionDeclaration.class, + com.google.cloud.vertexai.api.FunctionDeclaration.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the function to call.
+   * Must start with a letter or an underscore.
+   * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
+   * length of 64.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the function to call.
+   * Must start with a letter or an underscore.
+   * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
+   * length of 64.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. Description and purpose of the function.
+   * Model uses it to decide how and whether to call the function.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Description and purpose of the function.
+   * Model uses it to decide how and whether to call the function.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARAMETERS_FIELD_NUMBER = 3; + private com.google.cloud.vertexai.api.Schema parameters_; + /** + * + * + *
+   * Optional. Describes the parameters to this function in JSON Schema Object
+   * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+   * of the parameter. Parameter names are case sensitive. Schema Value: the
+   * Schema defining the type used for the parameter. For function with no
+   * parameters, this can be left unset. Example with 1 required and 1 optional
+   * parameter: type: OBJECT properties:
+   *  param1:
+   *    type: STRING
+   *  param2:
+   *    type: INTEGER
+   * required:
+   *  - param1
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * Optional. Describes the parameters to this function in JSON Schema Object
+   * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+   * of the parameter. Parameter names are case sensitive. Schema Value: the
+   * Schema defining the type used for the parameter. For function with no
+   * parameters, this can be left unset. Example with 1 required and 1 optional
+   * parameter: type: OBJECT properties:
+   *  param1:
+   *    type: STRING
+   *  param2:
+   *    type: INTEGER
+   * required:
+   *  - param1
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parameters. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Schema getParameters() { + return parameters_ == null + ? com.google.cloud.vertexai.api.Schema.getDefaultInstance() + : parameters_; + } + /** + * + * + *
+   * Optional. Describes the parameters to this function in JSON Schema Object
+   * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+   * of the parameter. Parameter names are case sensitive. Schema Value: the
+   * Schema defining the type used for the parameter. For function with no
+   * parameters, this can be left unset. Example with 1 required and 1 optional
+   * parameter: type: OBJECT properties:
+   *  param1:
+   *    type: STRING
+   *  param2:
+   *    type: INTEGER
+   * required:
+   *  - param1
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SchemaOrBuilder getParametersOrBuilder() { + return parameters_ == null + ? com.google.cloud.vertexai.api.Schema.getDefaultInstance() + : parameters_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (parameters_ != null) { + output.writeMessage(3, getParameters()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getParameters()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.FunctionDeclaration)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.FunctionDeclaration other = + (com.google.cloud.vertexai.api.FunctionDeclaration) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.FunctionDeclaration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Structured representation of a function declaration as defined by the
+   * [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included
+   * in this declaration are the function name and parameters. This
+   * FunctionDeclaration is a representation of a block of code that can be used
+   * as a `Tool` by the model and executed by the client.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FunctionDeclaration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.FunctionDeclaration) + com.google.cloud.vertexai.api.FunctionDeclarationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionDeclaration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionDeclaration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FunctionDeclaration.class, + com.google.cloud.vertexai.api.FunctionDeclaration.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.FunctionDeclaration.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionDeclaration_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionDeclaration getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.FunctionDeclaration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionDeclaration build() { + com.google.cloud.vertexai.api.FunctionDeclaration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionDeclaration buildPartial() { + com.google.cloud.vertexai.api.FunctionDeclaration result = + new com.google.cloud.vertexai.api.FunctionDeclaration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.FunctionDeclaration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.parameters_ = parametersBuilder_ == null ? parameters_ : parametersBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.FunctionDeclaration) { + return mergeFrom((com.google.cloud.vertexai.api.FunctionDeclaration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.FunctionDeclaration other) { + if (other == com.google.cloud.vertexai.api.FunctionDeclaration.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the function to call.
+     * Must start with a letter or an underscore.
+     * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
+     * length of 64.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Must start with a letter or an underscore.
+     * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
+     * length of 64.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Must start with a letter or an underscore.
+     * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
+     * length of 64.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Must start with a letter or an underscore.
+     * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
+     * length of 64.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Must start with a letter or an underscore.
+     * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
+     * length of 64.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. Description and purpose of the function.
+     * Model uses it to decide how and whether to call the function.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Description and purpose of the function.
+     * Model uses it to decide how and whether to call the function.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Description and purpose of the function.
+     * Model uses it to decide how and whether to call the function.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description and purpose of the function.
+     * Model uses it to decide how and whether to call the function.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description and purpose of the function.
+     * Model uses it to decide how and whether to call the function.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.Schema parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Schema, + com.google.cloud.vertexai.api.Schema.Builder, + com.google.cloud.vertexai.api.SchemaOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * Optional. Describes the parameters to this function in JSON Schema Object
+     * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+     * of the parameter. Parameter names are case sensitive. Schema Value: the
+     * Schema defining the type used for the parameter. For function with no
+     * parameters, this can be left unset. Example with 1 required and 1 optional
+     * parameter: type: OBJECT properties:
+     *  param1:
+     *    type: STRING
+     *  param2:
+     *    type: INTEGER
+     * required:
+     *  - param1
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Optional. Describes the parameters to this function in JSON Schema Object
+     * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+     * of the parameter. Parameter names are case sensitive. Schema Value: the
+     * Schema defining the type used for the parameter. For function with no
+     * parameters, this can be left unset. Example with 1 required and 1 optional
+     * parameter: type: OBJECT properties:
+     *  param1:
+     *    type: STRING
+     *  param2:
+     *    type: INTEGER
+     * required:
+     *  - param1
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parameters. + */ + public com.google.cloud.vertexai.api.Schema getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null + ? com.google.cloud.vertexai.api.Schema.getDefaultInstance() + : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Describes the parameters to this function in JSON Schema Object
+     * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+     * of the parameter. Parameter names are case sensitive. Schema Value: the
+     * Schema defining the type used for the parameter. For function with no
+     * parameters, this can be left unset. Example with 1 required and 1 optional
+     * parameter: type: OBJECT properties:
+     *  param1:
+     *    type: STRING
+     *  param2:
+     *    type: INTEGER
+     * required:
+     *  - param1
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setParameters(com.google.cloud.vertexai.api.Schema value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + } else { + parametersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Describes the parameters to this function in JSON Schema Object
+     * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+     * of the parameter. Parameter names are case sensitive. Schema Value: the
+     * Schema defining the type used for the parameter. For function with no
+     * parameters, this can be left unset. Example with 1 required and 1 optional
+     * parameter: type: OBJECT properties:
+     *  param1:
+     *    type: STRING
+     *  param2:
+     *    type: INTEGER
+     * required:
+     *  - param1
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setParameters(com.google.cloud.vertexai.api.Schema.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Describes the parameters to this function in JSON Schema Object
+     * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+     * of the parameter. Parameter names are case sensitive. Schema Value: the
+     * Schema defining the type used for the parameter. For function with no
+     * parameters, this can be left unset. Example with 1 required and 1 optional
+     * parameter: type: OBJECT properties:
+     *  param1:
+     *    type: STRING
+     *  param2:
+     *    type: INTEGER
+     * required:
+     *  - param1
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeParameters(com.google.cloud.vertexai.api.Schema value) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && parameters_ != null + && parameters_ != com.google.cloud.vertexai.api.Schema.getDefaultInstance()) { + getParametersBuilder().mergeFrom(value); + } else { + parameters_ = value; + } + } else { + parametersBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Describes the parameters to this function in JSON Schema Object
+     * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+     * of the parameter. Parameter names are case sensitive. Schema Value: the
+     * Schema defining the type used for the parameter. For function with no
+     * parameters, this can be left unset. Example with 1 required and 1 optional
+     * parameter: type: OBJECT properties:
+     *  param1:
+     *    type: STRING
+     *  param2:
+     *    type: INTEGER
+     * required:
+     *  - param1
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearParameters() { + bitField0_ = (bitField0_ & ~0x00000004); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Describes the parameters to this function in JSON Schema Object
+     * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+     * of the parameter. Parameter names are case sensitive. Schema Value: the
+     * Schema defining the type used for the parameter. For function with no
+     * parameters, this can be left unset. Example with 1 required and 1 optional
+     * parameter: type: OBJECT properties:
+     *  param1:
+     *    type: STRING
+     *  param2:
+     *    type: INTEGER
+     * required:
+     *  - param1
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Schema.Builder getParametersBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Describes the parameters to this function in JSON Schema Object
+     * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+     * of the parameter. Parameter names are case sensitive. Schema Value: the
+     * Schema defining the type used for the parameter. For function with no
+     * parameters, this can be left unset. Example with 1 required and 1 optional
+     * parameter: type: OBJECT properties:
+     *  param1:
+     *    type: STRING
+     *  param2:
+     *    type: INTEGER
+     * required:
+     *  - param1
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.SchemaOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null + ? com.google.cloud.vertexai.api.Schema.getDefaultInstance() + : parameters_; + } + } + /** + * + * + *
+     * Optional. Describes the parameters to this function in JSON Schema Object
+     * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+     * of the parameter. Parameter names are case sensitive. Schema Value: the
+     * Schema defining the type used for the parameter. For function with no
+     * parameters, this can be left unset. Example with 1 required and 1 optional
+     * parameter: type: OBJECT properties:
+     *  param1:
+     *    type: STRING
+     *  param2:
+     *    type: INTEGER
+     * required:
+     *  - param1
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Schema, + com.google.cloud.vertexai.api.Schema.Builder, + com.google.cloud.vertexai.api.SchemaOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Schema, + com.google.cloud.vertexai.api.Schema.Builder, + com.google.cloud.vertexai.api.SchemaOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.FunctionDeclaration) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.FunctionDeclaration) + private static final com.google.cloud.vertexai.api.FunctionDeclaration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.FunctionDeclaration(); + } + + public static com.google.cloud.vertexai.api.FunctionDeclaration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FunctionDeclaration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionDeclaration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionDeclarationOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionDeclarationOrBuilder.java new file mode 100644 index 000000000000..1c36c0368603 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionDeclarationOrBuilder.java @@ -0,0 +1,157 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/tool.proto + +package com.google.cloud.vertexai.api; + +public interface FunctionDeclarationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.FunctionDeclaration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the function to call.
+   * Must start with a letter or an underscore.
+   * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
+   * length of 64.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the function to call.
+   * Must start with a letter or an underscore.
+   * Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
+   * length of 64.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Description and purpose of the function.
+   * Model uses it to decide how and whether to call the function.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Description and purpose of the function.
+   * Model uses it to decide how and whether to call the function.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. Describes the parameters to this function in JSON Schema Object
+   * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+   * of the parameter. Parameter names are case sensitive. Schema Value: the
+   * Schema defining the type used for the parameter. For function with no
+   * parameters, this can be left unset. Example with 1 required and 1 optional
+   * parameter: type: OBJECT properties:
+   *  param1:
+   *    type: STRING
+   *  param2:
+   *    type: INTEGER
+   * required:
+   *  - param1
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * Optional. Describes the parameters to this function in JSON Schema Object
+   * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+   * of the parameter. Parameter names are case sensitive. Schema Value: the
+   * Schema defining the type used for the parameter. For function with no
+   * parameters, this can be left unset. Example with 1 required and 1 optional
+   * parameter: type: OBJECT properties:
+   *  param1:
+   *    type: STRING
+   *  param2:
+   *    type: INTEGER
+   * required:
+   *  - param1
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The parameters. + */ + com.google.cloud.vertexai.api.Schema getParameters(); + /** + * + * + *
+   * Optional. Describes the parameters to this function in JSON Schema Object
+   * format. Reflects the Open API 3.03 Parameter Object. string Key: the name
+   * of the parameter. Parameter names are case sensitive. Schema Value: the
+   * Schema defining the type used for the parameter. For function with no
+   * parameters, this can be left unset. Example with 1 required and 1 optional
+   * parameter: type: OBJECT properties:
+   *  param1:
+   *    type: STRING
+   *  param2:
+   *    type: INTEGER
+   * required:
+   *  - param1
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.SchemaOrBuilder getParametersOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionResponse.java new file mode 100644 index 000000000000..d904a59d3730 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionResponse.java @@ -0,0 +1,892 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/tool.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The result output from a [FunctionCall] that contains a string representing
+ * the [FunctionDeclaration.name] and a structured JSON object containing any
+ * output from the function is used as context to the model. This should contain
+ * the result of a [FunctionCall] made based on model prediction.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FunctionResponse} + */ +public final class FunctionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.FunctionResponse) + FunctionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use FunctionResponse.newBuilder() to construct. + private FunctionResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FunctionResponse() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FunctionResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FunctionResponse.class, + com.google.cloud.vertexai.api.FunctionResponse.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the function to call.
+   * Matches [FunctionDeclaration.name] and [FunctionCall.name].
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the function to call.
+   * Matches [FunctionDeclaration.name] and [FunctionCall.name].
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESPONSE_FIELD_NUMBER = 2; + private com.google.protobuf.Struct response_; + /** + * + * + *
+   * Required. The function response in JSON object format.
+   * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the response field is set. + */ + @java.lang.Override + public boolean hasResponse() { + return response_ != null; + } + /** + * + * + *
+   * Required. The function response in JSON object format.
+   * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The response. + */ + @java.lang.Override + public com.google.protobuf.Struct getResponse() { + return response_ == null ? com.google.protobuf.Struct.getDefaultInstance() : response_; + } + /** + * + * + *
+   * Required. The function response in JSON object format.
+   * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getResponseOrBuilder() { + return response_ == null ? com.google.protobuf.Struct.getDefaultInstance() : response_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (response_ != null) { + output.writeMessage(2, getResponse()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (response_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getResponse()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.FunctionResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.FunctionResponse other = + (com.google.cloud.vertexai.api.FunctionResponse) obj; + + if (!getName().equals(other.getName())) return false; + if (hasResponse() != other.hasResponse()) return false; + if (hasResponse()) { + if (!getResponse().equals(other.getResponse())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasResponse()) { + hash = (37 * hash) + RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getResponse().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.FunctionResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.FunctionResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The result output from a [FunctionCall] that contains a string representing
+   * the [FunctionDeclaration.name] and a structured JSON object containing any
+   * output from the function is used as context to the model. This should contain
+   * the result of a [FunctionCall] made based on model prediction.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.FunctionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.FunctionResponse) + com.google.cloud.vertexai.api.FunctionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.FunctionResponse.class, + com.google.cloud.vertexai.api.FunctionResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.FunctionResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + response_ = null; + if (responseBuilder_ != null) { + responseBuilder_.dispose(); + responseBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_FunctionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.FunctionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionResponse build() { + com.google.cloud.vertexai.api.FunctionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionResponse buildPartial() { + com.google.cloud.vertexai.api.FunctionResponse result = + new com.google.cloud.vertexai.api.FunctionResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.FunctionResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.response_ = responseBuilder_ == null ? response_ : responseBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.FunctionResponse) { + return mergeFrom((com.google.cloud.vertexai.api.FunctionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.FunctionResponse other) { + if (other == com.google.cloud.vertexai.api.FunctionResponse.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasResponse()) { + mergeResponse(other.getResponse()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getResponseFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the function to call.
+     * Matches [FunctionDeclaration.name] and [FunctionCall.name].
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Matches [FunctionDeclaration.name] and [FunctionCall.name].
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Matches [FunctionDeclaration.name] and [FunctionCall.name].
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Matches [FunctionDeclaration.name] and [FunctionCall.name].
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function to call.
+     * Matches [FunctionDeclaration.name] and [FunctionCall.name].
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Struct response_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + responseBuilder_; + /** + * + * + *
+     * Required. The function response in JSON object format.
+     * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the response field is set. + */ + public boolean hasResponse() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The function response in JSON object format.
+     * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The response. + */ + public com.google.protobuf.Struct getResponse() { + if (responseBuilder_ == null) { + return response_ == null ? com.google.protobuf.Struct.getDefaultInstance() : response_; + } else { + return responseBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The function response in JSON object format.
+     * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setResponse(com.google.protobuf.Struct value) { + if (responseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + } else { + responseBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The function response in JSON object format.
+     * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setResponse(com.google.protobuf.Struct.Builder builderForValue) { + if (responseBuilder_ == null) { + response_ = builderForValue.build(); + } else { + responseBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The function response in JSON object format.
+     * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeResponse(com.google.protobuf.Struct value) { + if (responseBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && response_ != null + && response_ != com.google.protobuf.Struct.getDefaultInstance()) { + getResponseBuilder().mergeFrom(value); + } else { + response_ = value; + } + } else { + responseBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The function response in JSON object format.
+     * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearResponse() { + bitField0_ = (bitField0_ & ~0x00000002); + response_ = null; + if (responseBuilder_ != null) { + responseBuilder_.dispose(); + responseBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The function response in JSON object format.
+     * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.protobuf.Struct.Builder getResponseBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getResponseFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The function response in JSON object format.
+     * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.protobuf.StructOrBuilder getResponseOrBuilder() { + if (responseBuilder_ != null) { + return responseBuilder_.getMessageOrBuilder(); + } else { + return response_ == null ? com.google.protobuf.Struct.getDefaultInstance() : response_; + } + } + /** + * + * + *
+     * Required. The function response in JSON object format.
+     * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getResponseFieldBuilder() { + if (responseBuilder_ == null) { + responseBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getResponse(), getParentForChildren(), isClean()); + response_ = null; + } + return responseBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.FunctionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.FunctionResponse) + private static final com.google.cloud.vertexai.api.FunctionResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.FunctionResponse(); + } + + public static com.google.cloud.vertexai.api.FunctionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FunctionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionResponseOrBuilder.java new file mode 100644 index 000000000000..f9acc4049aeb --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/FunctionResponseOrBuilder.java @@ -0,0 +1,87 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/tool.proto + +package com.google.cloud.vertexai.api; + +public interface FunctionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.FunctionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the function to call.
+   * Matches [FunctionDeclaration.name] and [FunctionCall.name].
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the function to call.
+   * Matches [FunctionDeclaration.name] and [FunctionCall.name].
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The function response in JSON object format.
+   * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the response field is set. + */ + boolean hasResponse(); + /** + * + * + *
+   * Required. The function response in JSON object format.
+   * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The response. + */ + com.google.protobuf.Struct getResponse(); + /** + * + * + *
+   * Required. The function response in JSON object format.
+   * 
+ * + * .google.protobuf.Struct response = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.protobuf.StructOrBuilder getResponseOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsDestination.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsDestination.java new file mode 100644 index 000000000000..466c153cb210 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsDestination.java @@ -0,0 +1,644 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The Google Cloud Storage location where the output is to be written to.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GcsDestination} + */ +public final class GcsDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.GcsDestination) + GcsDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsDestination.newBuilder() to construct. + private GcsDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsDestination() { + outputUriPrefix_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GcsDestination.class, + com.google.cloud.vertexai.api.GcsDestination.Builder.class); + } + + public static final int OUTPUT_URI_PREFIX_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object outputUriPrefix_ = ""; + /** + * + * + *
+   * Required. Google Cloud Storage URI to output directory. If the uri doesn't
+   * end with
+   * '/', a '/' will be automatically appended. The directory is created if it
+   * doesn't exist.
+   * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUriPrefix. + */ + @java.lang.Override + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUriPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Google Cloud Storage URI to output directory. If the uri doesn't
+   * end with
+   * '/', a '/' will be automatically appended. The directory is created if it
+   * doesn't exist.
+   * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUriPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUriPrefix_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputUriPrefix_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUriPrefix_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputUriPrefix_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GcsDestination)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GcsDestination other = + (com.google.cloud.vertexai.api.GcsDestination) obj; + + if (!getOutputUriPrefix().equals(other.getOutputUriPrefix())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OUTPUT_URI_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getOutputUriPrefix().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GcsDestination parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GcsDestination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.GcsDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GcsDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.GcsDestination) + com.google.cloud.vertexai.api.GcsDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GcsDestination.class, + com.google.cloud.vertexai.api.GcsDestination.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GcsDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + outputUriPrefix_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_GcsDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GcsDestination getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GcsDestination build() { + com.google.cloud.vertexai.api.GcsDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GcsDestination buildPartial() { + com.google.cloud.vertexai.api.GcsDestination result = + new com.google.cloud.vertexai.api.GcsDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.GcsDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.outputUriPrefix_ = outputUriPrefix_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GcsDestination) { + return mergeFrom((com.google.cloud.vertexai.api.GcsDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GcsDestination other) { + if (other == com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance()) return this; + if (!other.getOutputUriPrefix().isEmpty()) { + outputUriPrefix_ = other.outputUriPrefix_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + outputUriPrefix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object outputUriPrefix_ = ""; + /** + * + * + *
+     * Required. Google Cloud Storage URI to output directory. If the uri doesn't
+     * end with
+     * '/', a '/' will be automatically appended. The directory is created if it
+     * doesn't exist.
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUriPrefix. + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUriPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage URI to output directory. If the uri doesn't
+     * end with
+     * '/', a '/' will be automatically appended. The directory is created if it
+     * doesn't exist.
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUriPrefix. + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage URI to output directory. If the uri doesn't
+     * end with
+     * '/', a '/' will be automatically appended. The directory is created if it
+     * doesn't exist.
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The outputUriPrefix to set. + * @return This builder for chaining. + */ + public Builder setOutputUriPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputUriPrefix_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI to output directory. If the uri doesn't
+     * end with
+     * '/', a '/' will be automatically appended. The directory is created if it
+     * doesn't exist.
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearOutputUriPrefix() { + outputUriPrefix_ = getDefaultInstance().getOutputUriPrefix(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI to output directory. If the uri doesn't
+     * end with
+     * '/', a '/' will be automatically appended. The directory is created if it
+     * doesn't exist.
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for outputUriPrefix to set. + * @return This builder for chaining. + */ + public Builder setOutputUriPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputUriPrefix_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.GcsDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.GcsDestination) + private static final com.google.cloud.vertexai.api.GcsDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GcsDestination(); + } + + public static com.google.cloud.vertexai.api.GcsDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GcsDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsDestinationOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsDestinationOrBuilder.java new file mode 100644 index 000000000000..4c906ec232cf --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsDestinationOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +public interface GcsDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.GcsDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Google Cloud Storage URI to output directory. If the uri doesn't
+   * end with
+   * '/', a '/' will be automatically appended. The directory is created if it
+   * doesn't exist.
+   * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUriPrefix. + */ + java.lang.String getOutputUriPrefix(); + /** + * + * + *
+   * Required. Google Cloud Storage URI to output directory. If the uri doesn't
+   * end with
+   * '/', a '/' will be automatically appended. The directory is created if it
+   * doesn't exist.
+   * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUriPrefix. + */ + com.google.protobuf.ByteString getOutputUriPrefixBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsSource.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsSource.java new file mode 100644 index 000000000000..cc2976cccc67 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsSource.java @@ -0,0 +1,743 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The Google Cloud Storage location for the input content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GcsSource} + */ +public final class GcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.GcsSource) + GcsSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsSource.newBuilder() to construct. + private GcsSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsSource() { + uris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GcsSource.class, + com.google.cloud.vertexai.api.GcsSource.Builder.class); + } + + public static final int URIS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList uris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+   * wildcards. For more information on wildcards, see
+   * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+   * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the uris. + */ + public com.google.protobuf.ProtocolStringList getUrisList() { + return uris_; + } + /** + * + * + *
+   * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+   * wildcards. For more information on wildcards, see
+   * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+   * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of uris. + */ + public int getUrisCount() { + return uris_.size(); + } + /** + * + * + *
+   * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+   * wildcards. For more information on wildcards, see
+   * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+   * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + public java.lang.String getUris(int index) { + return uris_.get(index); + } + /** + * + * + *
+   * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+   * wildcards. For more information on wildcards, see
+   * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+   * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + public com.google.protobuf.ByteString getUrisBytes(int index) { + return uris_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < uris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uris_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < uris_.size(); i++) { + dataSize += computeStringSizeNoTag(uris_.getRaw(i)); + } + size += dataSize; + size += 1 * getUrisList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GcsSource)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GcsSource other = (com.google.cloud.vertexai.api.GcsSource) obj; + + if (!getUrisList().equals(other.getUrisList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUrisCount() > 0) { + hash = (37 * hash) + URIS_FIELD_NUMBER; + hash = (53 * hash) + getUrisList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GcsSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GcsSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GcsSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GcsSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GcsSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GcsSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GcsSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.GcsSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The Google Cloud Storage location for the input content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.GcsSource) + com.google.cloud.vertexai.api.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GcsSource.class, + com.google.cloud.vertexai.api.GcsSource.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GcsSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_GcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSource getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSource build() { + com.google.cloud.vertexai.api.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSource buildPartial() { + com.google.cloud.vertexai.api.GcsSource result = + new com.google.cloud.vertexai.api.GcsSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.GcsSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + uris_.makeImmutable(); + result.uris_ = uris_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GcsSource) { + return mergeFrom((com.google.cloud.vertexai.api.GcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GcsSource other) { + if (other == com.google.cloud.vertexai.api.GcsSource.getDefaultInstance()) return this; + if (!other.uris_.isEmpty()) { + if (uris_.isEmpty()) { + uris_ = other.uris_; + bitField0_ |= 0x00000001; + } else { + ensureUrisIsMutable(); + uris_.addAll(other.uris_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUrisIsMutable(); + uris_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList uris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUrisIsMutable() { + if (!uris_.isModifiable()) { + uris_ = new com.google.protobuf.LazyStringArrayList(uris_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+     * wildcards. For more information on wildcards, see
+     * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+     * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the uris. + */ + public com.google.protobuf.ProtocolStringList getUrisList() { + uris_.makeImmutable(); + return uris_; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+     * wildcards. For more information on wildcards, see
+     * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+     * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of uris. + */ + public int getUrisCount() { + return uris_.size(); + } + /** + * + * + *
+     * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+     * wildcards. For more information on wildcards, see
+     * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+     * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + public java.lang.String getUris(int index) { + return uris_.get(index); + } + /** + * + * + *
+     * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+     * wildcards. For more information on wildcards, see
+     * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+     * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + public com.google.protobuf.ByteString getUrisBytes(int index) { + return uris_.getByteString(index); + } + /** + * + * + *
+     * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+     * wildcards. For more information on wildcards, see
+     * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+     * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The uris to set. + * @return This builder for chaining. + */ + public Builder setUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrisIsMutable(); + uris_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+     * wildcards. For more information on wildcards, see
+     * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+     * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uris to add. + * @return This builder for chaining. + */ + public Builder addUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrisIsMutable(); + uris_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+     * wildcards. For more information on wildcards, see
+     * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+     * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The uris to add. + * @return This builder for chaining. + */ + public Builder addAllUris(java.lang.Iterable values) { + ensureUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, uris_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+     * wildcards. For more information on wildcards, see
+     * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+     * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUris() { + uris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+     * wildcards. For more information on wildcards, see
+     * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+     * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the uris to add. + * @return This builder for chaining. + */ + public Builder addUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUrisIsMutable(); + uris_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.GcsSource) + private static final com.google.cloud.vertexai.api.GcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GcsSource(); + } + + public static com.google.cloud.vertexai.api.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsSourceOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsSourceOrBuilder.java new file mode 100644 index 000000000000..77da4aa5a4eb --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GcsSourceOrBuilder.java @@ -0,0 +1,84 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +public interface GcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+   * wildcards. For more information on wildcards, see
+   * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+   * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the uris. + */ + java.util.List getUrisList(); + /** + * + * + *
+   * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+   * wildcards. For more information on wildcards, see
+   * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+   * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of uris. + */ + int getUrisCount(); + /** + * + * + *
+   * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+   * wildcards. For more information on wildcards, see
+   * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+   * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + java.lang.String getUris(int index); + /** + * + * + *
+   * Required. Google Cloud Storage URI(-s) to the input file(s). May contain
+   * wildcards. For more information on wildcards, see
+   * https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames.
+   * 
+ * + * repeated string uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + com.google.protobuf.ByteString getUrisBytes(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequest.java new file mode 100644 index 000000000000..7a0e68712d15 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequest.java @@ -0,0 +1,3003 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for [PredictionService.GenerateContent].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenerateContentRequest} + */ +public final class GenerateContentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.GenerateContentRequest) + GenerateContentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateContentRequest.newBuilder() to construct. + private GenerateContentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateContentRequest() { + endpoint_ = ""; + model_ = ""; + contents_ = java.util.Collections.emptyList(); + tools_ = java.util.Collections.emptyList(); + safetySettings_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateContentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerateContentRequest.class, + com.google.cloud.vertexai.api.GenerateContentRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object model_ = ""; + /** + * + * + *
+   * Required. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * `projects/{project}/locations/{location}/publishers/*/models/*`
+   * 
+ * + * string model = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * `projects/{project}/locations/{location}/publishers/*/models/*`
+   * 
+ * + * string model = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List contents_; + /** + * + * + *
+   * Required. The content of the current conversation with the model.
+   *
+   * For single-turn queries, this is a single instance. For multi-turn queries,
+   * this is a repeated field that contains conversation history + latest
+   * request.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getContentsList() { + return contents_; + } + /** + * + * + *
+   * Required. The content of the current conversation with the model.
+   *
+   * For single-turn queries, this is a single instance. For multi-turn queries,
+   * this is a repeated field that contains conversation history + latest
+   * request.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getContentsOrBuilderList() { + return contents_; + } + /** + * + * + *
+   * Required. The content of the current conversation with the model.
+   *
+   * For single-turn queries, this is a single instance. For multi-turn queries,
+   * this is a repeated field that contains conversation history + latest
+   * request.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getContentsCount() { + return contents_.size(); + } + /** + * + * + *
+   * Required. The content of the current conversation with the model.
+   *
+   * For single-turn queries, this is a single instance. For multi-turn queries,
+   * this is a repeated field that contains conversation history + latest
+   * request.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Content getContents(int index) { + return contents_.get(index); + } + /** + * + * + *
+   * Required. The content of the current conversation with the model.
+   *
+   * For single-turn queries, this is a single instance. For multi-turn queries,
+   * this is a repeated field that contains conversation history + latest
+   * request.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index) { + return contents_.get(index); + } + + public static final int TOOLS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List tools_; + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model. The only supported tool is currently
+   * `Function`
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getToolsList() { + return tools_; + } + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model. The only supported tool is currently
+   * `Function`
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getToolsOrBuilderList() { + return tools_; + } + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model. The only supported tool is currently
+   * `Function`
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getToolsCount() { + return tools_.size(); + } + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model. The only supported tool is currently
+   * `Function`
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tool getTools(int index) { + return tools_.get(index); + } + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model. The only supported tool is currently
+   * `Function`
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ToolOrBuilder getToolsOrBuilder(int index) { + return tools_.get(index); + } + + public static final int SAFETY_SETTINGS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List safetySettings_; + /** + * + * + *
+   * Optional. Per request settings for blocking unsafe content.
+   * Enforced on GenerateContentResponse.candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getSafetySettingsList() { + return safetySettings_; + } + /** + * + * + *
+   * Optional. Per request settings for blocking unsafe content.
+   * Enforced on GenerateContentResponse.candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSafetySettingsOrBuilderList() { + return safetySettings_; + } + /** + * + * + *
+   * Optional. Per request settings for blocking unsafe content.
+   * Enforced on GenerateContentResponse.candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getSafetySettingsCount() { + return safetySettings_.size(); + } + /** + * + * + *
+   * Optional. Per request settings for blocking unsafe content.
+   * Enforced on GenerateContentResponse.candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SafetySetting getSafetySettings(int index) { + return safetySettings_.get(index); + } + /** + * + * + *
+   * Optional. Per request settings for blocking unsafe content.
+   * Enforced on GenerateContentResponse.candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SafetySettingOrBuilder getSafetySettingsOrBuilder( + int index) { + return safetySettings_.get(index); + } + + public static final int GENERATION_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.vertexai.api.GenerationConfig generationConfig_; + /** + * + * + *
+   * Optional. Generation config.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the generationConfig field is set. + */ + @java.lang.Override + public boolean hasGenerationConfig() { + return generationConfig_ != null; + } + /** + * + * + *
+   * Optional. Generation config.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The generationConfig. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig getGenerationConfig() { + return generationConfig_ == null + ? com.google.cloud.vertexai.api.GenerationConfig.getDefaultInstance() + : generationConfig_; + } + /** + * + * + *
+   * Optional. Generation config.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfigOrBuilder getGenerationConfigOrBuilder() { + return generationConfig_ == null + ? com.google.cloud.vertexai.api.GenerationConfig.getDefaultInstance() + : generationConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + for (int i = 0; i < contents_.size(); i++) { + output.writeMessage(2, contents_.get(i)); + } + for (int i = 0; i < safetySettings_.size(); i++) { + output.writeMessage(3, safetySettings_.get(i)); + } + if (generationConfig_ != null) { + output.writeMessage(4, getGenerationConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, model_); + } + for (int i = 0; i < tools_.size(); i++) { + output.writeMessage(6, tools_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + for (int i = 0; i < contents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, contents_.get(i)); + } + for (int i = 0; i < safetySettings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, safetySettings_.get(i)); + } + if (generationConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getGenerationConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, model_); + } + for (int i = 0; i < tools_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, tools_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GenerateContentRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GenerateContentRequest other = + (com.google.cloud.vertexai.api.GenerateContentRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (!getModel().equals(other.getModel())) return false; + if (!getContentsList().equals(other.getContentsList())) return false; + if (!getToolsList().equals(other.getToolsList())) return false; + if (!getSafetySettingsList().equals(other.getSafetySettingsList())) return false; + if (hasGenerationConfig() != other.hasGenerationConfig()) return false; + if (hasGenerationConfig()) { + if (!getGenerationConfig().equals(other.getGenerationConfig())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + if (getContentsCount() > 0) { + hash = (37 * hash) + CONTENTS_FIELD_NUMBER; + hash = (53 * hash) + getContentsList().hashCode(); + } + if (getToolsCount() > 0) { + hash = (37 * hash) + TOOLS_FIELD_NUMBER; + hash = (53 * hash) + getToolsList().hashCode(); + } + if (getSafetySettingsCount() > 0) { + hash = (37 * hash) + SAFETY_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getSafetySettingsList().hashCode(); + } + if (hasGenerationConfig()) { + hash = (37 * hash) + GENERATION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getGenerationConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.GenerateContentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [PredictionService.GenerateContent].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenerateContentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.GenerateContentRequest) + com.google.cloud.vertexai.api.GenerateContentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerateContentRequest.class, + com.google.cloud.vertexai.api.GenerateContentRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GenerateContentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + model_ = ""; + if (contentsBuilder_ == null) { + contents_ = java.util.Collections.emptyList(); + } else { + contents_ = null; + contentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (toolsBuilder_ == null) { + tools_ = java.util.Collections.emptyList(); + } else { + tools_ = null; + toolsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + if (safetySettingsBuilder_ == null) { + safetySettings_ = java.util.Collections.emptyList(); + } else { + safetySettings_ = null; + safetySettingsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + generationConfig_ = null; + if (generationConfigBuilder_ != null) { + generationConfigBuilder_.dispose(); + generationConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GenerateContentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentRequest build() { + com.google.cloud.vertexai.api.GenerateContentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentRequest buildPartial() { + com.google.cloud.vertexai.api.GenerateContentRequest result = + new com.google.cloud.vertexai.api.GenerateContentRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.GenerateContentRequest result) { + if (contentsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + contents_ = java.util.Collections.unmodifiableList(contents_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.contents_ = contents_; + } else { + result.contents_ = contentsBuilder_.build(); + } + if (toolsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + tools_ = java.util.Collections.unmodifiableList(tools_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.tools_ = tools_; + } else { + result.tools_ = toolsBuilder_.build(); + } + if (safetySettingsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + safetySettings_ = java.util.Collections.unmodifiableList(safetySettings_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.safetySettings_ = safetySettings_; + } else { + result.safetySettings_ = safetySettingsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.GenerateContentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.model_ = model_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.generationConfig_ = + generationConfigBuilder_ == null ? generationConfig_ : generationConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GenerateContentRequest) { + return mergeFrom((com.google.cloud.vertexai.api.GenerateContentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GenerateContentRequest other) { + if (other == com.google.cloud.vertexai.api.GenerateContentRequest.getDefaultInstance()) + return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (contentsBuilder_ == null) { + if (!other.contents_.isEmpty()) { + if (contents_.isEmpty()) { + contents_ = other.contents_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureContentsIsMutable(); + contents_.addAll(other.contents_); + } + onChanged(); + } + } else { + if (!other.contents_.isEmpty()) { + if (contentsBuilder_.isEmpty()) { + contentsBuilder_.dispose(); + contentsBuilder_ = null; + contents_ = other.contents_; + bitField0_ = (bitField0_ & ~0x00000004); + contentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getContentsFieldBuilder() + : null; + } else { + contentsBuilder_.addAllMessages(other.contents_); + } + } + } + if (toolsBuilder_ == null) { + if (!other.tools_.isEmpty()) { + if (tools_.isEmpty()) { + tools_ = other.tools_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureToolsIsMutable(); + tools_.addAll(other.tools_); + } + onChanged(); + } + } else { + if (!other.tools_.isEmpty()) { + if (toolsBuilder_.isEmpty()) { + toolsBuilder_.dispose(); + toolsBuilder_ = null; + tools_ = other.tools_; + bitField0_ = (bitField0_ & ~0x00000008); + toolsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getToolsFieldBuilder() + : null; + } else { + toolsBuilder_.addAllMessages(other.tools_); + } + } + } + if (safetySettingsBuilder_ == null) { + if (!other.safetySettings_.isEmpty()) { + if (safetySettings_.isEmpty()) { + safetySettings_ = other.safetySettings_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureSafetySettingsIsMutable(); + safetySettings_.addAll(other.safetySettings_); + } + onChanged(); + } + } else { + if (!other.safetySettings_.isEmpty()) { + if (safetySettingsBuilder_.isEmpty()) { + safetySettingsBuilder_.dispose(); + safetySettingsBuilder_ = null; + safetySettings_ = other.safetySettings_; + bitField0_ = (bitField0_ & ~0x00000010); + safetySettingsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSafetySettingsFieldBuilder() + : null; + } else { + safetySettingsBuilder_.addAllMessages(other.safetySettings_); + } + } + } + if (other.hasGenerationConfig()) { + mergeGenerationConfig(other.getGenerationConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.vertexai.api.Content m = + input.readMessage( + com.google.cloud.vertexai.api.Content.parser(), extensionRegistry); + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(m); + } else { + contentsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.cloud.vertexai.api.SafetySetting m = + input.readMessage( + com.google.cloud.vertexai.api.SafetySetting.parser(), extensionRegistry); + if (safetySettingsBuilder_ == null) { + ensureSafetySettingsIsMutable(); + safetySettings_.add(m); + } else { + safetySettingsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + input.readMessage( + getGenerationConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 34 + case 42: + { + model_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 42 + case 50: + { + com.google.cloud.vertexai.api.Tool m = + input.readMessage( + com.google.cloud.vertexai.api.Tool.parser(), extensionRegistry); + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + tools_.add(m); + } else { + toolsBuilder_.addMessage(m); + } + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object model_ = ""; + /** + * + * + *
+     * Required. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * `projects/{project}/locations/{location}/publishers/*/models/*`
+     * 
+ * + * string model = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * `projects/{project}/locations/{location}/publishers/*/models/*`
+     * 
+ * + * string model = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for model. + */ + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * `projects/{project}/locations/{location}/publishers/*/models/*`
+     * 
+ * + * string model = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + model_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * `projects/{project}/locations/{location}/publishers/*/models/*`
+     * 
+ * + * string model = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearModel() { + model_ = getDefaultInstance().getModel(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * `projects/{project}/locations/{location}/publishers/*/models/*`
+     * 
+ * + * string model = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + model_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List contents_ = + java.util.Collections.emptyList(); + + private void ensureContentsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + contents_ = new java.util.ArrayList(contents_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder> + contentsBuilder_; + + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getContentsList() { + if (contentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(contents_); + } else { + return contentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getContentsCount() { + if (contentsBuilder_ == null) { + return contents_.size(); + } else { + return contentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Content getContents(int index) { + if (contentsBuilder_ == null) { + return contents_.get(index); + } else { + return contentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setContents(int index, com.google.cloud.vertexai.api.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.set(index, value); + onChanged(); + } else { + contentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setContents( + int index, com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.set(index, builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addContents(com.google.cloud.vertexai.api.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.add(value); + onChanged(); + } else { + contentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addContents(int index, com.google.cloud.vertexai.api.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.add(index, value); + onChanged(); + } else { + contentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addContents(com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addContents( + int index, com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(index, builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllContents( + java.lang.Iterable values) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contents_); + onChanged(); + } else { + contentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearContents() { + if (contentsBuilder_ == null) { + contents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + contentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeContents(int index) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.remove(index); + onChanged(); + } else { + contentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder getContentsBuilder(int index) { + return getContentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index) { + if (contentsBuilder_ == null) { + return contents_.get(index); + } else { + return contentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getContentsOrBuilderList() { + if (contentsBuilder_ != null) { + return contentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(contents_); + } + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder addContentsBuilder() { + return getContentsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Content.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder addContentsBuilder(int index) { + return getContentsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Content.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The content of the current conversation with the model.
+     *
+     * For single-turn queries, this is a single instance. For multi-turn queries,
+     * this is a repeated field that contains conversation history + latest
+     * request.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getContentsBuilderList() { + return getContentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder> + getContentsFieldBuilder() { + if (contentsBuilder_ == null) { + contentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder>( + contents_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + contents_ = null; + } + return contentsBuilder_; + } + + private java.util.List tools_ = + java.util.Collections.emptyList(); + + private void ensureToolsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + tools_ = new java.util.ArrayList(tools_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tool, + com.google.cloud.vertexai.api.Tool.Builder, + com.google.cloud.vertexai.api.ToolOrBuilder> + toolsBuilder_; + + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getToolsList() { + if (toolsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tools_); + } else { + return toolsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getToolsCount() { + if (toolsBuilder_ == null) { + return tools_.size(); + } else { + return toolsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Tool getTools(int index) { + if (toolsBuilder_ == null) { + return tools_.get(index); + } else { + return toolsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTools(int index, com.google.cloud.vertexai.api.Tool value) { + if (toolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureToolsIsMutable(); + tools_.set(index, value); + onChanged(); + } else { + toolsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTools(int index, com.google.cloud.vertexai.api.Tool.Builder builderForValue) { + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + tools_.set(index, builderForValue.build()); + onChanged(); + } else { + toolsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTools(com.google.cloud.vertexai.api.Tool value) { + if (toolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureToolsIsMutable(); + tools_.add(value); + onChanged(); + } else { + toolsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTools(int index, com.google.cloud.vertexai.api.Tool value) { + if (toolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureToolsIsMutable(); + tools_.add(index, value); + onChanged(); + } else { + toolsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTools(com.google.cloud.vertexai.api.Tool.Builder builderForValue) { + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + tools_.add(builderForValue.build()); + onChanged(); + } else { + toolsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTools(int index, com.google.cloud.vertexai.api.Tool.Builder builderForValue) { + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + tools_.add(index, builderForValue.build()); + onChanged(); + } else { + toolsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllTools( + java.lang.Iterable values) { + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tools_); + onChanged(); + } else { + toolsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTools() { + if (toolsBuilder_ == null) { + tools_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + toolsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeTools(int index) { + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + tools_.remove(index); + onChanged(); + } else { + toolsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Tool.Builder getToolsBuilder(int index) { + return getToolsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.ToolOrBuilder getToolsOrBuilder(int index) { + if (toolsBuilder_ == null) { + return tools_.get(index); + } else { + return toolsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getToolsOrBuilderList() { + if (toolsBuilder_ != null) { + return toolsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tools_); + } + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Tool.Builder addToolsBuilder() { + return getToolsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Tool.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Tool.Builder addToolsBuilder(int index) { + return getToolsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Tool.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model. The only supported tool is currently
+     * `Function`
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getToolsBuilderList() { + return getToolsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tool, + com.google.cloud.vertexai.api.Tool.Builder, + com.google.cloud.vertexai.api.ToolOrBuilder> + getToolsFieldBuilder() { + if (toolsBuilder_ == null) { + toolsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tool, + com.google.cloud.vertexai.api.Tool.Builder, + com.google.cloud.vertexai.api.ToolOrBuilder>( + tools_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + tools_ = null; + } + return toolsBuilder_; + } + + private java.util.List safetySettings_ = + java.util.Collections.emptyList(); + + private void ensureSafetySettingsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + safetySettings_ = + new java.util.ArrayList(safetySettings_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.SafetySetting, + com.google.cloud.vertexai.api.SafetySetting.Builder, + com.google.cloud.vertexai.api.SafetySettingOrBuilder> + safetySettingsBuilder_; + + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getSafetySettingsList() { + if (safetySettingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(safetySettings_); + } else { + return safetySettingsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getSafetySettingsCount() { + if (safetySettingsBuilder_ == null) { + return safetySettings_.size(); + } else { + return safetySettingsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.SafetySetting getSafetySettings(int index) { + if (safetySettingsBuilder_ == null) { + return safetySettings_.get(index); + } else { + return safetySettingsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSafetySettings(int index, com.google.cloud.vertexai.api.SafetySetting value) { + if (safetySettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSafetySettingsIsMutable(); + safetySettings_.set(index, value); + onChanged(); + } else { + safetySettingsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSafetySettings( + int index, com.google.cloud.vertexai.api.SafetySetting.Builder builderForValue) { + if (safetySettingsBuilder_ == null) { + ensureSafetySettingsIsMutable(); + safetySettings_.set(index, builderForValue.build()); + onChanged(); + } else { + safetySettingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSafetySettings(com.google.cloud.vertexai.api.SafetySetting value) { + if (safetySettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSafetySettingsIsMutable(); + safetySettings_.add(value); + onChanged(); + } else { + safetySettingsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSafetySettings(int index, com.google.cloud.vertexai.api.SafetySetting value) { + if (safetySettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSafetySettingsIsMutable(); + safetySettings_.add(index, value); + onChanged(); + } else { + safetySettingsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSafetySettings( + com.google.cloud.vertexai.api.SafetySetting.Builder builderForValue) { + if (safetySettingsBuilder_ == null) { + ensureSafetySettingsIsMutable(); + safetySettings_.add(builderForValue.build()); + onChanged(); + } else { + safetySettingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSafetySettings( + int index, com.google.cloud.vertexai.api.SafetySetting.Builder builderForValue) { + if (safetySettingsBuilder_ == null) { + ensureSafetySettingsIsMutable(); + safetySettings_.add(index, builderForValue.build()); + onChanged(); + } else { + safetySettingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllSafetySettings( + java.lang.Iterable values) { + if (safetySettingsBuilder_ == null) { + ensureSafetySettingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, safetySettings_); + onChanged(); + } else { + safetySettingsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSafetySettings() { + if (safetySettingsBuilder_ == null) { + safetySettings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + safetySettingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeSafetySettings(int index) { + if (safetySettingsBuilder_ == null) { + ensureSafetySettingsIsMutable(); + safetySettings_.remove(index); + onChanged(); + } else { + safetySettingsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.SafetySetting.Builder getSafetySettingsBuilder(int index) { + return getSafetySettingsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.SafetySettingOrBuilder getSafetySettingsOrBuilder( + int index) { + if (safetySettingsBuilder_ == null) { + return safetySettings_.get(index); + } else { + return safetySettingsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSafetySettingsOrBuilderList() { + if (safetySettingsBuilder_ != null) { + return safetySettingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(safetySettings_); + } + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.SafetySetting.Builder addSafetySettingsBuilder() { + return getSafetySettingsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.SafetySetting.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.SafetySetting.Builder addSafetySettingsBuilder(int index) { + return getSafetySettingsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.SafetySetting.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Per request settings for blocking unsafe content.
+     * Enforced on GenerateContentResponse.candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSafetySettingsBuilderList() { + return getSafetySettingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.SafetySetting, + com.google.cloud.vertexai.api.SafetySetting.Builder, + com.google.cloud.vertexai.api.SafetySettingOrBuilder> + getSafetySettingsFieldBuilder() { + if (safetySettingsBuilder_ == null) { + safetySettingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.SafetySetting, + com.google.cloud.vertexai.api.SafetySetting.Builder, + com.google.cloud.vertexai.api.SafetySettingOrBuilder>( + safetySettings_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + safetySettings_ = null; + } + return safetySettingsBuilder_; + } + + private com.google.cloud.vertexai.api.GenerationConfig generationConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig, + com.google.cloud.vertexai.api.GenerationConfig.Builder, + com.google.cloud.vertexai.api.GenerationConfigOrBuilder> + generationConfigBuilder_; + /** + * + * + *
+     * Optional. Generation config.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the generationConfig field is set. + */ + public boolean hasGenerationConfig() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. Generation config.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The generationConfig. + */ + public com.google.cloud.vertexai.api.GenerationConfig getGenerationConfig() { + if (generationConfigBuilder_ == null) { + return generationConfig_ == null + ? com.google.cloud.vertexai.api.GenerationConfig.getDefaultInstance() + : generationConfig_; + } else { + return generationConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Generation config.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGenerationConfig(com.google.cloud.vertexai.api.GenerationConfig value) { + if (generationConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + generationConfig_ = value; + } else { + generationConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Generation config.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGenerationConfig( + com.google.cloud.vertexai.api.GenerationConfig.Builder builderForValue) { + if (generationConfigBuilder_ == null) { + generationConfig_ = builderForValue.build(); + } else { + generationConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Generation config.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeGenerationConfig(com.google.cloud.vertexai.api.GenerationConfig value) { + if (generationConfigBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && generationConfig_ != null + && generationConfig_ + != com.google.cloud.vertexai.api.GenerationConfig.getDefaultInstance()) { + getGenerationConfigBuilder().mergeFrom(value); + } else { + generationConfig_ = value; + } + } else { + generationConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Generation config.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearGenerationConfig() { + bitField0_ = (bitField0_ & ~0x00000020); + generationConfig_ = null; + if (generationConfigBuilder_ != null) { + generationConfigBuilder_.dispose(); + generationConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Generation config.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.GenerationConfig.Builder getGenerationConfigBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getGenerationConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Generation config.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.GenerationConfigOrBuilder getGenerationConfigOrBuilder() { + if (generationConfigBuilder_ != null) { + return generationConfigBuilder_.getMessageOrBuilder(); + } else { + return generationConfig_ == null + ? com.google.cloud.vertexai.api.GenerationConfig.getDefaultInstance() + : generationConfig_; + } + } + /** + * + * + *
+     * Optional. Generation config.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig, + com.google.cloud.vertexai.api.GenerationConfig.Builder, + com.google.cloud.vertexai.api.GenerationConfigOrBuilder> + getGenerationConfigFieldBuilder() { + if (generationConfigBuilder_ == null) { + generationConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig, + com.google.cloud.vertexai.api.GenerationConfig.Builder, + com.google.cloud.vertexai.api.GenerationConfigOrBuilder>( + getGenerationConfig(), getParentForChildren(), isClean()); + generationConfig_ = null; + } + return generationConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.GenerateContentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.GenerateContentRequest) + private static final com.google.cloud.vertexai.api.GenerateContentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GenerateContentRequest(); + } + + public static com.google.cloud.vertexai.api.GenerateContentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateContentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequestOrBuilder.java new file mode 100644 index 000000000000..1ee51a297143 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequestOrBuilder.java @@ -0,0 +1,368 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface GenerateContentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.GenerateContentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * Required. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * `projects/{project}/locations/{location}/publishers/*/models/*`
+   * 
+ * + * string model = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * Required. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * `projects/{project}/locations/{location}/publishers/*/models/*`
+   * 
+ * + * string model = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); + + /** + * + * + *
+   * Required. The content of the current conversation with the model.
+   *
+   * For single-turn queries, this is a single instance. For multi-turn queries,
+   * this is a repeated field that contains conversation history + latest
+   * request.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getContentsList(); + /** + * + * + *
+   * Required. The content of the current conversation with the model.
+   *
+   * For single-turn queries, this is a single instance. For multi-turn queries,
+   * this is a repeated field that contains conversation history + latest
+   * request.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.Content getContents(int index); + /** + * + * + *
+   * Required. The content of the current conversation with the model.
+   *
+   * For single-turn queries, this is a single instance. For multi-turn queries,
+   * this is a repeated field that contains conversation history + latest
+   * request.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getContentsCount(); + /** + * + * + *
+   * Required. The content of the current conversation with the model.
+   *
+   * For single-turn queries, this is a single instance. For multi-turn queries,
+   * this is a repeated field that contains conversation history + latest
+   * request.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getContentsOrBuilderList(); + /** + * + * + *
+   * Required. The content of the current conversation with the model.
+   *
+   * For single-turn queries, this is a single instance. For multi-turn queries,
+   * this is a repeated field that contains conversation history + latest
+   * request.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index); + + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model. The only supported tool is currently
+   * `Function`
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getToolsList(); + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model. The only supported tool is currently
+   * `Function`
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.Tool getTools(int index); + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model. The only supported tool is currently
+   * `Function`
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getToolsCount(); + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model. The only supported tool is currently
+   * `Function`
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getToolsOrBuilderList(); + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model. The only supported tool is currently
+   * `Function`
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.ToolOrBuilder getToolsOrBuilder(int index); + + /** + * + * + *
+   * Optional. Per request settings for blocking unsafe content.
+   * Enforced on GenerateContentResponse.candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getSafetySettingsList(); + /** + * + * + *
+   * Optional. Per request settings for blocking unsafe content.
+   * Enforced on GenerateContentResponse.candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.SafetySetting getSafetySettings(int index); + /** + * + * + *
+   * Optional. Per request settings for blocking unsafe content.
+   * Enforced on GenerateContentResponse.candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getSafetySettingsCount(); + /** + * + * + *
+   * Optional. Per request settings for blocking unsafe content.
+   * Enforced on GenerateContentResponse.candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getSafetySettingsOrBuilderList(); + /** + * + * + *
+   * Optional. Per request settings for blocking unsafe content.
+   * Enforced on GenerateContentResponse.candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.SafetySettingOrBuilder getSafetySettingsOrBuilder(int index); + + /** + * + * + *
+   * Optional. Generation config.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the generationConfig field is set. + */ + boolean hasGenerationConfig(); + /** + * + * + *
+   * Optional. Generation config.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The generationConfig. + */ + com.google.cloud.vertexai.api.GenerationConfig getGenerationConfig(); + /** + * + * + *
+   * Optional. Generation config.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.GenerationConfigOrBuilder getGenerationConfigOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentResponse.java new file mode 100644 index 000000000000..de438852a4af --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentResponse.java @@ -0,0 +1,3971 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for [PredictionService.GenerateContent].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenerateContentResponse} + */ +public final class GenerateContentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.GenerateContentResponse) + GenerateContentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateContentResponse.newBuilder() to construct. + private GenerateContentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateContentResponse() { + candidates_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateContentResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerateContentResponse.class, + com.google.cloud.vertexai.api.GenerateContentResponse.Builder.class); + } + + public interface PromptFeedbackOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. Blocked reason.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for blockReason. + */ + int getBlockReasonValue(); + /** + * + * + *
+     * Output only. Blocked reason.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The blockReason. + */ + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason + getBlockReason(); + + /** + * + * + *
+     * Output only. Safety ratings.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getSafetyRatingsList(); + /** + * + * + *
+     * Output only. Safety ratings.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.SafetyRating getSafetyRatings(int index); + /** + * + * + *
+     * Output only. Safety ratings.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getSafetyRatingsCount(); + /** + * + * + *
+     * Output only. Safety ratings.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getSafetyRatingsOrBuilderList(); + /** + * + * + *
+     * Output only. Safety ratings.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.SafetyRatingOrBuilder getSafetyRatingsOrBuilder(int index); + + /** + * + * + *
+     * Output only. A readable block reason message.
+     * 
+ * + * string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The blockReasonMessage. + */ + java.lang.String getBlockReasonMessage(); + /** + * + * + *
+     * Output only. A readable block reason message.
+     * 
+ * + * string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for blockReasonMessage. + */ + com.google.protobuf.ByteString getBlockReasonMessageBytes(); + } + /** + * + * + *
+   * Content filter results for a prompt sent in the request.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback} + */ + public static final class PromptFeedback extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback) + PromptFeedbackOrBuilder { + private static final long serialVersionUID = 0L; + // Use PromptFeedback.newBuilder() to construct. + private PromptFeedback(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PromptFeedback() { + blockReason_ = 0; + safetyRatings_ = java.util.Collections.emptyList(); + blockReasonMessage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PromptFeedback(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_PromptFeedback_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_PromptFeedback_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.class, + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.Builder.class); + } + + /** + * + * + *
+     * Blocked reason enumeration.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason} + */ + public enum BlockedReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified blocked reason.
+       * 
+ * + * BLOCKED_REASON_UNSPECIFIED = 0; + */ + BLOCKED_REASON_UNSPECIFIED(0), + /** + * + * + *
+       * Candidates blocked due to safety.
+       * 
+ * + * SAFETY = 1; + */ + SAFETY(1), + /** + * + * + *
+       * Candidates blocked due to other reason.
+       * 
+ * + * OTHER = 2; + */ + OTHER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified blocked reason.
+       * 
+ * + * BLOCKED_REASON_UNSPECIFIED = 0; + */ + public static final int BLOCKED_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Candidates blocked due to safety.
+       * 
+ * + * SAFETY = 1; + */ + public static final int SAFETY_VALUE = 1; + /** + * + * + *
+       * Candidates blocked due to other reason.
+       * 
+ * + * OTHER = 2; + */ + public static final int OTHER_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BlockedReason valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static BlockedReason forNumber(int value) { + switch (value) { + case 0: + return BLOCKED_REASON_UNSPECIFIED; + case 1: + return SAFETY; + case 2: + return OTHER; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public BlockedReason findValueByNumber(int number) { + return BlockedReason.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final BlockedReason[] VALUES = values(); + + public static BlockedReason valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private BlockedReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason) + } + + public static final int BLOCK_REASON_FIELD_NUMBER = 1; + private int blockReason_ = 0; + /** + * + * + *
+     * Output only. Blocked reason.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for blockReason. + */ + @java.lang.Override + public int getBlockReasonValue() { + return blockReason_; + } + /** + * + * + *
+     * Output only. Blocked reason.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The blockReason. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason + getBlockReason() { + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason result = + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason + .forNumber(blockReason_); + return result == null + ? com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason + .UNRECOGNIZED + : result; + } + + public static final int SAFETY_RATINGS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List safetyRatings_; + /** + * + * + *
+     * Output only. Safety ratings.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getSafetyRatingsList() { + return safetyRatings_; + } + /** + * + * + *
+     * Output only. Safety ratings.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getSafetyRatingsOrBuilderList() { + return safetyRatings_; + } + /** + * + * + *
+     * Output only. Safety ratings.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getSafetyRatingsCount() { + return safetyRatings_.size(); + } + /** + * + * + *
+     * Output only. Safety ratings.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SafetyRating getSafetyRatings(int index) { + return safetyRatings_.get(index); + } + /** + * + * + *
+     * Output only. Safety ratings.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SafetyRatingOrBuilder getSafetyRatingsOrBuilder( + int index) { + return safetyRatings_.get(index); + } + + public static final int BLOCK_REASON_MESSAGE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object blockReasonMessage_ = ""; + /** + * + * + *
+     * Output only. A readable block reason message.
+     * 
+ * + * string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The blockReasonMessage. + */ + @java.lang.Override + public java.lang.String getBlockReasonMessage() { + java.lang.Object ref = blockReasonMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + blockReasonMessage_ = s; + return s; + } + } + /** + * + * + *
+     * Output only. A readable block reason message.
+     * 
+ * + * string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for blockReasonMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBlockReasonMessageBytes() { + java.lang.Object ref = blockReasonMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + blockReasonMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (blockReason_ + != com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason + .BLOCKED_REASON_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, blockReason_); + } + for (int i = 0; i < safetyRatings_.size(); i++) { + output.writeMessage(2, safetyRatings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(blockReasonMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, blockReasonMessage_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (blockReason_ + != com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason + .BLOCKED_REASON_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, blockReason_); + } + for (int i = 0; i < safetyRatings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, safetyRatings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(blockReasonMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, blockReasonMessage_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback other = + (com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback) obj; + + if (blockReason_ != other.blockReason_) return false; + if (!getSafetyRatingsList().equals(other.getSafetyRatingsList())) return false; + if (!getBlockReasonMessage().equals(other.getBlockReasonMessage())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BLOCK_REASON_FIELD_NUMBER; + hash = (53 * hash) + blockReason_; + if (getSafetyRatingsCount() > 0) { + hash = (37 * hash) + SAFETY_RATINGS_FIELD_NUMBER; + hash = (53 * hash) + getSafetyRatingsList().hashCode(); + } + hash = (37 * hash) + BLOCK_REASON_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getBlockReasonMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Content filter results for a prompt sent in the request.
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback) + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedbackOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_PromptFeedback_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_PromptFeedback_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.class, + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + blockReason_ = 0; + if (safetyRatingsBuilder_ == null) { + safetyRatings_ = java.util.Collections.emptyList(); + } else { + safetyRatings_ = null; + safetyRatingsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + blockReasonMessage_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_PromptFeedback_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback build() { + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback buildPartial() { + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback result = + new com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback result) { + if (safetyRatingsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + safetyRatings_ = java.util.Collections.unmodifiableList(safetyRatings_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.safetyRatings_ = safetyRatings_; + } else { + result.safetyRatings_ = safetyRatingsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.blockReason_ = blockReason_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.blockReasonMessage_ = blockReasonMessage_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback) { + return mergeFrom( + (com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback other) { + if (other + == com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + .getDefaultInstance()) return this; + if (other.blockReason_ != 0) { + setBlockReasonValue(other.getBlockReasonValue()); + } + if (safetyRatingsBuilder_ == null) { + if (!other.safetyRatings_.isEmpty()) { + if (safetyRatings_.isEmpty()) { + safetyRatings_ = other.safetyRatings_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSafetyRatingsIsMutable(); + safetyRatings_.addAll(other.safetyRatings_); + } + onChanged(); + } + } else { + if (!other.safetyRatings_.isEmpty()) { + if (safetyRatingsBuilder_.isEmpty()) { + safetyRatingsBuilder_.dispose(); + safetyRatingsBuilder_ = null; + safetyRatings_ = other.safetyRatings_; + bitField0_ = (bitField0_ & ~0x00000002); + safetyRatingsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSafetyRatingsFieldBuilder() + : null; + } else { + safetyRatingsBuilder_.addAllMessages(other.safetyRatings_); + } + } + } + if (!other.getBlockReasonMessage().isEmpty()) { + blockReasonMessage_ = other.blockReasonMessage_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + blockReason_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + com.google.cloud.vertexai.api.SafetyRating m = + input.readMessage( + com.google.cloud.vertexai.api.SafetyRating.parser(), extensionRegistry); + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + safetyRatings_.add(m); + } else { + safetyRatingsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + blockReasonMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int blockReason_ = 0; + /** + * + * + *
+       * Output only. Blocked reason.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for blockReason. + */ + @java.lang.Override + public int getBlockReasonValue() { + return blockReason_; + } + /** + * + * + *
+       * Output only. Blocked reason.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for blockReason to set. + * @return This builder for chaining. + */ + public Builder setBlockReasonValue(int value) { + blockReason_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Blocked reason.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The blockReason. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason + getBlockReason() { + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason result = + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason + .forNumber(blockReason_); + return result == null + ? com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Output only. Blocked reason.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The blockReason to set. + * @return This builder for chaining. + */ + public Builder setBlockReason( + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.BlockedReason + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + blockReason_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Blocked reason.
+       * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearBlockReason() { + bitField0_ = (bitField0_ & ~0x00000001); + blockReason_ = 0; + onChanged(); + return this; + } + + private java.util.List safetyRatings_ = + java.util.Collections.emptyList(); + + private void ensureSafetyRatingsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + safetyRatings_ = + new java.util.ArrayList(safetyRatings_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.SafetyRating, + com.google.cloud.vertexai.api.SafetyRating.Builder, + com.google.cloud.vertexai.api.SafetyRatingOrBuilder> + safetyRatingsBuilder_; + + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getSafetyRatingsList() { + if (safetyRatingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(safetyRatings_); + } else { + return safetyRatingsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getSafetyRatingsCount() { + if (safetyRatingsBuilder_ == null) { + return safetyRatings_.size(); + } else { + return safetyRatingsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.SafetyRating getSafetyRatings(int index) { + if (safetyRatingsBuilder_ == null) { + return safetyRatings_.get(index); + } else { + return safetyRatingsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSafetyRatings(int index, com.google.cloud.vertexai.api.SafetyRating value) { + if (safetyRatingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSafetyRatingsIsMutable(); + safetyRatings_.set(index, value); + onChanged(); + } else { + safetyRatingsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSafetyRatings( + int index, com.google.cloud.vertexai.api.SafetyRating.Builder builderForValue) { + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + safetyRatings_.set(index, builderForValue.build()); + onChanged(); + } else { + safetyRatingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSafetyRatings(com.google.cloud.vertexai.api.SafetyRating value) { + if (safetyRatingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSafetyRatingsIsMutable(); + safetyRatings_.add(value); + onChanged(); + } else { + safetyRatingsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSafetyRatings(int index, com.google.cloud.vertexai.api.SafetyRating value) { + if (safetyRatingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSafetyRatingsIsMutable(); + safetyRatings_.add(index, value); + onChanged(); + } else { + safetyRatingsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSafetyRatings( + com.google.cloud.vertexai.api.SafetyRating.Builder builderForValue) { + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + safetyRatings_.add(builderForValue.build()); + onChanged(); + } else { + safetyRatingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addSafetyRatings( + int index, com.google.cloud.vertexai.api.SafetyRating.Builder builderForValue) { + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + safetyRatings_.add(index, builderForValue.build()); + onChanged(); + } else { + safetyRatingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllSafetyRatings( + java.lang.Iterable values) { + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, safetyRatings_); + onChanged(); + } else { + safetyRatingsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSafetyRatings() { + if (safetyRatingsBuilder_ == null) { + safetyRatings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + safetyRatingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeSafetyRatings(int index) { + if (safetyRatingsBuilder_ == null) { + ensureSafetyRatingsIsMutable(); + safetyRatings_.remove(index); + onChanged(); + } else { + safetyRatingsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.SafetyRating.Builder getSafetyRatingsBuilder(int index) { + return getSafetyRatingsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.SafetyRatingOrBuilder getSafetyRatingsOrBuilder( + int index) { + if (safetyRatingsBuilder_ == null) { + return safetyRatings_.get(index); + } else { + return safetyRatingsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getSafetyRatingsOrBuilderList() { + if (safetyRatingsBuilder_ != null) { + return safetyRatingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(safetyRatings_); + } + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.SafetyRating.Builder addSafetyRatingsBuilder() { + return getSafetyRatingsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.SafetyRating.getDefaultInstance()); + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.SafetyRating.Builder addSafetyRatingsBuilder(int index) { + return getSafetyRatingsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.SafetyRating.getDefaultInstance()); + } + /** + * + * + *
+       * Output only. Safety ratings.
+       * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getSafetyRatingsBuilderList() { + return getSafetyRatingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.SafetyRating, + com.google.cloud.vertexai.api.SafetyRating.Builder, + com.google.cloud.vertexai.api.SafetyRatingOrBuilder> + getSafetyRatingsFieldBuilder() { + if (safetyRatingsBuilder_ == null) { + safetyRatingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.SafetyRating, + com.google.cloud.vertexai.api.SafetyRating.Builder, + com.google.cloud.vertexai.api.SafetyRatingOrBuilder>( + safetyRatings_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + safetyRatings_ = null; + } + return safetyRatingsBuilder_; + } + + private java.lang.Object blockReasonMessage_ = ""; + /** + * + * + *
+       * Output only. A readable block reason message.
+       * 
+ * + * string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The blockReasonMessage. + */ + public java.lang.String getBlockReasonMessage() { + java.lang.Object ref = blockReasonMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + blockReasonMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Output only. A readable block reason message.
+       * 
+ * + * string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for blockReasonMessage. + */ + public com.google.protobuf.ByteString getBlockReasonMessageBytes() { + java.lang.Object ref = blockReasonMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + blockReasonMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Output only. A readable block reason message.
+       * 
+ * + * string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The blockReasonMessage to set. + * @return This builder for chaining. + */ + public Builder setBlockReasonMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + blockReasonMessage_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. A readable block reason message.
+       * 
+ * + * string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBlockReasonMessage() { + blockReasonMessage_ = getDefaultInstance().getBlockReasonMessage(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. A readable block reason message.
+       * 
+ * + * string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for blockReasonMessage to set. + * @return This builder for chaining. + */ + public Builder setBlockReasonMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + blockReasonMessage_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback) + private static final com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback(); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PromptFeedback parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface UsageMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Number of tokens in the request.
+     * 
+ * + * int32 prompt_token_count = 1; + * + * @return The promptTokenCount. + */ + int getPromptTokenCount(); + + /** + * + * + *
+     * Number of tokens in the response(s).
+     * 
+ * + * int32 candidates_token_count = 2; + * + * @return The candidatesTokenCount. + */ + int getCandidatesTokenCount(); + + /** + * int32 total_token_count = 3; + * + * @return The totalTokenCount. + */ + int getTotalTokenCount(); + } + /** + * + * + *
+   * Usage metadata about response(s).
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata} + */ + public static final class UsageMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata) + UsageMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UsageMetadata.newBuilder() to construct. + private UsageMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UsageMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UsageMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_UsageMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_UsageMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.class, + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.Builder.class); + } + + public static final int PROMPT_TOKEN_COUNT_FIELD_NUMBER = 1; + private int promptTokenCount_ = 0; + /** + * + * + *
+     * Number of tokens in the request.
+     * 
+ * + * int32 prompt_token_count = 1; + * + * @return The promptTokenCount. + */ + @java.lang.Override + public int getPromptTokenCount() { + return promptTokenCount_; + } + + public static final int CANDIDATES_TOKEN_COUNT_FIELD_NUMBER = 2; + private int candidatesTokenCount_ = 0; + /** + * + * + *
+     * Number of tokens in the response(s).
+     * 
+ * + * int32 candidates_token_count = 2; + * + * @return The candidatesTokenCount. + */ + @java.lang.Override + public int getCandidatesTokenCount() { + return candidatesTokenCount_; + } + + public static final int TOTAL_TOKEN_COUNT_FIELD_NUMBER = 3; + private int totalTokenCount_ = 0; + /** + * int32 total_token_count = 3; + * + * @return The totalTokenCount. + */ + @java.lang.Override + public int getTotalTokenCount() { + return totalTokenCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (promptTokenCount_ != 0) { + output.writeInt32(1, promptTokenCount_); + } + if (candidatesTokenCount_ != 0) { + output.writeInt32(2, candidatesTokenCount_); + } + if (totalTokenCount_ != 0) { + output.writeInt32(3, totalTokenCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (promptTokenCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, promptTokenCount_); + } + if (candidatesTokenCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, candidatesTokenCount_); + } + if (totalTokenCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, totalTokenCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata other = + (com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata) obj; + + if (getPromptTokenCount() != other.getPromptTokenCount()) return false; + if (getCandidatesTokenCount() != other.getCandidatesTokenCount()) return false; + if (getTotalTokenCount() != other.getTotalTokenCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROMPT_TOKEN_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPromptTokenCount(); + hash = (37 * hash) + CANDIDATES_TOKEN_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCandidatesTokenCount(); + hash = (37 * hash) + TOTAL_TOKEN_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTotalTokenCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Usage metadata about response(s).
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata) + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_UsageMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_UsageMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.class, + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + promptTokenCount_ = 0; + candidatesTokenCount_ = 0; + totalTokenCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_UsageMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata build() { + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata buildPartial() { + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata result = + new com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.promptTokenCount_ = promptTokenCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.candidatesTokenCount_ = candidatesTokenCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.totalTokenCount_ = totalTokenCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata) { + return mergeFrom( + (com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata other) { + if (other + == com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + .getDefaultInstance()) return this; + if (other.getPromptTokenCount() != 0) { + setPromptTokenCount(other.getPromptTokenCount()); + } + if (other.getCandidatesTokenCount() != 0) { + setCandidatesTokenCount(other.getCandidatesTokenCount()); + } + if (other.getTotalTokenCount() != 0) { + setTotalTokenCount(other.getTotalTokenCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + promptTokenCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + candidatesTokenCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + totalTokenCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int promptTokenCount_; + /** + * + * + *
+       * Number of tokens in the request.
+       * 
+ * + * int32 prompt_token_count = 1; + * + * @return The promptTokenCount. + */ + @java.lang.Override + public int getPromptTokenCount() { + return promptTokenCount_; + } + /** + * + * + *
+       * Number of tokens in the request.
+       * 
+ * + * int32 prompt_token_count = 1; + * + * @param value The promptTokenCount to set. + * @return This builder for chaining. + */ + public Builder setPromptTokenCount(int value) { + + promptTokenCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of tokens in the request.
+       * 
+ * + * int32 prompt_token_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearPromptTokenCount() { + bitField0_ = (bitField0_ & ~0x00000001); + promptTokenCount_ = 0; + onChanged(); + return this; + } + + private int candidatesTokenCount_; + /** + * + * + *
+       * Number of tokens in the response(s).
+       * 
+ * + * int32 candidates_token_count = 2; + * + * @return The candidatesTokenCount. + */ + @java.lang.Override + public int getCandidatesTokenCount() { + return candidatesTokenCount_; + } + /** + * + * + *
+       * Number of tokens in the response(s).
+       * 
+ * + * int32 candidates_token_count = 2; + * + * @param value The candidatesTokenCount to set. + * @return This builder for chaining. + */ + public Builder setCandidatesTokenCount(int value) { + + candidatesTokenCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of tokens in the response(s).
+       * 
+ * + * int32 candidates_token_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearCandidatesTokenCount() { + bitField0_ = (bitField0_ & ~0x00000002); + candidatesTokenCount_ = 0; + onChanged(); + return this; + } + + private int totalTokenCount_; + /** + * int32 total_token_count = 3; + * + * @return The totalTokenCount. + */ + @java.lang.Override + public int getTotalTokenCount() { + return totalTokenCount_; + } + /** + * int32 total_token_count = 3; + * + * @param value The totalTokenCount to set. + * @return This builder for chaining. + */ + public Builder setTotalTokenCount(int value) { + + totalTokenCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int32 total_token_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearTotalTokenCount() { + bitField0_ = (bitField0_ & ~0x00000004); + totalTokenCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata) + private static final com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata(); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UsageMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CANDIDATES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List candidates_; + /** + * + * + *
+   * Output only. Generated candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getCandidatesList() { + return candidates_; + } + /** + * + * + *
+   * Output only. Generated candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getCandidatesOrBuilderList() { + return candidates_; + } + /** + * + * + *
+   * Output only. Generated candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getCandidatesCount() { + return candidates_.size(); + } + /** + * + * + *
+   * Output only. Generated candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Candidate getCandidates(int index) { + return candidates_.get(index); + } + /** + * + * + *
+   * Output only. Generated candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.CandidateOrBuilder getCandidatesOrBuilder(int index) { + return candidates_.get(index); + } + + public static final int PROMPT_FEEDBACK_FIELD_NUMBER = 3; + private com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback promptFeedback_; + /** + * + * + *
+   * Output only. Content filter results for a prompt sent in the request.
+   * Note: Sent only in the first stream chunk.
+   * Only happens when no candidates were generated due to content violations.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the promptFeedback field is set. + */ + @java.lang.Override + public boolean hasPromptFeedback() { + return promptFeedback_ != null; + } + /** + * + * + *
+   * Output only. Content filter results for a prompt sent in the request.
+   * Note: Sent only in the first stream chunk.
+   * Only happens when no candidates were generated due to content violations.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The promptFeedback. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback getPromptFeedback() { + return promptFeedback_ == null + ? com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.getDefaultInstance() + : promptFeedback_; + } + /** + * + * + *
+   * Output only. Content filter results for a prompt sent in the request.
+   * Note: Sent only in the first stream chunk.
+   * Only happens when no candidates were generated due to content violations.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedbackOrBuilder + getPromptFeedbackOrBuilder() { + return promptFeedback_ == null + ? com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.getDefaultInstance() + : promptFeedback_; + } + + public static final int USAGE_METADATA_FIELD_NUMBER = 4; + private com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata usageMetadata_; + /** + * + * + *
+   * Usage metadata about the response(s).
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + * + * @return Whether the usageMetadata field is set. + */ + @java.lang.Override + public boolean hasUsageMetadata() { + return usageMetadata_ != null; + } + /** + * + * + *
+   * Usage metadata about the response(s).
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + * + * @return The usageMetadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata getUsageMetadata() { + return usageMetadata_ == null + ? com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.getDefaultInstance() + : usageMetadata_; + } + /** + * + * + *
+   * Usage metadata about the response(s).
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadataOrBuilder + getUsageMetadataOrBuilder() { + return usageMetadata_ == null + ? com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.getDefaultInstance() + : usageMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < candidates_.size(); i++) { + output.writeMessage(2, candidates_.get(i)); + } + if (promptFeedback_ != null) { + output.writeMessage(3, getPromptFeedback()); + } + if (usageMetadata_ != null) { + output.writeMessage(4, getUsageMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < candidates_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, candidates_.get(i)); + } + if (promptFeedback_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPromptFeedback()); + } + if (usageMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUsageMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GenerateContentResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GenerateContentResponse other = + (com.google.cloud.vertexai.api.GenerateContentResponse) obj; + + if (!getCandidatesList().equals(other.getCandidatesList())) return false; + if (hasPromptFeedback() != other.hasPromptFeedback()) return false; + if (hasPromptFeedback()) { + if (!getPromptFeedback().equals(other.getPromptFeedback())) return false; + } + if (hasUsageMetadata() != other.hasUsageMetadata()) return false; + if (hasUsageMetadata()) { + if (!getUsageMetadata().equals(other.getUsageMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCandidatesCount() > 0) { + hash = (37 * hash) + CANDIDATES_FIELD_NUMBER; + hash = (53 * hash) + getCandidatesList().hashCode(); + } + if (hasPromptFeedback()) { + hash = (37 * hash) + PROMPT_FEEDBACK_FIELD_NUMBER; + hash = (53 * hash) + getPromptFeedback().hashCode(); + } + if (hasUsageMetadata()) { + hash = (37 * hash) + USAGE_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getUsageMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.GenerateContentResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for [PredictionService.GenerateContent].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenerateContentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.GenerateContentResponse) + com.google.cloud.vertexai.api.GenerateContentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerateContentResponse.class, + com.google.cloud.vertexai.api.GenerateContentResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GenerateContentResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (candidatesBuilder_ == null) { + candidates_ = java.util.Collections.emptyList(); + } else { + candidates_ = null; + candidatesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + promptFeedback_ = null; + if (promptFeedbackBuilder_ != null) { + promptFeedbackBuilder_.dispose(); + promptFeedbackBuilder_ = null; + } + usageMetadata_ = null; + if (usageMetadataBuilder_ != null) { + usageMetadataBuilder_.dispose(); + usageMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GenerateContentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse build() { + com.google.cloud.vertexai.api.GenerateContentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse buildPartial() { + com.google.cloud.vertexai.api.GenerateContentResponse result = + new com.google.cloud.vertexai.api.GenerateContentResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.GenerateContentResponse result) { + if (candidatesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + candidates_ = java.util.Collections.unmodifiableList(candidates_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.candidates_ = candidates_; + } else { + result.candidates_ = candidatesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.GenerateContentResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.promptFeedback_ = + promptFeedbackBuilder_ == null ? promptFeedback_ : promptFeedbackBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.usageMetadata_ = + usageMetadataBuilder_ == null ? usageMetadata_ : usageMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GenerateContentResponse) { + return mergeFrom((com.google.cloud.vertexai.api.GenerateContentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GenerateContentResponse other) { + if (other == com.google.cloud.vertexai.api.GenerateContentResponse.getDefaultInstance()) + return this; + if (candidatesBuilder_ == null) { + if (!other.candidates_.isEmpty()) { + if (candidates_.isEmpty()) { + candidates_ = other.candidates_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCandidatesIsMutable(); + candidates_.addAll(other.candidates_); + } + onChanged(); + } + } else { + if (!other.candidates_.isEmpty()) { + if (candidatesBuilder_.isEmpty()) { + candidatesBuilder_.dispose(); + candidatesBuilder_ = null; + candidates_ = other.candidates_; + bitField0_ = (bitField0_ & ~0x00000001); + candidatesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCandidatesFieldBuilder() + : null; + } else { + candidatesBuilder_.addAllMessages(other.candidates_); + } + } + } + if (other.hasPromptFeedback()) { + mergePromptFeedback(other.getPromptFeedback()); + } + if (other.hasUsageMetadata()) { + mergeUsageMetadata(other.getUsageMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + com.google.cloud.vertexai.api.Candidate m = + input.readMessage( + com.google.cloud.vertexai.api.Candidate.parser(), extensionRegistry); + if (candidatesBuilder_ == null) { + ensureCandidatesIsMutable(); + candidates_.add(m); + } else { + candidatesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + input.readMessage(getPromptFeedbackFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: + { + input.readMessage(getUsageMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List candidates_ = + java.util.Collections.emptyList(); + + private void ensureCandidatesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + candidates_ = new java.util.ArrayList(candidates_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Candidate, + com.google.cloud.vertexai.api.Candidate.Builder, + com.google.cloud.vertexai.api.CandidateOrBuilder> + candidatesBuilder_; + + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getCandidatesList() { + if (candidatesBuilder_ == null) { + return java.util.Collections.unmodifiableList(candidates_); + } else { + return candidatesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getCandidatesCount() { + if (candidatesBuilder_ == null) { + return candidates_.size(); + } else { + return candidatesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Candidate getCandidates(int index) { + if (candidatesBuilder_ == null) { + return candidates_.get(index); + } else { + return candidatesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCandidates(int index, com.google.cloud.vertexai.api.Candidate value) { + if (candidatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCandidatesIsMutable(); + candidates_.set(index, value); + onChanged(); + } else { + candidatesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCandidates( + int index, com.google.cloud.vertexai.api.Candidate.Builder builderForValue) { + if (candidatesBuilder_ == null) { + ensureCandidatesIsMutable(); + candidates_.set(index, builderForValue.build()); + onChanged(); + } else { + candidatesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCandidates(com.google.cloud.vertexai.api.Candidate value) { + if (candidatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCandidatesIsMutable(); + candidates_.add(value); + onChanged(); + } else { + candidatesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCandidates(int index, com.google.cloud.vertexai.api.Candidate value) { + if (candidatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCandidatesIsMutable(); + candidates_.add(index, value); + onChanged(); + } else { + candidatesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCandidates(com.google.cloud.vertexai.api.Candidate.Builder builderForValue) { + if (candidatesBuilder_ == null) { + ensureCandidatesIsMutable(); + candidates_.add(builderForValue.build()); + onChanged(); + } else { + candidatesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCandidates( + int index, com.google.cloud.vertexai.api.Candidate.Builder builderForValue) { + if (candidatesBuilder_ == null) { + ensureCandidatesIsMutable(); + candidates_.add(index, builderForValue.build()); + onChanged(); + } else { + candidatesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllCandidates( + java.lang.Iterable values) { + if (candidatesBuilder_ == null) { + ensureCandidatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, candidates_); + onChanged(); + } else { + candidatesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCandidates() { + if (candidatesBuilder_ == null) { + candidates_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + candidatesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeCandidates(int index) { + if (candidatesBuilder_ == null) { + ensureCandidatesIsMutable(); + candidates_.remove(index); + onChanged(); + } else { + candidatesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Candidate.Builder getCandidatesBuilder(int index) { + return getCandidatesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.CandidateOrBuilder getCandidatesOrBuilder(int index) { + if (candidatesBuilder_ == null) { + return candidates_.get(index); + } else { + return candidatesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getCandidatesOrBuilderList() { + if (candidatesBuilder_ != null) { + return candidatesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(candidates_); + } + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Candidate.Builder addCandidatesBuilder() { + return getCandidatesFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Candidate.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Candidate.Builder addCandidatesBuilder(int index) { + return getCandidatesFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Candidate.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Generated candidates.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getCandidatesBuilderList() { + return getCandidatesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Candidate, + com.google.cloud.vertexai.api.Candidate.Builder, + com.google.cloud.vertexai.api.CandidateOrBuilder> + getCandidatesFieldBuilder() { + if (candidatesBuilder_ == null) { + candidatesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Candidate, + com.google.cloud.vertexai.api.Candidate.Builder, + com.google.cloud.vertexai.api.CandidateOrBuilder>( + candidates_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + candidates_ = null; + } + return candidatesBuilder_; + } + + private com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback promptFeedback_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback, + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.Builder, + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedbackOrBuilder> + promptFeedbackBuilder_; + /** + * + * + *
+     * Output only. Content filter results for a prompt sent in the request.
+     * Note: Sent only in the first stream chunk.
+     * Only happens when no candidates were generated due to content violations.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the promptFeedback field is set. + */ + public boolean hasPromptFeedback() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Content filter results for a prompt sent in the request.
+     * Note: Sent only in the first stream chunk.
+     * Only happens when no candidates were generated due to content violations.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The promptFeedback. + */ + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + getPromptFeedback() { + if (promptFeedbackBuilder_ == null) { + return promptFeedback_ == null + ? com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + .getDefaultInstance() + : promptFeedback_; + } else { + return promptFeedbackBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Content filter results for a prompt sent in the request.
+     * Note: Sent only in the first stream chunk.
+     * Only happens when no candidates were generated due to content violations.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPromptFeedback( + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback value) { + if (promptFeedbackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + promptFeedback_ = value; + } else { + promptFeedbackBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Content filter results for a prompt sent in the request.
+     * Note: Sent only in the first stream chunk.
+     * Only happens when no candidates were generated due to content violations.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPromptFeedback( + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.Builder + builderForValue) { + if (promptFeedbackBuilder_ == null) { + promptFeedback_ = builderForValue.build(); + } else { + promptFeedbackBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Content filter results for a prompt sent in the request.
+     * Note: Sent only in the first stream chunk.
+     * Only happens when no candidates were generated due to content violations.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePromptFeedback( + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback value) { + if (promptFeedbackBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && promptFeedback_ != null + && promptFeedback_ + != com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + .getDefaultInstance()) { + getPromptFeedbackBuilder().mergeFrom(value); + } else { + promptFeedback_ = value; + } + } else { + promptFeedbackBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Content filter results for a prompt sent in the request.
+     * Note: Sent only in the first stream chunk.
+     * Only happens when no candidates were generated due to content violations.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPromptFeedback() { + bitField0_ = (bitField0_ & ~0x00000002); + promptFeedback_ = null; + if (promptFeedbackBuilder_ != null) { + promptFeedbackBuilder_.dispose(); + promptFeedbackBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Content filter results for a prompt sent in the request.
+     * Note: Sent only in the first stream chunk.
+     * Only happens when no candidates were generated due to content violations.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.Builder + getPromptFeedbackBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getPromptFeedbackFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Content filter results for a prompt sent in the request.
+     * Note: Sent only in the first stream chunk.
+     * Only happens when no candidates were generated due to content violations.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedbackOrBuilder + getPromptFeedbackOrBuilder() { + if (promptFeedbackBuilder_ != null) { + return promptFeedbackBuilder_.getMessageOrBuilder(); + } else { + return promptFeedback_ == null + ? com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback + .getDefaultInstance() + : promptFeedback_; + } + } + /** + * + * + *
+     * Output only. Content filter results for a prompt sent in the request.
+     * Note: Sent only in the first stream chunk.
+     * Only happens when no candidates were generated due to content violations.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback, + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.Builder, + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedbackOrBuilder> + getPromptFeedbackFieldBuilder() { + if (promptFeedbackBuilder_ == null) { + promptFeedbackBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback, + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback.Builder, + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedbackOrBuilder>( + getPromptFeedback(), getParentForChildren(), isClean()); + promptFeedback_ = null; + } + return promptFeedbackBuilder_; + } + + private com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata usageMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata, + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.Builder, + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadataOrBuilder> + usageMetadataBuilder_; + /** + * + * + *
+     * Usage metadata about the response(s).
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + * + * @return Whether the usageMetadata field is set. + */ + public boolean hasUsageMetadata() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Usage metadata about the response(s).
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + * + * @return The usageMetadata. + */ + public com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata getUsageMetadata() { + if (usageMetadataBuilder_ == null) { + return usageMetadata_ == null + ? com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + .getDefaultInstance() + : usageMetadata_; + } else { + return usageMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Usage metadata about the response(s).
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + */ + public Builder setUsageMetadata( + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata value) { + if (usageMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + usageMetadata_ = value; + } else { + usageMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Usage metadata about the response(s).
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + */ + public Builder setUsageMetadata( + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.Builder + builderForValue) { + if (usageMetadataBuilder_ == null) { + usageMetadata_ = builderForValue.build(); + } else { + usageMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Usage metadata about the response(s).
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + */ + public Builder mergeUsageMetadata( + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata value) { + if (usageMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && usageMetadata_ != null + && usageMetadata_ + != com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + .getDefaultInstance()) { + getUsageMetadataBuilder().mergeFrom(value); + } else { + usageMetadata_ = value; + } + } else { + usageMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Usage metadata about the response(s).
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + */ + public Builder clearUsageMetadata() { + bitField0_ = (bitField0_ & ~0x00000004); + usageMetadata_ = null; + if (usageMetadataBuilder_ != null) { + usageMetadataBuilder_.dispose(); + usageMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Usage metadata about the response(s).
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + */ + public com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.Builder + getUsageMetadataBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUsageMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Usage metadata about the response(s).
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + */ + public com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadataOrBuilder + getUsageMetadataOrBuilder() { + if (usageMetadataBuilder_ != null) { + return usageMetadataBuilder_.getMessageOrBuilder(); + } else { + return usageMetadata_ == null + ? com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata + .getDefaultInstance() + : usageMetadata_; + } + } + /** + * + * + *
+     * Usage metadata about the response(s).
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata, + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.Builder, + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadataOrBuilder> + getUsageMetadataFieldBuilder() { + if (usageMetadataBuilder_ == null) { + usageMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata, + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata.Builder, + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadataOrBuilder>( + getUsageMetadata(), getParentForChildren(), isClean()); + usageMetadata_ = null; + } + return usageMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.GenerateContentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.GenerateContentResponse) + private static final com.google.cloud.vertexai.api.GenerateContentResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GenerateContentResponse(); + } + + public static com.google.cloud.vertexai.api.GenerateContentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateContentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerateContentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentResponseOrBuilder.java new file mode 100644 index 000000000000..5eea2d94abb6 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerateContentResponseOrBuilder.java @@ -0,0 +1,174 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface GenerateContentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.GenerateContentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Generated candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getCandidatesList(); + /** + * + * + *
+   * Output only. Generated candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.Candidate getCandidates(int index); + /** + * + * + *
+   * Output only. Generated candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getCandidatesCount(); + /** + * + * + *
+   * Output only. Generated candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getCandidatesOrBuilderList(); + /** + * + * + *
+   * Output only. Generated candidates.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.CandidateOrBuilder getCandidatesOrBuilder(int index); + + /** + * + * + *
+   * Output only. Content filter results for a prompt sent in the request.
+   * Note: Sent only in the first stream chunk.
+   * Only happens when no candidates were generated due to content violations.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the promptFeedback field is set. + */ + boolean hasPromptFeedback(); + /** + * + * + *
+   * Output only. Content filter results for a prompt sent in the request.
+   * Note: Sent only in the first stream chunk.
+   * Only happens when no candidates were generated due to content violations.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The promptFeedback. + */ + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedback getPromptFeedback(); + /** + * + * + *
+   * Output only. Content filter results for a prompt sent in the request.
+   * Note: Sent only in the first stream chunk.
+   * Only happens when no candidates were generated due to content violations.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.GenerateContentResponse.PromptFeedbackOrBuilder + getPromptFeedbackOrBuilder(); + + /** + * + * + *
+   * Usage metadata about the response(s).
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + * + * @return Whether the usageMetadata field is set. + */ + boolean hasUsageMetadata(); + /** + * + * + *
+   * Usage metadata about the response(s).
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + * + * @return The usageMetadata. + */ + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadata getUsageMetadata(); + /** + * + * + *
+   * Usage metadata about the response(s).
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenerateContentResponse.UsageMetadata usage_metadata = 4; + * + */ + com.google.cloud.vertexai.api.GenerateContentResponse.UsageMetadataOrBuilder + getUsageMetadataOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerationConfig.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerationConfig.java new file mode 100644 index 000000000000..14a2ea1e2f3f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerationConfig.java @@ -0,0 +1,1896 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Generation config.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenerationConfig} + */ +public final class GenerationConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.GenerationConfig) + GenerationConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerationConfig.newBuilder() to construct. + private GenerationConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerationConfig() { + stopSequences_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerationConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 10: + return internalGetLogitBias(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerationConfig.class, + com.google.cloud.vertexai.api.GenerationConfig.Builder.class); + } + + public static final int TEMPERATURE_FIELD_NUMBER = 1; + private float temperature_ = 0F; + /** + * + * + *
+   * Optional. Controls the randomness of predictions.
+   * 
+ * + * float temperature = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The temperature. + */ + @java.lang.Override + public float getTemperature() { + return temperature_; + } + + public static final int TOP_P_FIELD_NUMBER = 2; + private float topP_ = 0F; + /** + * + * + *
+   * Optional. If specified, nucleus sampling will be used.
+   * 
+ * + * float top_p = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The topP. + */ + @java.lang.Override + public float getTopP() { + return topP_; + } + + public static final int TOP_K_FIELD_NUMBER = 3; + private float topK_ = 0F; + /** + * + * + *
+   * Optional. If specified, top-k sampling will be used.
+   * 
+ * + * float top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The topK. + */ + @java.lang.Override + public float getTopK() { + return topK_; + } + + public static final int CANDIDATE_COUNT_FIELD_NUMBER = 4; + private int candidateCount_ = 0; + /** + * + * + *
+   * Optional. Number of candidates to generate.
+   * 
+ * + * int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The candidateCount. + */ + @java.lang.Override + public int getCandidateCount() { + return candidateCount_; + } + + public static final int MAX_OUTPUT_TOKENS_FIELD_NUMBER = 5; + private int maxOutputTokens_ = 0; + /** + * + * + *
+   * Optional. The maximum number of output tokens to generate per message.
+   * 
+ * + * int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The maxOutputTokens. + */ + @java.lang.Override + public int getMaxOutputTokens() { + return maxOutputTokens_; + } + + public static final int STOP_SEQUENCES_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList stopSequences_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. Stop sequences.
+   * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the stopSequences. + */ + public com.google.protobuf.ProtocolStringList getStopSequencesList() { + return stopSequences_; + } + /** + * + * + *
+   * Optional. Stop sequences.
+   * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of stopSequences. + */ + public int getStopSequencesCount() { + return stopSequences_.size(); + } + /** + * + * + *
+   * Optional. Stop sequences.
+   * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The stopSequences at the given index. + */ + public java.lang.String getStopSequences(int index) { + return stopSequences_.get(index); + } + /** + * + * + *
+   * Optional. Stop sequences.
+   * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the stopSequences at the given index. + */ + public com.google.protobuf.ByteString getStopSequencesBytes(int index) { + return stopSequences_.getByteString(index); + } + + public static final int LOGPROBS_FIELD_NUMBER = 7; + private int logprobs_ = 0; + /** + * + * + *
+   * Optional. Logit probabilities.
+   * 
+ * + * int32 logprobs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The logprobs. + */ + @java.lang.Override + public int getLogprobs() { + return logprobs_; + } + + public static final int PRESENCE_PENALTY_FIELD_NUMBER = 8; + private float presencePenalty_ = 0F; + /** + * + * + *
+   * Optional. Positive penalties.
+   * 
+ * + * float presence_penalty = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The presencePenalty. + */ + @java.lang.Override + public float getPresencePenalty() { + return presencePenalty_; + } + + public static final int FREQUENCY_PENALTY_FIELD_NUMBER = 9; + private float frequencyPenalty_ = 0F; + /** + * + * + *
+   * Optional. Frequency penalties.
+   * 
+ * + * float frequency_penalty = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The frequencyPenalty. + */ + @java.lang.Override + public float getFrequencyPenalty() { + return frequencyPenalty_; + } + + public static final int LOGIT_BIAS_FIELD_NUMBER = 10; + + private static final class LogitBiasDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_LogitBiasEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.FLOAT, + 0F); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField logitBias_; + + private com.google.protobuf.MapField internalGetLogitBias() { + if (logitBias_ == null) { + return com.google.protobuf.MapField.emptyMapField(LogitBiasDefaultEntryHolder.defaultEntry); + } + return logitBias_; + } + + public int getLogitBiasCount() { + return internalGetLogitBias().getMap().size(); + } + /** + * + * + *
+   * Optional. Logit bias.
+   * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsLogitBias(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLogitBias().getMap().containsKey(key); + } + /** Use {@link #getLogitBiasMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLogitBias() { + return getLogitBiasMap(); + } + /** + * + * + *
+   * Optional. Logit bias.
+   * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getLogitBiasMap() { + return internalGetLogitBias().getMap(); + } + /** + * + * + *
+   * Optional. Logit bias.
+   * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public float getLogitBiasOrDefault(java.lang.String key, float defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLogitBias().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Logit bias.
+   * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public float getLogitBiasOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLogitBias().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ECHO_FIELD_NUMBER = 11; + private boolean echo_ = false; + /** + * + * + *
+   * Optional. Echo.
+   * 
+ * + * bool echo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The echo. + */ + @java.lang.Override + public boolean getEcho() { + return echo_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(temperature_) != 0) { + output.writeFloat(1, temperature_); + } + if (java.lang.Float.floatToRawIntBits(topP_) != 0) { + output.writeFloat(2, topP_); + } + if (java.lang.Float.floatToRawIntBits(topK_) != 0) { + output.writeFloat(3, topK_); + } + if (candidateCount_ != 0) { + output.writeInt32(4, candidateCount_); + } + if (maxOutputTokens_ != 0) { + output.writeInt32(5, maxOutputTokens_); + } + for (int i = 0; i < stopSequences_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, stopSequences_.getRaw(i)); + } + if (logprobs_ != 0) { + output.writeInt32(7, logprobs_); + } + if (java.lang.Float.floatToRawIntBits(presencePenalty_) != 0) { + output.writeFloat(8, presencePenalty_); + } + if (java.lang.Float.floatToRawIntBits(frequencyPenalty_) != 0) { + output.writeFloat(9, frequencyPenalty_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLogitBias(), LogitBiasDefaultEntryHolder.defaultEntry, 10); + if (echo_ != false) { + output.writeBool(11, echo_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(temperature_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, temperature_); + } + if (java.lang.Float.floatToRawIntBits(topP_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, topP_); + } + if (java.lang.Float.floatToRawIntBits(topK_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, topK_); + } + if (candidateCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, candidateCount_); + } + if (maxOutputTokens_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, maxOutputTokens_); + } + { + int dataSize = 0; + for (int i = 0; i < stopSequences_.size(); i++) { + dataSize += computeStringSizeNoTag(stopSequences_.getRaw(i)); + } + size += dataSize; + size += 1 * getStopSequencesList().size(); + } + if (logprobs_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, logprobs_); + } + if (java.lang.Float.floatToRawIntBits(presencePenalty_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(8, presencePenalty_); + } + if (java.lang.Float.floatToRawIntBits(frequencyPenalty_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(9, frequencyPenalty_); + } + for (java.util.Map.Entry entry : + internalGetLogitBias().getMap().entrySet()) { + com.google.protobuf.MapEntry logitBias__ = + LogitBiasDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, logitBias__); + } + if (echo_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, echo_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GenerationConfig)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GenerationConfig other = + (com.google.cloud.vertexai.api.GenerationConfig) obj; + + if (java.lang.Float.floatToIntBits(getTemperature()) + != java.lang.Float.floatToIntBits(other.getTemperature())) return false; + if (java.lang.Float.floatToIntBits(getTopP()) + != java.lang.Float.floatToIntBits(other.getTopP())) return false; + if (java.lang.Float.floatToIntBits(getTopK()) + != java.lang.Float.floatToIntBits(other.getTopK())) return false; + if (getCandidateCount() != other.getCandidateCount()) return false; + if (getMaxOutputTokens() != other.getMaxOutputTokens()) return false; + if (!getStopSequencesList().equals(other.getStopSequencesList())) return false; + if (getLogprobs() != other.getLogprobs()) return false; + if (java.lang.Float.floatToIntBits(getPresencePenalty()) + != java.lang.Float.floatToIntBits(other.getPresencePenalty())) return false; + if (java.lang.Float.floatToIntBits(getFrequencyPenalty()) + != java.lang.Float.floatToIntBits(other.getFrequencyPenalty())) return false; + if (!internalGetLogitBias().equals(other.internalGetLogitBias())) return false; + if (getEcho() != other.getEcho()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TEMPERATURE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getTemperature()); + hash = (37 * hash) + TOP_P_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getTopP()); + hash = (37 * hash) + TOP_K_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getTopK()); + hash = (37 * hash) + CANDIDATE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getCandidateCount(); + hash = (37 * hash) + MAX_OUTPUT_TOKENS_FIELD_NUMBER; + hash = (53 * hash) + getMaxOutputTokens(); + if (getStopSequencesCount() > 0) { + hash = (37 * hash) + STOP_SEQUENCES_FIELD_NUMBER; + hash = (53 * hash) + getStopSequencesList().hashCode(); + } + hash = (37 * hash) + LOGPROBS_FIELD_NUMBER; + hash = (53 * hash) + getLogprobs(); + hash = (37 * hash) + PRESENCE_PENALTY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPresencePenalty()); + hash = (37 * hash) + FREQUENCY_PENALTY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFrequencyPenalty()); + if (!internalGetLogitBias().getMap().isEmpty()) { + hash = (37 * hash) + LOGIT_BIAS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLogitBias().hashCode(); + } + hash = (37 * hash) + ECHO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEcho()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.GenerationConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Generation config.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenerationConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.GenerationConfig) + com.google.cloud.vertexai.api.GenerationConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 10: + return internalGetLogitBias(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 10: + return internalGetMutableLogitBias(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerationConfig.class, + com.google.cloud.vertexai.api.GenerationConfig.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GenerationConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + temperature_ = 0F; + topP_ = 0F; + topK_ = 0F; + candidateCount_ = 0; + maxOutputTokens_ = 0; + stopSequences_ = com.google.protobuf.LazyStringArrayList.emptyList(); + logprobs_ = 0; + presencePenalty_ = 0F; + frequencyPenalty_ = 0F; + internalGetMutableLogitBias().clear(); + echo_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_GenerationConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GenerationConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig build() { + com.google.cloud.vertexai.api.GenerationConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig buildPartial() { + com.google.cloud.vertexai.api.GenerationConfig result = + new com.google.cloud.vertexai.api.GenerationConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.GenerationConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.temperature_ = temperature_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.topP_ = topP_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.topK_ = topK_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.candidateCount_ = candidateCount_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.maxOutputTokens_ = maxOutputTokens_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + stopSequences_.makeImmutable(); + result.stopSequences_ = stopSequences_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.logprobs_ = logprobs_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.presencePenalty_ = presencePenalty_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.frequencyPenalty_ = frequencyPenalty_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.logitBias_ = internalGetLogitBias(); + result.logitBias_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.echo_ = echo_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GenerationConfig) { + return mergeFrom((com.google.cloud.vertexai.api.GenerationConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GenerationConfig other) { + if (other == com.google.cloud.vertexai.api.GenerationConfig.getDefaultInstance()) return this; + if (other.getTemperature() != 0F) { + setTemperature(other.getTemperature()); + } + if (other.getTopP() != 0F) { + setTopP(other.getTopP()); + } + if (other.getTopK() != 0F) { + setTopK(other.getTopK()); + } + if (other.getCandidateCount() != 0) { + setCandidateCount(other.getCandidateCount()); + } + if (other.getMaxOutputTokens() != 0) { + setMaxOutputTokens(other.getMaxOutputTokens()); + } + if (!other.stopSequences_.isEmpty()) { + if (stopSequences_.isEmpty()) { + stopSequences_ = other.stopSequences_; + bitField0_ |= 0x00000020; + } else { + ensureStopSequencesIsMutable(); + stopSequences_.addAll(other.stopSequences_); + } + onChanged(); + } + if (other.getLogprobs() != 0) { + setLogprobs(other.getLogprobs()); + } + if (other.getPresencePenalty() != 0F) { + setPresencePenalty(other.getPresencePenalty()); + } + if (other.getFrequencyPenalty() != 0F) { + setFrequencyPenalty(other.getFrequencyPenalty()); + } + internalGetMutableLogitBias().mergeFrom(other.internalGetLogitBias()); + bitField0_ |= 0x00000200; + if (other.getEcho() != false) { + setEcho(other.getEcho()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + temperature_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 21: + { + topP_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: + { + topK_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 32: + { + candidateCount_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + maxOutputTokens_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureStopSequencesIsMutable(); + stopSequences_.add(s); + break; + } // case 50 + case 56: + { + logprobs_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 69: + { + presencePenalty_ = input.readFloat(); + bitField0_ |= 0x00000080; + break; + } // case 69 + case 77: + { + frequencyPenalty_ = input.readFloat(); + bitField0_ |= 0x00000100; + break; + } // case 77 + case 82: + { + com.google.protobuf.MapEntry logitBias__ = + input.readMessage( + LogitBiasDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLogitBias() + .getMutableMap() + .put(logitBias__.getKey(), logitBias__.getValue()); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 88: + { + echo_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 88 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float temperature_; + /** + * + * + *
+     * Optional. Controls the randomness of predictions.
+     * 
+ * + * float temperature = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The temperature. + */ + @java.lang.Override + public float getTemperature() { + return temperature_; + } + /** + * + * + *
+     * Optional. Controls the randomness of predictions.
+     * 
+ * + * float temperature = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The temperature to set. + * @return This builder for chaining. + */ + public Builder setTemperature(float value) { + + temperature_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Controls the randomness of predictions.
+     * 
+ * + * float temperature = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTemperature() { + bitField0_ = (bitField0_ & ~0x00000001); + temperature_ = 0F; + onChanged(); + return this; + } + + private float topP_; + /** + * + * + *
+     * Optional. If specified, nucleus sampling will be used.
+     * 
+ * + * float top_p = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The topP. + */ + @java.lang.Override + public float getTopP() { + return topP_; + } + /** + * + * + *
+     * Optional. If specified, nucleus sampling will be used.
+     * 
+ * + * float top_p = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The topP to set. + * @return This builder for chaining. + */ + public Builder setTopP(float value) { + + topP_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If specified, nucleus sampling will be used.
+     * 
+ * + * float top_p = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTopP() { + bitField0_ = (bitField0_ & ~0x00000002); + topP_ = 0F; + onChanged(); + return this; + } + + private float topK_; + /** + * + * + *
+     * Optional. If specified, top-k sampling will be used.
+     * 
+ * + * float top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The topK. + */ + @java.lang.Override + public float getTopK() { + return topK_; + } + /** + * + * + *
+     * Optional. If specified, top-k sampling will be used.
+     * 
+ * + * float top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The topK to set. + * @return This builder for chaining. + */ + public Builder setTopK(float value) { + + topK_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If specified, top-k sampling will be used.
+     * 
+ * + * float top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTopK() { + bitField0_ = (bitField0_ & ~0x00000004); + topK_ = 0F; + onChanged(); + return this; + } + + private int candidateCount_; + /** + * + * + *
+     * Optional. Number of candidates to generate.
+     * 
+ * + * int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The candidateCount. + */ + @java.lang.Override + public int getCandidateCount() { + return candidateCount_; + } + /** + * + * + *
+     * Optional. Number of candidates to generate.
+     * 
+ * + * int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The candidateCount to set. + * @return This builder for chaining. + */ + public Builder setCandidateCount(int value) { + + candidateCount_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Number of candidates to generate.
+     * 
+ * + * int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCandidateCount() { + bitField0_ = (bitField0_ & ~0x00000008); + candidateCount_ = 0; + onChanged(); + return this; + } + + private int maxOutputTokens_; + /** + * + * + *
+     * Optional. The maximum number of output tokens to generate per message.
+     * 
+ * + * int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The maxOutputTokens. + */ + @java.lang.Override + public int getMaxOutputTokens() { + return maxOutputTokens_; + } + /** + * + * + *
+     * Optional. The maximum number of output tokens to generate per message.
+     * 
+ * + * int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The maxOutputTokens to set. + * @return This builder for chaining. + */ + public Builder setMaxOutputTokens(int value) { + + maxOutputTokens_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of output tokens to generate per message.
+     * 
+ * + * int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearMaxOutputTokens() { + bitField0_ = (bitField0_ & ~0x00000010); + maxOutputTokens_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList stopSequences_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureStopSequencesIsMutable() { + if (!stopSequences_.isModifiable()) { + stopSequences_ = new com.google.protobuf.LazyStringArrayList(stopSequences_); + } + bitField0_ |= 0x00000020; + } + /** + * + * + *
+     * Optional. Stop sequences.
+     * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the stopSequences. + */ + public com.google.protobuf.ProtocolStringList getStopSequencesList() { + stopSequences_.makeImmutable(); + return stopSequences_; + } + /** + * + * + *
+     * Optional. Stop sequences.
+     * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of stopSequences. + */ + public int getStopSequencesCount() { + return stopSequences_.size(); + } + /** + * + * + *
+     * Optional. Stop sequences.
+     * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The stopSequences at the given index. + */ + public java.lang.String getStopSequences(int index) { + return stopSequences_.get(index); + } + /** + * + * + *
+     * Optional. Stop sequences.
+     * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the stopSequences at the given index. + */ + public com.google.protobuf.ByteString getStopSequencesBytes(int index) { + return stopSequences_.getByteString(index); + } + /** + * + * + *
+     * Optional. Stop sequences.
+     * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The stopSequences to set. + * @return This builder for chaining. + */ + public Builder setStopSequences(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStopSequencesIsMutable(); + stopSequences_.set(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Stop sequences.
+     * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The stopSequences to add. + * @return This builder for chaining. + */ + public Builder addStopSequences(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStopSequencesIsMutable(); + stopSequences_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Stop sequences.
+     * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The stopSequences to add. + * @return This builder for chaining. + */ + public Builder addAllStopSequences(java.lang.Iterable values) { + ensureStopSequencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stopSequences_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Stop sequences.
+     * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearStopSequences() { + stopSequences_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Stop sequences.
+     * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the stopSequences to add. + * @return This builder for chaining. + */ + public Builder addStopSequencesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStopSequencesIsMutable(); + stopSequences_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int logprobs_; + /** + * + * + *
+     * Optional. Logit probabilities.
+     * 
+ * + * int32 logprobs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The logprobs. + */ + @java.lang.Override + public int getLogprobs() { + return logprobs_; + } + /** + * + * + *
+     * Optional. Logit probabilities.
+     * 
+ * + * int32 logprobs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The logprobs to set. + * @return This builder for chaining. + */ + public Builder setLogprobs(int value) { + + logprobs_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Logit probabilities.
+     * 
+ * + * int32 logprobs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLogprobs() { + bitField0_ = (bitField0_ & ~0x00000040); + logprobs_ = 0; + onChanged(); + return this; + } + + private float presencePenalty_; + /** + * + * + *
+     * Optional. Positive penalties.
+     * 
+ * + * float presence_penalty = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The presencePenalty. + */ + @java.lang.Override + public float getPresencePenalty() { + return presencePenalty_; + } + /** + * + * + *
+     * Optional. Positive penalties.
+     * 
+ * + * float presence_penalty = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The presencePenalty to set. + * @return This builder for chaining. + */ + public Builder setPresencePenalty(float value) { + + presencePenalty_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Positive penalties.
+     * 
+ * + * float presence_penalty = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPresencePenalty() { + bitField0_ = (bitField0_ & ~0x00000080); + presencePenalty_ = 0F; + onChanged(); + return this; + } + + private float frequencyPenalty_; + /** + * + * + *
+     * Optional. Frequency penalties.
+     * 
+ * + * float frequency_penalty = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The frequencyPenalty. + */ + @java.lang.Override + public float getFrequencyPenalty() { + return frequencyPenalty_; + } + /** + * + * + *
+     * Optional. Frequency penalties.
+     * 
+ * + * float frequency_penalty = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The frequencyPenalty to set. + * @return This builder for chaining. + */ + public Builder setFrequencyPenalty(float value) { + + frequencyPenalty_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Frequency penalties.
+     * 
+ * + * float frequency_penalty = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFrequencyPenalty() { + bitField0_ = (bitField0_ & ~0x00000100); + frequencyPenalty_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.MapField logitBias_; + + private com.google.protobuf.MapField internalGetLogitBias() { + if (logitBias_ == null) { + return com.google.protobuf.MapField.emptyMapField(LogitBiasDefaultEntryHolder.defaultEntry); + } + return logitBias_; + } + + private com.google.protobuf.MapField + internalGetMutableLogitBias() { + if (logitBias_ == null) { + logitBias_ = + com.google.protobuf.MapField.newMapField(LogitBiasDefaultEntryHolder.defaultEntry); + } + if (!logitBias_.isMutable()) { + logitBias_ = logitBias_.copy(); + } + bitField0_ |= 0x00000200; + onChanged(); + return logitBias_; + } + + public int getLogitBiasCount() { + return internalGetLogitBias().getMap().size(); + } + /** + * + * + *
+     * Optional. Logit bias.
+     * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsLogitBias(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLogitBias().getMap().containsKey(key); + } + /** Use {@link #getLogitBiasMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLogitBias() { + return getLogitBiasMap(); + } + /** + * + * + *
+     * Optional. Logit bias.
+     * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getLogitBiasMap() { + return internalGetLogitBias().getMap(); + } + /** + * + * + *
+     * Optional. Logit bias.
+     * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public float getLogitBiasOrDefault(java.lang.String key, float defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLogitBias().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Logit bias.
+     * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public float getLogitBiasOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLogitBias().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLogitBias() { + bitField0_ = (bitField0_ & ~0x00000200); + internalGetMutableLogitBias().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Logit bias.
+     * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeLogitBias(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLogitBias().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLogitBias() { + bitField0_ |= 0x00000200; + return internalGetMutableLogitBias().getMutableMap(); + } + /** + * + * + *
+     * Optional. Logit bias.
+     * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putLogitBias(java.lang.String key, float value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableLogitBias().getMutableMap().put(key, value); + bitField0_ |= 0x00000200; + return this; + } + /** + * + * + *
+     * Optional. Logit bias.
+     * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllLogitBias(java.util.Map values) { + internalGetMutableLogitBias().getMutableMap().putAll(values); + bitField0_ |= 0x00000200; + return this; + } + + private boolean echo_; + /** + * + * + *
+     * Optional. Echo.
+     * 
+ * + * bool echo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The echo. + */ + @java.lang.Override + public boolean getEcho() { + return echo_; + } + /** + * + * + *
+     * Optional. Echo.
+     * 
+ * + * bool echo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The echo to set. + * @return This builder for chaining. + */ + public Builder setEcho(boolean value) { + + echo_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Echo.
+     * 
+ * + * bool echo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEcho() { + bitField0_ = (bitField0_ & ~0x00000400); + echo_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.GenerationConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.GenerationConfig) + private static final com.google.cloud.vertexai.api.GenerationConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GenerationConfig(); + } + + public static com.google.cloud.vertexai.api.GenerationConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerationConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerationConfigOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerationConfigOrBuilder.java new file mode 100644 index 000000000000..f050fe0a333e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenerationConfigOrBuilder.java @@ -0,0 +1,252 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface GenerationConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.GenerationConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Controls the randomness of predictions.
+   * 
+ * + * float temperature = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The temperature. + */ + float getTemperature(); + + /** + * + * + *
+   * Optional. If specified, nucleus sampling will be used.
+   * 
+ * + * float top_p = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The topP. + */ + float getTopP(); + + /** + * + * + *
+   * Optional. If specified, top-k sampling will be used.
+   * 
+ * + * float top_k = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The topK. + */ + float getTopK(); + + /** + * + * + *
+   * Optional. Number of candidates to generate.
+   * 
+ * + * int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The candidateCount. + */ + int getCandidateCount(); + + /** + * + * + *
+   * Optional. The maximum number of output tokens to generate per message.
+   * 
+ * + * int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The maxOutputTokens. + */ + int getMaxOutputTokens(); + + /** + * + * + *
+   * Optional. Stop sequences.
+   * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the stopSequences. + */ + java.util.List getStopSequencesList(); + /** + * + * + *
+   * Optional. Stop sequences.
+   * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of stopSequences. + */ + int getStopSequencesCount(); + /** + * + * + *
+   * Optional. Stop sequences.
+   * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The stopSequences at the given index. + */ + java.lang.String getStopSequences(int index); + /** + * + * + *
+   * Optional. Stop sequences.
+   * 
+ * + * repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the stopSequences at the given index. + */ + com.google.protobuf.ByteString getStopSequencesBytes(int index); + + /** + * + * + *
+   * Optional. Logit probabilities.
+   * 
+ * + * int32 logprobs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The logprobs. + */ + int getLogprobs(); + + /** + * + * + *
+   * Optional. Positive penalties.
+   * 
+ * + * float presence_penalty = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The presencePenalty. + */ + float getPresencePenalty(); + + /** + * + * + *
+   * Optional. Frequency penalties.
+   * 
+ * + * float frequency_penalty = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The frequencyPenalty. + */ + float getFrequencyPenalty(); + + /** + * + * + *
+   * Optional. Logit bias.
+   * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getLogitBiasCount(); + /** + * + * + *
+   * Optional. Logit bias.
+   * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsLogitBias(java.lang.String key); + /** Use {@link #getLogitBiasMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLogitBias(); + /** + * + * + *
+   * Optional. Logit bias.
+   * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getLogitBiasMap(); + /** + * + * + *
+   * Optional. Logit bias.
+   * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + float getLogitBiasOrDefault(java.lang.String key, float defaultValue); + /** + * + * + *
+   * Optional. Logit bias.
+   * 
+ * + * map<string, float> logit_bias = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + float getLogitBiasOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. Echo.
+   * 
+ * + * bool echo = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The echo. + */ + boolean getEcho(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenericOperationMetadata.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenericOperationMetadata.java new file mode 100644 index 000000000000..17fecc6b757a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenericOperationMetadata.java @@ -0,0 +1,1632 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/operation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Generic Metadata shared by all operations.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenericOperationMetadata} + */ +public final class GenericOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.GenericOperationMetadata) + GenericOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenericOperationMetadata.newBuilder() to construct. + private GenericOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenericOperationMetadata() { + partialFailures_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenericOperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.OperationProto + .internal_static_google_cloud_vertexai_v1beta1_GenericOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.OperationProto + .internal_static_google_cloud_vertexai_v1beta1_GenericOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenericOperationMetadata.class, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder.class); + } + + public static final int PARTIAL_FAILURES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List partialFailures_; + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard Google Cloud error details.
+   * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getPartialFailuresList() { + return partialFailures_; + } + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard Google Cloud error details.
+   * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPartialFailuresOrBuilderList() { + return partialFailures_; + } + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard Google Cloud error details.
+   * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getPartialFailuresCount() { + return partialFailures_.size(); + } + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard Google Cloud error details.
+   * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.rpc.Status getPartialFailures(int index) { + return partialFailures_.get(index); + } + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard Google Cloud error details.
+   * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getPartialFailuresOrBuilder(int index) { + return partialFailures_.get(index); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * If the operation has finished (successfully or not), this is the finish
+   * time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * If the operation has finished (successfully or not), this is the finish
+   * time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * If the operation has finished (successfully or not), this is the finish
+   * time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < partialFailures_.size(); i++) { + output.writeMessage(1, partialFailures_.get(i)); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < partialFailures_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, partialFailures_.get(i)); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GenericOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GenericOperationMetadata other = + (com.google.cloud.vertexai.api.GenericOperationMetadata) obj; + + if (!getPartialFailuresList().equals(other.getPartialFailuresList())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPartialFailuresCount() > 0) { + hash = (37 * hash) + PARTIAL_FAILURES_FIELD_NUMBER; + hash = (53 * hash) + getPartialFailuresList().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.GenericOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Generic Metadata shared by all operations.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GenericOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.GenericOperationMetadata) + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.OperationProto + .internal_static_google_cloud_vertexai_v1beta1_GenericOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.OperationProto + .internal_static_google_cloud_vertexai_v1beta1_GenericOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenericOperationMetadata.class, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GenericOperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (partialFailuresBuilder_ == null) { + partialFailures_ = java.util.Collections.emptyList(); + } else { + partialFailures_ = null; + partialFailuresBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.OperationProto + .internal_static_google_cloud_vertexai_v1beta1_GenericOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadata getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadata build() { + com.google.cloud.vertexai.api.GenericOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadata buildPartial() { + com.google.cloud.vertexai.api.GenericOperationMetadata result = + new com.google.cloud.vertexai.api.GenericOperationMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.GenericOperationMetadata result) { + if (partialFailuresBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + partialFailures_ = java.util.Collections.unmodifiableList(partialFailures_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.partialFailures_ = partialFailures_; + } else { + result.partialFailures_ = partialFailuresBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.GenericOperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GenericOperationMetadata) { + return mergeFrom((com.google.cloud.vertexai.api.GenericOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GenericOperationMetadata other) { + if (other == com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance()) + return this; + if (partialFailuresBuilder_ == null) { + if (!other.partialFailures_.isEmpty()) { + if (partialFailures_.isEmpty()) { + partialFailures_ = other.partialFailures_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePartialFailuresIsMutable(); + partialFailures_.addAll(other.partialFailures_); + } + onChanged(); + } + } else { + if (!other.partialFailures_.isEmpty()) { + if (partialFailuresBuilder_.isEmpty()) { + partialFailuresBuilder_.dispose(); + partialFailuresBuilder_ = null; + partialFailures_ = other.partialFailures_; + bitField0_ = (bitField0_ & ~0x00000001); + partialFailuresBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPartialFailuresFieldBuilder() + : null; + } else { + partialFailuresBuilder_.addAllMessages(other.partialFailures_); + } + } + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.rpc.Status m = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + partialFailures_.add(m); + } else { + partialFailuresBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List partialFailures_ = + java.util.Collections.emptyList(); + + private void ensurePartialFailuresIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + partialFailures_ = new java.util.ArrayList(partialFailures_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + partialFailuresBuilder_; + + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getPartialFailuresList() { + if (partialFailuresBuilder_ == null) { + return java.util.Collections.unmodifiableList(partialFailures_); + } else { + return partialFailuresBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getPartialFailuresCount() { + if (partialFailuresBuilder_ == null) { + return partialFailures_.size(); + } else { + return partialFailuresBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status getPartialFailures(int index) { + if (partialFailuresBuilder_ == null) { + return partialFailures_.get(index); + } else { + return partialFailuresBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPartialFailures(int index, com.google.rpc.Status value) { + if (partialFailuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialFailuresIsMutable(); + partialFailures_.set(index, value); + onChanged(); + } else { + partialFailuresBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPartialFailures(int index, com.google.rpc.Status.Builder builderForValue) { + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + partialFailures_.set(index, builderForValue.build()); + onChanged(); + } else { + partialFailuresBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPartialFailures(com.google.rpc.Status value) { + if (partialFailuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialFailuresIsMutable(); + partialFailures_.add(value); + onChanged(); + } else { + partialFailuresBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPartialFailures(int index, com.google.rpc.Status value) { + if (partialFailuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartialFailuresIsMutable(); + partialFailures_.add(index, value); + onChanged(); + } else { + partialFailuresBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPartialFailures(com.google.rpc.Status.Builder builderForValue) { + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + partialFailures_.add(builderForValue.build()); + onChanged(); + } else { + partialFailuresBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPartialFailures(int index, com.google.rpc.Status.Builder builderForValue) { + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + partialFailures_.add(index, builderForValue.build()); + onChanged(); + } else { + partialFailuresBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllPartialFailures( + java.lang.Iterable values) { + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, partialFailures_); + onChanged(); + } else { + partialFailuresBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPartialFailures() { + if (partialFailuresBuilder_ == null) { + partialFailures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + partialFailuresBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removePartialFailures(int index) { + if (partialFailuresBuilder_ == null) { + ensurePartialFailuresIsMutable(); + partialFailures_.remove(index); + onChanged(); + } else { + partialFailuresBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder getPartialFailuresBuilder(int index) { + return getPartialFailuresFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.StatusOrBuilder getPartialFailuresOrBuilder(int index) { + if (partialFailuresBuilder_ == null) { + return partialFailures_.get(index); + } else { + return partialFailuresBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPartialFailuresOrBuilderList() { + if (partialFailuresBuilder_ != null) { + return partialFailuresBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(partialFailures_); + } + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder addPartialFailuresBuilder() { + return getPartialFailuresFieldBuilder() + .addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder addPartialFailuresBuilder(int index) { + return getPartialFailuresFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Partial failures encountered.
+     * E.g. single files that couldn't be read.
+     * This field should never exceed 20 entries.
+     * Status details field will contain standard Google Cloud error details.
+     * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getPartialFailuresBuilderList() { + return getPartialFailuresFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getPartialFailuresFieldBuilder() { + if (partialFailuresBuilder_ == null) { + partialFailuresBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + partialFailures_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + partialFailures_ = null; + } + return partialFailuresBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Time when the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * If the operation has finished (successfully or not), this is the finish
+     * time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * If the operation has finished (successfully or not), this is the finish
+     * time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * If the operation has finished (successfully or not), this is the finish
+     * time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * If the operation has finished (successfully or not), this is the finish
+     * time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * If the operation has finished (successfully or not), this is the finish
+     * time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * If the operation has finished (successfully or not), this is the finish
+     * time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * If the operation has finished (successfully or not), this is the finish
+     * time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * If the operation has finished (successfully or not), this is the finish
+     * time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Time when the operation was updated for the last time.
+     * If the operation has finished (successfully or not), this is the finish
+     * time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.GenericOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.GenericOperationMetadata) + private static final com.google.cloud.vertexai.api.GenericOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GenericOperationMetadata(); + } + + public static com.google.cloud.vertexai.api.GenericOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenericOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenericOperationMetadataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenericOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..fd1fb57a08b8 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GenericOperationMetadataOrBuilder.java @@ -0,0 +1,183 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/operation.proto + +package com.google.cloud.vertexai.api; + +public interface GenericOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.GenericOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard Google Cloud error details.
+   * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getPartialFailuresList(); + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard Google Cloud error details.
+   * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.rpc.Status getPartialFailures(int index); + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard Google Cloud error details.
+   * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getPartialFailuresCount(); + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard Google Cloud error details.
+   * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getPartialFailuresOrBuilderList(); + /** + * + * + *
+   * Output only. Partial failures encountered.
+   * E.g. single files that couldn't be read.
+   * This field should never exceed 20 entries.
+   * Status details field will contain standard Google Cloud error details.
+   * 
+ * + * + * repeated .google.rpc.Status partial_failures = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.rpc.StatusOrBuilder getPartialFailuresOrBuilder(int index); + + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time when the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * If the operation has finished (successfully or not), this is the finish
+   * time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * If the operation has finished (successfully or not), this is the finish
+   * time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Time when the operation was updated for the last time.
+   * If the operation has finished (successfully or not), this is the finish
+   * time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GetEndpointRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GetEndpointRequest.java new file mode 100644 index 000000000000..256dc7c2bc06 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GetEndpointRequest.java @@ -0,0 +1,654 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [EndpointService.GetEndpoint][google.cloud.vertexai.v1beta1.EndpointService.GetEndpoint]
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GetEndpointRequest} + */ +public final class GetEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.GetEndpointRequest) + GetEndpointRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetEndpointRequest.newBuilder() to construct. + private GetEndpointRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetEndpointRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetEndpointRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GetEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GetEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GetEndpointRequest.class, + com.google.cloud.vertexai.api.GetEndpointRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint resource.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint resource.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GetEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GetEndpointRequest other = + (com.google.cloud.vertexai.api.GetEndpointRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.GetEndpointRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EndpointService.GetEndpoint][google.cloud.vertexai.v1beta1.EndpointService.GetEndpoint]
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.GetEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.GetEndpointRequest) + com.google.cloud.vertexai.api.GetEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GetEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GetEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GetEndpointRequest.class, + com.google.cloud.vertexai.api.GetEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GetEndpointRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_GetEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GetEndpointRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GetEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GetEndpointRequest build() { + com.google.cloud.vertexai.api.GetEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GetEndpointRequest buildPartial() { + com.google.cloud.vertexai.api.GetEndpointRequest result = + new com.google.cloud.vertexai.api.GetEndpointRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.GetEndpointRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GetEndpointRequest) { + return mergeFrom((com.google.cloud.vertexai.api.GetEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GetEndpointRequest other) { + if (other == com.google.cloud.vertexai.api.GetEndpointRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint resource.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint resource.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint resource.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint resource.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint resource.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.GetEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.GetEndpointRequest) + private static final com.google.cloud.vertexai.api.GetEndpointRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GetEndpointRequest(); + } + + public static com.google.cloud.vertexai.api.GetEndpointRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetEndpointRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GetEndpointRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GetEndpointRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GetEndpointRequestOrBuilder.java new file mode 100644 index 000000000000..1c3bb5f24d46 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/GetEndpointRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface GetEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.GetEndpointRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint resource.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Endpoint resource.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/HarmCategory.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/HarmCategory.java new file mode 100644 index 000000000000..0d96d32fa2c1 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/HarmCategory.java @@ -0,0 +1,220 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Harm categories that will block the content.
+ * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.HarmCategory} + */ +public enum HarmCategory implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The harm category is unspecified.
+   * 
+ * + * HARM_CATEGORY_UNSPECIFIED = 0; + */ + HARM_CATEGORY_UNSPECIFIED(0), + /** + * + * + *
+   * The harm category is hate speech.
+   * 
+ * + * HARM_CATEGORY_HATE_SPEECH = 1; + */ + HARM_CATEGORY_HATE_SPEECH(1), + /** + * + * + *
+   * The harm category is dangerous content.
+   * 
+ * + * HARM_CATEGORY_DANGEROUS_CONTENT = 2; + */ + HARM_CATEGORY_DANGEROUS_CONTENT(2), + /** + * + * + *
+   * The harm category is harassment.
+   * 
+ * + * HARM_CATEGORY_HARASSMENT = 3; + */ + HARM_CATEGORY_HARASSMENT(3), + /** + * + * + *
+   * The harm category is sexually explicit content.
+   * 
+ * + * HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; + */ + HARM_CATEGORY_SEXUALLY_EXPLICIT(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The harm category is unspecified.
+   * 
+ * + * HARM_CATEGORY_UNSPECIFIED = 0; + */ + public static final int HARM_CATEGORY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The harm category is hate speech.
+   * 
+ * + * HARM_CATEGORY_HATE_SPEECH = 1; + */ + public static final int HARM_CATEGORY_HATE_SPEECH_VALUE = 1; + /** + * + * + *
+   * The harm category is dangerous content.
+   * 
+ * + * HARM_CATEGORY_DANGEROUS_CONTENT = 2; + */ + public static final int HARM_CATEGORY_DANGEROUS_CONTENT_VALUE = 2; + /** + * + * + *
+   * The harm category is harassment.
+   * 
+ * + * HARM_CATEGORY_HARASSMENT = 3; + */ + public static final int HARM_CATEGORY_HARASSMENT_VALUE = 3; + /** + * + * + *
+   * The harm category is sexually explicit content.
+   * 
+ * + * HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; + */ + public static final int HARM_CATEGORY_SEXUALLY_EXPLICIT_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static HarmCategory valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static HarmCategory forNumber(int value) { + switch (value) { + case 0: + return HARM_CATEGORY_UNSPECIFIED; + case 1: + return HARM_CATEGORY_HATE_SPEECH; + case 2: + return HARM_CATEGORY_DANGEROUS_CONTENT; + case 3: + return HARM_CATEGORY_HARASSMENT; + case 4: + return HARM_CATEGORY_SEXUALLY_EXPLICIT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public HarmCategory findValueByNumber(int number) { + return HarmCategory.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto.getDescriptor().getEnumTypes().get(0); + } + + private static final HarmCategory[] VALUES = values(); + + public static HarmCategory valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private HarmCategory(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.HarmCategory) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Int64Array.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Int64Array.java new file mode 100644 index 000000000000..01882d3b166f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Int64Array.java @@ -0,0 +1,683 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A list of int64 values.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Int64Array} + */ +public final class Int64Array extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Int64Array) + Int64ArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use Int64Array.newBuilder() to construct. + private Int64Array(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Int64Array() { + values_ = emptyLongList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Int64Array(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Int64Array_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Int64Array_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Int64Array.class, + com.google.cloud.vertexai.api.Int64Array.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList values_; + /** + * + * + *
+   * A list of int64 values.
+   * 
+ * + * repeated int64 values = 1; + * + * @return A list containing the values. + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * A list of int64 values.
+   * 
+ * + * repeated int64 values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * A list of int64 values.
+   * 
+ * + * repeated int64 values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public long getValues(int index) { + return values_.getLong(index); + } + + private int valuesMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (getValuesList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valuesMemoizedSerializedSize); + } + for (int i = 0; i < values_.size(); i++) { + output.writeInt64NoTag(values_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < values_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(values_.getLong(i)); + } + size += dataSize; + if (!getValuesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + valuesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Int64Array)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Int64Array other = (com.google.cloud.vertexai.api.Int64Array) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Int64Array parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Int64Array parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Int64Array parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Int64Array parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Int64Array parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Int64Array parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Int64Array parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Int64Array parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Int64Array parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Int64Array parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Int64Array parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Int64Array parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Int64Array prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A list of int64 values.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Int64Array} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Int64Array) + com.google.cloud.vertexai.api.Int64ArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Int64Array_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Int64Array_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Int64Array.class, + com.google.cloud.vertexai.api.Int64Array.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Int64Array.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + values_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Int64Array_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Int64Array getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Int64Array.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Int64Array build() { + com.google.cloud.vertexai.api.Int64Array result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Int64Array buildPartial() { + com.google.cloud.vertexai.api.Int64Array result = + new com.google.cloud.vertexai.api.Int64Array(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.Int64Array result) { + if (((bitField0_ & 0x00000001) != 0)) { + values_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Int64Array result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Int64Array) { + return mergeFrom((com.google.cloud.vertexai.api.Int64Array) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Int64Array other) { + if (other == com.google.cloud.vertexai.api.Int64Array.getDefaultInstance()) return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + long v = input.readInt64(); + ensureValuesIsMutable(); + values_.addLong(v); + break; + } // case 8 + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValuesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + values_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.LongList values_ = emptyLongList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = mutableCopy(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A list of int64 values.
+     * 
+ * + * repeated int64 values = 1; + * + * @return A list containing the values. + */ + public java.util.List getValuesList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(values_) + : values_; + } + /** + * + * + *
+     * A list of int64 values.
+     * 
+ * + * repeated int64 values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * A list of int64 values.
+     * 
+ * + * repeated int64 values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public long getValues(int index) { + return values_.getLong(index); + } + /** + * + * + *
+     * A list of int64 values.
+     * 
+ * + * repeated int64 values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, long value) { + + ensureValuesIsMutable(); + values_.setLong(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of int64 values.
+     * 
+ * + * repeated int64 values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(long value) { + + ensureValuesIsMutable(); + values_.addLong(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of int64 values.
+     * 
+ * + * repeated int64 values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of int64 values.
+     * 
+ * + * repeated int64 values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Int64Array) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Int64Array) + private static final com.google.cloud.vertexai.api.Int64Array DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Int64Array(); + } + + public static com.google.cloud.vertexai.api.Int64Array getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Int64Array parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Int64Array getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Int64ArrayOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Int64ArrayOrBuilder.java new file mode 100644 index 000000000000..ff85eba148ba --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Int64ArrayOrBuilder.java @@ -0,0 +1,63 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +public interface Int64ArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Int64Array) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of int64 values.
+   * 
+ * + * repeated int64 values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * A list of int64 values.
+   * 
+ * + * repeated int64 values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * A list of int64 values.
+   * 
+ * + * repeated int64 values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + long getValues(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/IntegratedGradientsAttribution.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/IntegratedGradientsAttribution.java new file mode 100644 index 000000000000..0940bfae8939 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/IntegratedGradientsAttribution.java @@ -0,0 +1,1220 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * An attribution method that computes the Aumann-Shapley value taking advantage
+ * of the model's fully differentiable structure. Refer to this paper for
+ * more details: https://arxiv.org/abs/1703.01365
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution} + */ +public final class IntegratedGradientsAttribution extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution) + IntegratedGradientsAttributionOrBuilder { + private static final long serialVersionUID = 0L; + // Use IntegratedGradientsAttribution.newBuilder() to construct. + private IntegratedGradientsAttribution( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IntegratedGradientsAttribution() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IntegratedGradientsAttribution(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_IntegratedGradientsAttribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_IntegratedGradientsAttribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.IntegratedGradientsAttribution.class, + com.google.cloud.vertexai.api.IntegratedGradientsAttribution.Builder.class); + } + + public static final int STEP_COUNT_FIELD_NUMBER = 1; + private int stepCount_ = 0; + /** + * + * + *
+   * Required. The number of steps for approximating the path integral.
+   * A good value to start is 50 and gradually increase until the
+   * sum to diff property is within the desired error range.
+   *
+   * Valid range of its value is [1, 100], inclusively.
+   * 
+ * + * int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The stepCount. + */ + @java.lang.Override + public int getStepCount() { + return stepCount_; + } + + public static final int SMOOTH_GRAD_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.SmoothGradConfig smoothGradConfig_; + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return Whether the smoothGradConfig field is set. + */ + @java.lang.Override + public boolean hasSmoothGradConfig() { + return smoothGradConfig_ != null; + } + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return The smoothGradConfig. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SmoothGradConfig getSmoothGradConfig() { + return smoothGradConfig_ == null + ? com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance() + : smoothGradConfig_; + } + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder getSmoothGradConfigOrBuilder() { + return smoothGradConfig_ == null + ? com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance() + : smoothGradConfig_; + } + + public static final int BLUR_BASELINE_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.vertexai.api.BlurBaselineConfig blurBaselineConfig_; + /** + * + * + *
+   * Config for IG with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return Whether the blurBaselineConfig field is set. + */ + @java.lang.Override + public boolean hasBlurBaselineConfig() { + return blurBaselineConfig_ != null; + } + /** + * + * + *
+   * Config for IG with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return The blurBaselineConfig. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.BlurBaselineConfig getBlurBaselineConfig() { + return blurBaselineConfig_ == null + ? com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance() + : blurBaselineConfig_; + } + /** + * + * + *
+   * Config for IG with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder + getBlurBaselineConfigOrBuilder() { + return blurBaselineConfig_ == null + ? com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance() + : blurBaselineConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (stepCount_ != 0) { + output.writeInt32(1, stepCount_); + } + if (smoothGradConfig_ != null) { + output.writeMessage(2, getSmoothGradConfig()); + } + if (blurBaselineConfig_ != null) { + output.writeMessage(3, getBlurBaselineConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (stepCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, stepCount_); + } + if (smoothGradConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSmoothGradConfig()); + } + if (blurBaselineConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBlurBaselineConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.IntegratedGradientsAttribution)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.IntegratedGradientsAttribution other = + (com.google.cloud.vertexai.api.IntegratedGradientsAttribution) obj; + + if (getStepCount() != other.getStepCount()) return false; + if (hasSmoothGradConfig() != other.hasSmoothGradConfig()) return false; + if (hasSmoothGradConfig()) { + if (!getSmoothGradConfig().equals(other.getSmoothGradConfig())) return false; + } + if (hasBlurBaselineConfig() != other.hasBlurBaselineConfig()) return false; + if (hasBlurBaselineConfig()) { + if (!getBlurBaselineConfig().equals(other.getBlurBaselineConfig())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STEP_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getStepCount(); + if (hasSmoothGradConfig()) { + hash = (37 * hash) + SMOOTH_GRAD_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSmoothGradConfig().hashCode(); + } + if (hasBlurBaselineConfig()) { + hash = (37 * hash) + BLUR_BASELINE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getBlurBaselineConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.IntegratedGradientsAttribution prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An attribution method that computes the Aumann-Shapley value taking advantage
+   * of the model's fully differentiable structure. Refer to this paper for
+   * more details: https://arxiv.org/abs/1703.01365
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution) + com.google.cloud.vertexai.api.IntegratedGradientsAttributionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_IntegratedGradientsAttribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_IntegratedGradientsAttribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.IntegratedGradientsAttribution.class, + com.google.cloud.vertexai.api.IntegratedGradientsAttribution.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.IntegratedGradientsAttribution.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + stepCount_ = 0; + smoothGradConfig_ = null; + if (smoothGradConfigBuilder_ != null) { + smoothGradConfigBuilder_.dispose(); + smoothGradConfigBuilder_ = null; + } + blurBaselineConfig_ = null; + if (blurBaselineConfigBuilder_ != null) { + blurBaselineConfigBuilder_.dispose(); + blurBaselineConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_IntegratedGradientsAttribution_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.IntegratedGradientsAttribution + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.IntegratedGradientsAttribution.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.IntegratedGradientsAttribution build() { + com.google.cloud.vertexai.api.IntegratedGradientsAttribution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.IntegratedGradientsAttribution buildPartial() { + com.google.cloud.vertexai.api.IntegratedGradientsAttribution result = + new com.google.cloud.vertexai.api.IntegratedGradientsAttribution(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.IntegratedGradientsAttribution result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.stepCount_ = stepCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.smoothGradConfig_ = + smoothGradConfigBuilder_ == null ? smoothGradConfig_ : smoothGradConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.blurBaselineConfig_ = + blurBaselineConfigBuilder_ == null + ? blurBaselineConfig_ + : blurBaselineConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.IntegratedGradientsAttribution) { + return mergeFrom((com.google.cloud.vertexai.api.IntegratedGradientsAttribution) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.IntegratedGradientsAttribution other) { + if (other + == com.google.cloud.vertexai.api.IntegratedGradientsAttribution.getDefaultInstance()) + return this; + if (other.getStepCount() != 0) { + setStepCount(other.getStepCount()); + } + if (other.hasSmoothGradConfig()) { + mergeSmoothGradConfig(other.getSmoothGradConfig()); + } + if (other.hasBlurBaselineConfig()) { + mergeBlurBaselineConfig(other.getBlurBaselineConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + stepCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + getSmoothGradConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getBlurBaselineConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int stepCount_; + /** + * + * + *
+     * Required. The number of steps for approximating the path integral.
+     * A good value to start is 50 and gradually increase until the
+     * sum to diff property is within the desired error range.
+     *
+     * Valid range of its value is [1, 100], inclusively.
+     * 
+ * + * int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The stepCount. + */ + @java.lang.Override + public int getStepCount() { + return stepCount_; + } + /** + * + * + *
+     * Required. The number of steps for approximating the path integral.
+     * A good value to start is 50 and gradually increase until the
+     * sum to diff property is within the desired error range.
+     *
+     * Valid range of its value is [1, 100], inclusively.
+     * 
+ * + * int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The stepCount to set. + * @return This builder for chaining. + */ + public Builder setStepCount(int value) { + + stepCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The number of steps for approximating the path integral.
+     * A good value to start is 50 and gradually increase until the
+     * sum to diff property is within the desired error range.
+     *
+     * Valid range of its value is [1, 100], inclusively.
+     * 
+ * + * int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearStepCount() { + bitField0_ = (bitField0_ & ~0x00000001); + stepCount_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.SmoothGradConfig smoothGradConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.SmoothGradConfig, + com.google.cloud.vertexai.api.SmoothGradConfig.Builder, + com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder> + smoothGradConfigBuilder_; + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return Whether the smoothGradConfig field is set. + */ + public boolean hasSmoothGradConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return The smoothGradConfig. + */ + public com.google.cloud.vertexai.api.SmoothGradConfig getSmoothGradConfig() { + if (smoothGradConfigBuilder_ == null) { + return smoothGradConfig_ == null + ? com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance() + : smoothGradConfig_; + } else { + return smoothGradConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public Builder setSmoothGradConfig(com.google.cloud.vertexai.api.SmoothGradConfig value) { + if (smoothGradConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + smoothGradConfig_ = value; + } else { + smoothGradConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public Builder setSmoothGradConfig( + com.google.cloud.vertexai.api.SmoothGradConfig.Builder builderForValue) { + if (smoothGradConfigBuilder_ == null) { + smoothGradConfig_ = builderForValue.build(); + } else { + smoothGradConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public Builder mergeSmoothGradConfig(com.google.cloud.vertexai.api.SmoothGradConfig value) { + if (smoothGradConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && smoothGradConfig_ != null + && smoothGradConfig_ + != com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance()) { + getSmoothGradConfigBuilder().mergeFrom(value); + } else { + smoothGradConfig_ = value; + } + } else { + smoothGradConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public Builder clearSmoothGradConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + smoothGradConfig_ = null; + if (smoothGradConfigBuilder_ != null) { + smoothGradConfigBuilder_.dispose(); + smoothGradConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public com.google.cloud.vertexai.api.SmoothGradConfig.Builder getSmoothGradConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSmoothGradConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder getSmoothGradConfigOrBuilder() { + if (smoothGradConfigBuilder_ != null) { + return smoothGradConfigBuilder_.getMessageOrBuilder(); + } else { + return smoothGradConfig_ == null + ? com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance() + : smoothGradConfig_; + } + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.SmoothGradConfig, + com.google.cloud.vertexai.api.SmoothGradConfig.Builder, + com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder> + getSmoothGradConfigFieldBuilder() { + if (smoothGradConfigBuilder_ == null) { + smoothGradConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.SmoothGradConfig, + com.google.cloud.vertexai.api.SmoothGradConfig.Builder, + com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder>( + getSmoothGradConfig(), getParentForChildren(), isClean()); + smoothGradConfig_ = null; + } + return smoothGradConfigBuilder_; + } + + private com.google.cloud.vertexai.api.BlurBaselineConfig blurBaselineConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.BlurBaselineConfig, + com.google.cloud.vertexai.api.BlurBaselineConfig.Builder, + com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder> + blurBaselineConfigBuilder_; + /** + * + * + *
+     * Config for IG with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return Whether the blurBaselineConfig field is set. + */ + public boolean hasBlurBaselineConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Config for IG with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return The blurBaselineConfig. + */ + public com.google.cloud.vertexai.api.BlurBaselineConfig getBlurBaselineConfig() { + if (blurBaselineConfigBuilder_ == null) { + return blurBaselineConfig_ == null + ? com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance() + : blurBaselineConfig_; + } else { + return blurBaselineConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Config for IG with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public Builder setBlurBaselineConfig(com.google.cloud.vertexai.api.BlurBaselineConfig value) { + if (blurBaselineConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurBaselineConfig_ = value; + } else { + blurBaselineConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for IG with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public Builder setBlurBaselineConfig( + com.google.cloud.vertexai.api.BlurBaselineConfig.Builder builderForValue) { + if (blurBaselineConfigBuilder_ == null) { + blurBaselineConfig_ = builderForValue.build(); + } else { + blurBaselineConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for IG with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public Builder mergeBlurBaselineConfig(com.google.cloud.vertexai.api.BlurBaselineConfig value) { + if (blurBaselineConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && blurBaselineConfig_ != null + && blurBaselineConfig_ + != com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance()) { + getBlurBaselineConfigBuilder().mergeFrom(value); + } else { + blurBaselineConfig_ = value; + } + } else { + blurBaselineConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for IG with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public Builder clearBlurBaselineConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + blurBaselineConfig_ = null; + if (blurBaselineConfigBuilder_ != null) { + blurBaselineConfigBuilder_.dispose(); + blurBaselineConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Config for IG with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public com.google.cloud.vertexai.api.BlurBaselineConfig.Builder getBlurBaselineConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBlurBaselineConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Config for IG with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder + getBlurBaselineConfigOrBuilder() { + if (blurBaselineConfigBuilder_ != null) { + return blurBaselineConfigBuilder_.getMessageOrBuilder(); + } else { + return blurBaselineConfig_ == null + ? com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance() + : blurBaselineConfig_; + } + } + /** + * + * + *
+     * Config for IG with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.BlurBaselineConfig, + com.google.cloud.vertexai.api.BlurBaselineConfig.Builder, + com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder> + getBlurBaselineConfigFieldBuilder() { + if (blurBaselineConfigBuilder_ == null) { + blurBaselineConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.BlurBaselineConfig, + com.google.cloud.vertexai.api.BlurBaselineConfig.Builder, + com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder>( + getBlurBaselineConfig(), getParentForChildren(), isClean()); + blurBaselineConfig_ = null; + } + return blurBaselineConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution) + private static final com.google.cloud.vertexai.api.IntegratedGradientsAttribution + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.IntegratedGradientsAttribution(); + } + + public static com.google.cloud.vertexai.api.IntegratedGradientsAttribution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IntegratedGradientsAttribution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.IntegratedGradientsAttribution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/IntegratedGradientsAttributionOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/IntegratedGradientsAttributionOrBuilder.java new file mode 100644 index 000000000000..028b52b3915e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/IntegratedGradientsAttributionOrBuilder.java @@ -0,0 +1,142 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface IntegratedGradientsAttributionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The number of steps for approximating the path integral.
+   * A good value to start is 50 and gradually increase until the
+   * sum to diff property is within the desired error range.
+   *
+   * Valid range of its value is [1, 100], inclusively.
+   * 
+ * + * int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The stepCount. + */ + int getStepCount(); + + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return Whether the smoothGradConfig field is set. + */ + boolean hasSmoothGradConfig(); + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return The smoothGradConfig. + */ + com.google.cloud.vertexai.api.SmoothGradConfig getSmoothGradConfig(); + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder getSmoothGradConfigOrBuilder(); + + /** + * + * + *
+   * Config for IG with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return Whether the blurBaselineConfig field is set. + */ + boolean hasBlurBaselineConfig(); + /** + * + * + *
+   * Config for IG with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return The blurBaselineConfig. + */ + com.google.cloud.vertexai.api.BlurBaselineConfig getBlurBaselineConfig(); + /** + * + * + *
+   * Config for IG with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder getBlurBaselineConfigOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/IoProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/IoProto.java new file mode 100644 index 000000000000..3e4c24e1a537 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/IoProto.java @@ -0,0 +1,186 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +public final class IoProto { + private IoProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_AvroSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_AvroSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_CsvSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_CsvSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_GcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_GcsDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_GcsDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_BigQuerySource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_BigQuerySource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_BigQueryDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_BigQueryDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_CsvDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_CsvDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_TFRecordDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_TFRecordDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ContainerRegistryDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ContainerRegistryDestination_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n&google/cloud/vertexai/v1beta1/io.proto" + + "\022\035google.cloud.vertexai.v1beta1\032\037google/" + + "api/field_behavior.proto\"P\n\nAvroSource\022B" + + "\n\ngcs_source\030\001 \001(\0132(.google.cloud.vertex" + + "ai.v1beta1.GcsSourceB\004\342A\001\002\"O\n\tCsvSource\022" + + "B\n\ngcs_source\030\001 \001(\0132(.google.cloud.verte" + + "xai.v1beta1.GcsSourceB\004\342A\001\002\"\037\n\tGcsSource" + + "\022\022\n\004uris\030\001 \003(\tB\004\342A\001\002\"1\n\016GcsDestination\022\037" + + "\n\021output_uri_prefix\030\001 \001(\tB\004\342A\001\002\")\n\016BigQu" + + "erySource\022\027\n\tinput_uri\030\001 \001(\tB\004\342A\001\002\"/\n\023Bi" + + "gQueryDestination\022\030\n\noutput_uri\030\001 \001(\tB\004\342" + + "A\001\002\"^\n\016CsvDestination\022L\n\017gcs_destination" + + "\030\001 \001(\0132-.google.cloud.vertexai.v1beta1.G" + + "csDestinationB\004\342A\001\002\"c\n\023TFRecordDestinati" + + "on\022L\n\017gcs_destination\030\001 \001(\0132-.google.clo" + + "ud.vertexai.v1beta1.GcsDestinationB\004\342A\001\002" + + "\"8\n\034ContainerRegistryDestination\022\030\n\noutp" + + "ut_uri\030\001 \001(\tB\004\342A\001\002B\314\001\n\035com.google.cloud." + + "vertexai.apiB\007IoProtoP\001Z=cloud.google.co" + + "m/go/vertexai/apiv1beta1/vertexaipb;vert" + + "exaipb\252\002\035Google.Cloud.VertexAI.V1Beta1\312\002" + + "\035Google\\Cloud\\VertexAI\\V1beta1\352\002 Google:" + + ":Cloud::VertexAI::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_AvroSource_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_AvroSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_AvroSource_descriptor, + new java.lang.String[] { + "GcsSource", + }); + internal_static_google_cloud_vertexai_v1beta1_CsvSource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vertexai_v1beta1_CsvSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_CsvSource_descriptor, + new java.lang.String[] { + "GcsSource", + }); + internal_static_google_cloud_vertexai_v1beta1_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vertexai_v1beta1_GcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_GcsSource_descriptor, + new java.lang.String[] { + "Uris", + }); + internal_static_google_cloud_vertexai_v1beta1_GcsDestination_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vertexai_v1beta1_GcsDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_GcsDestination_descriptor, + new java.lang.String[] { + "OutputUriPrefix", + }); + internal_static_google_cloud_vertexai_v1beta1_BigQuerySource_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vertexai_v1beta1_BigQuerySource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_BigQuerySource_descriptor, + new java.lang.String[] { + "InputUri", + }); + internal_static_google_cloud_vertexai_v1beta1_BigQueryDestination_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vertexai_v1beta1_BigQueryDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_BigQueryDestination_descriptor, + new java.lang.String[] { + "OutputUri", + }); + internal_static_google_cloud_vertexai_v1beta1_CsvDestination_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_vertexai_v1beta1_CsvDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_CsvDestination_descriptor, + new java.lang.String[] { + "GcsDestination", + }); + internal_static_google_cloud_vertexai_v1beta1_TFRecordDestination_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_vertexai_v1beta1_TFRecordDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_TFRecordDestination_descriptor, + new java.lang.String[] { + "GcsDestination", + }); + internal_static_google_cloud_vertexai_v1beta1_ContainerRegistryDestination_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_vertexai_v1beta1_ContainerRegistryDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ContainerRegistryDestination_descriptor, + new java.lang.String[] { + "OutputUri", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsRequest.java new file mode 100644 index 000000000000..38f810539676 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsRequest.java @@ -0,0 +1,1512 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ListEndpointsRequest} + */ +public final class ListEndpointsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ListEndpointsRequest) + ListEndpointsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEndpointsRequest.newBuilder() to construct. + private ListEndpointsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEndpointsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEndpointsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ListEndpointsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ListEndpointsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ListEndpointsRequest.class, + com.google.cloud.vertexai.api.ListEndpointsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The resource name of the Location from which to list the
+   * Endpoints. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Location from which to list the
+   * Endpoints. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. An expression for filtering the results of the request. For field
+   * names both snake_case and camelCase are supported.
+   *
+   *   * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
+   *     i.e. the last segment of the Endpoint's [resource
+   *     name][google.cloud.vertexai.v1beta1.Endpoint.name].
+   *   * `display_name` supports = and, !=
+   *   * `labels` supports general map functions that is:
+   *     * `labels.key=value` - key:value equality
+   *     * `labels.key:* or labels:key - key existence
+   *     * A key including a space must be quoted. `labels."a key"`.
+   *
+   * Some examples:
+   *   * `endpoint=1`
+   *   * `displayName="myDisplayName"`
+   *   * `labels.myKey="myValue"`
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An expression for filtering the results of the request. For field
+   * names both snake_case and camelCase are supported.
+   *
+   *   * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
+   *     i.e. the last segment of the Endpoint's [resource
+   *     name][google.cloud.vertexai.v1beta1.Endpoint.name].
+   *   * `display_name` supports = and, !=
+   *   * `labels` supports general map functions that is:
+   *     * `labels.key=value` - key:value equality
+   *     * `labels.key:* or labels:key - key existence
+   *     * A key including a space must be quoted. `labels."a key"`.
+   *
+   * Some examples:
+   *   * `endpoint=1`
+   *   * `displayName="myDisplayName"`
+   *   * `labels.myKey="myValue"`
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The standard list page size.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. The standard list page token.
+   * Typically obtained via
+   * [ListEndpointsResponse.next_page_token][google.cloud.vertexai.v1beta1.ListEndpointsResponse.next_page_token]
+   * of the previous
+   * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]
+   * call.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The standard list page token.
+   * Typically obtained via
+   * [ListEndpointsResponse.next_page_token][google.cloud.vertexai.v1beta1.ListEndpointsResponse.next_page_token]
+   * of the previous
+   * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]
+   * call.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_MASK_FIELD_NUMBER = 5; + private com.google.protobuf.FieldMask readMask_; + /** + * + * + *
+   * Optional. Mask specifying which fields to read.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readMask field is set. + */ + @java.lang.Override + public boolean hasReadMask() { + return readMask_ != null; + } + /** + * + * + *
+   * Optional. Mask specifying which fields to read.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getReadMask() { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + /** + * + * + *
+   * Optional. Mask specifying which fields to read.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + if (readMask_ != null) { + output.writeMessage(5, getReadMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + if (readMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getReadMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ListEndpointsRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ListEndpointsRequest other = + (com.google.cloud.vertexai.api.ListEndpointsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (hasReadMask() != other.hasReadMask()) return false; + if (hasReadMask()) { + if (!getReadMask().equals(other.getReadMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + if (hasReadMask()) { + hash = (37 * hash) + READ_MASK_FIELD_NUMBER; + hash = (53 * hash) + getReadMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ListEndpointsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ListEndpointsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ListEndpointsRequest) + com.google.cloud.vertexai.api.ListEndpointsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ListEndpointsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ListEndpointsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ListEndpointsRequest.class, + com.google.cloud.vertexai.api.ListEndpointsRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ListEndpointsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + readMask_ = null; + if (readMaskBuilder_ != null) { + readMaskBuilder_.dispose(); + readMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ListEndpointsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ListEndpointsRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ListEndpointsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ListEndpointsRequest build() { + com.google.cloud.vertexai.api.ListEndpointsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ListEndpointsRequest buildPartial() { + com.google.cloud.vertexai.api.ListEndpointsRequest result = + new com.google.cloud.vertexai.api.ListEndpointsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.ListEndpointsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.readMask_ = readMaskBuilder_ == null ? readMask_ : readMaskBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ListEndpointsRequest) { + return mergeFrom((com.google.cloud.vertexai.api.ListEndpointsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ListEndpointsRequest other) { + if (other == com.google.cloud.vertexai.api.ListEndpointsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasReadMask()) { + mergeReadMask(other.getReadMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getReadMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the Location from which to list the
+     * Endpoints. Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Location from which to list the
+     * Endpoints. Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Location from which to list the
+     * Endpoints. Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Location from which to list the
+     * Endpoints. Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Location from which to list the
+     * Endpoints. Format: `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. An expression for filtering the results of the request. For field
+     * names both snake_case and camelCase are supported.
+     *
+     *   * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
+     *     i.e. the last segment of the Endpoint's [resource
+     *     name][google.cloud.vertexai.v1beta1.Endpoint.name].
+     *   * `display_name` supports = and, !=
+     *   * `labels` supports general map functions that is:
+     *     * `labels.key=value` - key:value equality
+     *     * `labels.key:* or labels:key - key existence
+     *     * A key including a space must be quoted. `labels."a key"`.
+     *
+     * Some examples:
+     *   * `endpoint=1`
+     *   * `displayName="myDisplayName"`
+     *   * `labels.myKey="myValue"`
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An expression for filtering the results of the request. For field
+     * names both snake_case and camelCase are supported.
+     *
+     *   * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
+     *     i.e. the last segment of the Endpoint's [resource
+     *     name][google.cloud.vertexai.v1beta1.Endpoint.name].
+     *   * `display_name` supports = and, !=
+     *   * `labels` supports general map functions that is:
+     *     * `labels.key=value` - key:value equality
+     *     * `labels.key:* or labels:key - key existence
+     *     * A key including a space must be quoted. `labels."a key"`.
+     *
+     * Some examples:
+     *   * `endpoint=1`
+     *   * `displayName="myDisplayName"`
+     *   * `labels.myKey="myValue"`
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An expression for filtering the results of the request. For field
+     * names both snake_case and camelCase are supported.
+     *
+     *   * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
+     *     i.e. the last segment of the Endpoint's [resource
+     *     name][google.cloud.vertexai.v1beta1.Endpoint.name].
+     *   * `display_name` supports = and, !=
+     *   * `labels` supports general map functions that is:
+     *     * `labels.key=value` - key:value equality
+     *     * `labels.key:* or labels:key - key existence
+     *     * A key including a space must be quoted. `labels."a key"`.
+     *
+     * Some examples:
+     *   * `endpoint=1`
+     *   * `displayName="myDisplayName"`
+     *   * `labels.myKey="myValue"`
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression for filtering the results of the request. For field
+     * names both snake_case and camelCase are supported.
+     *
+     *   * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
+     *     i.e. the last segment of the Endpoint's [resource
+     *     name][google.cloud.vertexai.v1beta1.Endpoint.name].
+     *   * `display_name` supports = and, !=
+     *   * `labels` supports general map functions that is:
+     *     * `labels.key=value` - key:value equality
+     *     * `labels.key:* or labels:key - key existence
+     *     * A key including a space must be quoted. `labels."a key"`.
+     *
+     * Some examples:
+     *   * `endpoint=1`
+     *   * `displayName="myDisplayName"`
+     *   * `labels.myKey="myValue"`
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An expression for filtering the results of the request. For field
+     * names both snake_case and camelCase are supported.
+     *
+     *   * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
+     *     i.e. the last segment of the Endpoint's [resource
+     *     name][google.cloud.vertexai.v1beta1.Endpoint.name].
+     *   * `display_name` supports = and, !=
+     *   * `labels` supports general map functions that is:
+     *     * `labels.key=value` - key:value equality
+     *     * `labels.key:* or labels:key - key existence
+     *     * A key including a space must be quoted. `labels."a key"`.
+     *
+     * Some examples:
+     *   * `endpoint=1`
+     *   * `displayName="myDisplayName"`
+     *   * `labels.myKey="myValue"`
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The standard list page size.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The standard list page size.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The standard list page size.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The standard list page token.
+     * Typically obtained via
+     * [ListEndpointsResponse.next_page_token][google.cloud.vertexai.v1beta1.ListEndpointsResponse.next_page_token]
+     * of the previous
+     * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]
+     * call.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The standard list page token.
+     * Typically obtained via
+     * [ListEndpointsResponse.next_page_token][google.cloud.vertexai.v1beta1.ListEndpointsResponse.next_page_token]
+     * of the previous
+     * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]
+     * call.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The standard list page token.
+     * Typically obtained via
+     * [ListEndpointsResponse.next_page_token][google.cloud.vertexai.v1beta1.ListEndpointsResponse.next_page_token]
+     * of the previous
+     * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]
+     * call.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The standard list page token.
+     * Typically obtained via
+     * [ListEndpointsResponse.next_page_token][google.cloud.vertexai.v1beta1.ListEndpointsResponse.next_page_token]
+     * of the previous
+     * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]
+     * call.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The standard list page token.
+     * Typically obtained via
+     * [ListEndpointsResponse.next_page_token][google.cloud.vertexai.v1beta1.ListEndpointsResponse.next_page_token]
+     * of the previous
+     * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]
+     * call.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask readMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + readMaskBuilder_; + /** + * + * + *
+     * Optional. Mask specifying which fields to read.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readMask field is set. + */ + public boolean hasReadMask() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Optional. Mask specifying which fields to read.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readMask. + */ + public com.google.protobuf.FieldMask getReadMask() { + if (readMaskBuilder_ == null) { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } else { + return readMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Mask specifying which fields to read.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readMask_ = value; + } else { + readMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Mask specifying which fields to read.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (readMaskBuilder_ == null) { + readMask_ = builderForValue.build(); + } else { + readMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Mask specifying which fields to read.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && readMask_ != null + && readMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getReadMaskBuilder().mergeFrom(value); + } else { + readMask_ = value; + } + } else { + readMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Mask specifying which fields to read.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReadMask() { + bitField0_ = (bitField0_ & ~0x00000010); + readMask_ = null; + if (readMaskBuilder_ != null) { + readMaskBuilder_.dispose(); + readMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Mask specifying which fields to read.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getReadMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Mask specifying which fields to read.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + if (readMaskBuilder_ != null) { + return readMaskBuilder_.getMessageOrBuilder(); + } else { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + } + /** + * + * + *
+     * Optional. Mask specifying which fields to read.
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getReadMaskFieldBuilder() { + if (readMaskBuilder_ == null) { + readMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getReadMask(), getParentForChildren(), isClean()); + readMask_ = null; + } + return readMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ListEndpointsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ListEndpointsRequest) + private static final com.google.cloud.vertexai.api.ListEndpointsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ListEndpointsRequest(); + } + + public static com.google.cloud.vertexai.api.ListEndpointsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEndpointsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ListEndpointsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsRequestOrBuilder.java new file mode 100644 index 000000000000..700bde9e9ac2 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsRequestOrBuilder.java @@ -0,0 +1,197 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface ListEndpointsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ListEndpointsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Location from which to list the
+   * Endpoints. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the Location from which to list the
+   * Endpoints. Format: `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. An expression for filtering the results of the request. For field
+   * names both snake_case and camelCase are supported.
+   *
+   *   * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
+   *     i.e. the last segment of the Endpoint's [resource
+   *     name][google.cloud.vertexai.v1beta1.Endpoint.name].
+   *   * `display_name` supports = and, !=
+   *   * `labels` supports general map functions that is:
+   *     * `labels.key=value` - key:value equality
+   *     * `labels.key:* or labels:key - key existence
+   *     * A key including a space must be quoted. `labels."a key"`.
+   *
+   * Some examples:
+   *   * `endpoint=1`
+   *   * `displayName="myDisplayName"`
+   *   * `labels.myKey="myValue"`
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. An expression for filtering the results of the request. For field
+   * names both snake_case and camelCase are supported.
+   *
+   *   * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
+   *     i.e. the last segment of the Endpoint's [resource
+   *     name][google.cloud.vertexai.v1beta1.Endpoint.name].
+   *   * `display_name` supports = and, !=
+   *   * `labels` supports general map functions that is:
+   *     * `labels.key=value` - key:value equality
+   *     * `labels.key:* or labels:key - key existence
+   *     * A key including a space must be quoted. `labels."a key"`.
+   *
+   * Some examples:
+   *   * `endpoint=1`
+   *   * `displayName="myDisplayName"`
+   *   * `labels.myKey="myValue"`
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The standard list page size.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The standard list page token.
+   * Typically obtained via
+   * [ListEndpointsResponse.next_page_token][google.cloud.vertexai.v1beta1.ListEndpointsResponse.next_page_token]
+   * of the previous
+   * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]
+   * call.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The standard list page token.
+   * Typically obtained via
+   * [ListEndpointsResponse.next_page_token][google.cloud.vertexai.v1beta1.ListEndpointsResponse.next_page_token]
+   * of the previous
+   * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]
+   * call.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Mask specifying which fields to read.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the readMask field is set. + */ + boolean hasReadMask(); + /** + * + * + *
+   * Optional. Mask specifying which fields to read.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The readMask. + */ + com.google.protobuf.FieldMask getReadMask(); + /** + * + * + *
+   * Optional. Mask specifying which fields to read.
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsResponse.java new file mode 100644 index 000000000000..010cd8679231 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsResponse.java @@ -0,0 +1,1140 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ListEndpointsResponse} + */ +public final class ListEndpointsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ListEndpointsResponse) + ListEndpointsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEndpointsResponse.newBuilder() to construct. + private ListEndpointsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEndpointsResponse() { + endpoints_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEndpointsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ListEndpointsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ListEndpointsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ListEndpointsResponse.class, + com.google.cloud.vertexai.api.ListEndpointsResponse.Builder.class); + } + + public static final int ENDPOINTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List endpoints_; + /** + * + * + *
+   * List of Endpoints in the requested page.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + @java.lang.Override + public java.util.List getEndpointsList() { + return endpoints_; + } + /** + * + * + *
+   * List of Endpoints in the requested page.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + @java.lang.Override + public java.util.List + getEndpointsOrBuilderList() { + return endpoints_; + } + /** + * + * + *
+   * List of Endpoints in the requested page.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + @java.lang.Override + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * + * + *
+   * List of Endpoints in the requested page.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Endpoint getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * + * + *
+   * List of Endpoints in the requested page.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.EndpointOrBuilder getEndpointsOrBuilder(int index) { + return endpoints_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token to retrieve the next page of results.
+   * Pass to
+   * [ListEndpointsRequest.page_token][google.cloud.vertexai.v1beta1.ListEndpointsRequest.page_token]
+   * to obtain that page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token to retrieve the next page of results.
+   * Pass to
+   * [ListEndpointsRequest.page_token][google.cloud.vertexai.v1beta1.ListEndpointsRequest.page_token]
+   * to obtain that page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < endpoints_.size(); i++) { + output.writeMessage(1, endpoints_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < endpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, endpoints_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ListEndpointsResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ListEndpointsResponse other = + (com.google.cloud.vertexai.api.ListEndpointsResponse) obj; + + if (!getEndpointsList().equals(other.getEndpointsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEndpointsCount() > 0) { + hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getEndpointsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ListEndpointsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ListEndpointsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ListEndpointsResponse) + com.google.cloud.vertexai.api.ListEndpointsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ListEndpointsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ListEndpointsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ListEndpointsResponse.class, + com.google.cloud.vertexai.api.ListEndpointsResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ListEndpointsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (endpointsBuilder_ == null) { + endpoints_ = java.util.Collections.emptyList(); + } else { + endpoints_ = null; + endpointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_ListEndpointsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ListEndpointsResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ListEndpointsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ListEndpointsResponse build() { + com.google.cloud.vertexai.api.ListEndpointsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ListEndpointsResponse buildPartial() { + com.google.cloud.vertexai.api.ListEndpointsResponse result = + new com.google.cloud.vertexai.api.ListEndpointsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.ListEndpointsResponse result) { + if (endpointsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + endpoints_ = java.util.Collections.unmodifiableList(endpoints_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.endpoints_ = endpoints_; + } else { + result.endpoints_ = endpointsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.ListEndpointsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ListEndpointsResponse) { + return mergeFrom((com.google.cloud.vertexai.api.ListEndpointsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ListEndpointsResponse other) { + if (other == com.google.cloud.vertexai.api.ListEndpointsResponse.getDefaultInstance()) + return this; + if (endpointsBuilder_ == null) { + if (!other.endpoints_.isEmpty()) { + if (endpoints_.isEmpty()) { + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEndpointsIsMutable(); + endpoints_.addAll(other.endpoints_); + } + onChanged(); + } + } else { + if (!other.endpoints_.isEmpty()) { + if (endpointsBuilder_.isEmpty()) { + endpointsBuilder_.dispose(); + endpointsBuilder_ = null; + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00000001); + endpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEndpointsFieldBuilder() + : null; + } else { + endpointsBuilder_.addAllMessages(other.endpoints_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vertexai.api.Endpoint m = + input.readMessage( + com.google.cloud.vertexai.api.Endpoint.parser(), extensionRegistry); + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(m); + } else { + endpointsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List endpoints_ = + java.util.Collections.emptyList(); + + private void ensureEndpointsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + endpoints_ = new java.util.ArrayList(endpoints_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Endpoint, + com.google.cloud.vertexai.api.Endpoint.Builder, + com.google.cloud.vertexai.api.EndpointOrBuilder> + endpointsBuilder_; + + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public java.util.List getEndpointsList() { + if (endpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(endpoints_); + } else { + return endpointsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public int getEndpointsCount() { + if (endpointsBuilder_ == null) { + return endpoints_.size(); + } else { + return endpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.vertexai.api.Endpoint getEndpoints(int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public Builder setEndpoints(int index, com.google.cloud.vertexai.api.Endpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.set(index, value); + onChanged(); + } else { + endpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public Builder setEndpoints( + int index, com.google.cloud.vertexai.api.Endpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public Builder addEndpoints(com.google.cloud.vertexai.api.Endpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(value); + onChanged(); + } else { + endpointsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public Builder addEndpoints(int index, com.google.cloud.vertexai.api.Endpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(index, value); + onChanged(); + } else { + endpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public Builder addEndpoints(com.google.cloud.vertexai.api.Endpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public Builder addEndpoints( + int index, com.google.cloud.vertexai.api.Endpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public Builder addAllEndpoints( + java.lang.Iterable values) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endpoints_); + onChanged(); + } else { + endpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public Builder clearEndpoints() { + if (endpointsBuilder_ == null) { + endpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + endpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public Builder removeEndpoints(int index) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.remove(index); + onChanged(); + } else { + endpointsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.vertexai.api.Endpoint.Builder getEndpointsBuilder(int index) { + return getEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.vertexai.api.EndpointOrBuilder getEndpointsOrBuilder(int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public java.util.List + getEndpointsOrBuilderList() { + if (endpointsBuilder_ != null) { + return endpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(endpoints_); + } + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.vertexai.api.Endpoint.Builder addEndpointsBuilder() { + return getEndpointsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Endpoint.getDefaultInstance()); + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.vertexai.api.Endpoint.Builder addEndpointsBuilder(int index) { + return getEndpointsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Endpoint.getDefaultInstance()); + } + /** + * + * + *
+     * List of Endpoints in the requested page.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + public java.util.List + getEndpointsBuilderList() { + return getEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Endpoint, + com.google.cloud.vertexai.api.Endpoint.Builder, + com.google.cloud.vertexai.api.EndpointOrBuilder> + getEndpointsFieldBuilder() { + if (endpointsBuilder_ == null) { + endpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Endpoint, + com.google.cloud.vertexai.api.Endpoint.Builder, + com.google.cloud.vertexai.api.EndpointOrBuilder>( + endpoints_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + endpoints_ = null; + } + return endpointsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token to retrieve the next page of results.
+     * Pass to
+     * [ListEndpointsRequest.page_token][google.cloud.vertexai.v1beta1.ListEndpointsRequest.page_token]
+     * to obtain that page.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token to retrieve the next page of results.
+     * Pass to
+     * [ListEndpointsRequest.page_token][google.cloud.vertexai.v1beta1.ListEndpointsRequest.page_token]
+     * to obtain that page.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token to retrieve the next page of results.
+     * Pass to
+     * [ListEndpointsRequest.page_token][google.cloud.vertexai.v1beta1.ListEndpointsRequest.page_token]
+     * to obtain that page.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve the next page of results.
+     * Pass to
+     * [ListEndpointsRequest.page_token][google.cloud.vertexai.v1beta1.ListEndpointsRequest.page_token]
+     * to obtain that page.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token to retrieve the next page of results.
+     * Pass to
+     * [ListEndpointsRequest.page_token][google.cloud.vertexai.v1beta1.ListEndpointsRequest.page_token]
+     * to obtain that page.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ListEndpointsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ListEndpointsResponse) + private static final com.google.cloud.vertexai.api.ListEndpointsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ListEndpointsResponse(); + } + + public static com.google.cloud.vertexai.api.ListEndpointsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEndpointsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ListEndpointsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsResponseOrBuilder.java new file mode 100644 index 000000000000..0d1492c99b32 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ListEndpointsResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface ListEndpointsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ListEndpointsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of Endpoints in the requested page.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + java.util.List getEndpointsList(); + /** + * + * + *
+   * List of Endpoints in the requested page.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + com.google.cloud.vertexai.api.Endpoint getEndpoints(int index); + /** + * + * + *
+   * List of Endpoints in the requested page.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + int getEndpointsCount(); + /** + * + * + *
+   * List of Endpoints in the requested page.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + java.util.List + getEndpointsOrBuilderList(); + /** + * + * + *
+   * List of Endpoints in the requested page.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Endpoint endpoints = 1; + */ + com.google.cloud.vertexai.api.EndpointOrBuilder getEndpointsOrBuilder(int index); + + /** + * + * + *
+   * A token to retrieve the next page of results.
+   * Pass to
+   * [ListEndpointsRequest.page_token][google.cloud.vertexai.v1beta1.ListEndpointsRequest.page_token]
+   * to obtain that page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token to retrieve the next page of results.
+   * Pass to
+   * [ListEndpointsRequest.page_token][google.cloud.vertexai.v1beta1.ListEndpointsRequest.page_token]
+   * to obtain that page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/LocationName.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/LocationName.java new file mode 100644 index 000000000000..b15994fe0e4a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MachineResourcesProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MachineResourcesProto.java new file mode 100644 index 000000000000..e7a2a156a2d6 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MachineResourcesProto.java @@ -0,0 +1,201 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +public final class MachineResourcesProto { + private MachineResourcesProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_MachineSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_MachineSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_DedicatedResources_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_DedicatedResources_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_AutomaticResources_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_AutomaticResources_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_BatchDedicatedResources_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_BatchDedicatedResources_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ResourcesConsumed_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ResourcesConsumed_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_DiskSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_DiskSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_PersistentDiskSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_PersistentDiskSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_NfsMount_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_NfsMount_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_AutoscalingMetricSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_AutoscalingMetricSpec_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/vertexai/v1beta1/machine_" + + "resources.proto\022\035google.cloud.vertexai.v" + + "1beta1\032\037google/api/field_behavior.proto\032" + + "4google/cloud/vertexai/v1beta1/accelerat" + + "or_type.proto\"\260\001\n\013MachineSpec\022\032\n\014machine" + + "_type\030\001 \001(\tB\004\342A\001\005\022N\n\020accelerator_type\030\002 " + + "\001(\0162..google.cloud.vertexai.v1beta1.Acce" + + "leratorTypeB\004\342A\001\005\022\031\n\021accelerator_count\030\003" + + " \001(\005\022\032\n\014tpu_topology\030\004 \001(\tB\004\342A\001\005\"\376\001\n\022Ded" + + "icatedResources\022G\n\014machine_spec\030\001 \001(\0132*." + + "google.cloud.vertexai.v1beta1.MachineSpe" + + "cB\005\342A\002\002\005\022 \n\021min_replica_count\030\002 \001(\005B\005\342A\002" + + "\002\005\022\037\n\021max_replica_count\030\003 \001(\005B\004\342A\001\005\022\\\n\030a" + + "utoscaling_metric_specs\030\004 \003(\01324.google.c" + + "loud.vertexai.v1beta1.AutoscalingMetricS" + + "pecB\004\342A\001\005\"V\n\022AutomaticResources\022\037\n\021min_r" + + "eplica_count\030\001 \001(\005B\004\342A\001\005\022\037\n\021max_replica_" + + "count\030\002 \001(\005B\004\342A\001\005\"\251\001\n\027BatchDedicatedReso" + + "urces\022G\n\014machine_spec\030\001 \001(\0132*.google.clo" + + "ud.vertexai.v1beta1.MachineSpecB\005\342A\002\002\005\022$" + + "\n\026starting_replica_count\030\002 \001(\005B\004\342A\001\005\022\037\n\021" + + "max_replica_count\030\003 \001(\005B\004\342A\001\005\"0\n\021Resourc" + + "esConsumed\022\033\n\rreplica_hours\030\001 \001(\001B\004\342A\001\003\"" + + "=\n\010DiskSpec\022\026\n\016boot_disk_type\030\001 \001(\t\022\031\n\021b" + + "oot_disk_size_gb\030\002 \001(\005\"=\n\022PersistentDisk" + + "Spec\022\021\n\tdisk_type\030\001 \001(\t\022\024\n\014disk_size_gb\030" + + "\002 \001(\003\"O\n\010NfsMount\022\024\n\006server\030\001 \001(\tB\004\342A\001\002\022" + + "\022\n\004path\030\002 \001(\tB\004\342A\001\002\022\031\n\013mount_point\030\003 \001(\t" + + "B\004\342A\001\002\"B\n\025AutoscalingMetricSpec\022\031\n\013metri" + + "c_name\030\001 \001(\tB\004\342A\001\002\022\016\n\006target\030\002 \001(\005B\332\001\n\035c" + + "om.google.cloud.vertexai.apiB\025MachineRes" + + "ourcesProtoP\001Z=cloud.google.com/go/verte" + + "xai/apiv1beta1/vertexaipb;vertexaipb\252\002\035G" + + "oogle.Cloud.VertexAI.V1Beta1\312\002\035Google\\Cl" + + "oud\\VertexAI\\V1beta1\352\002 Google::Cloud::Ve" + + "rtexAI::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.vertexai.api.AcceleratorTypeProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_MachineSpec_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_MachineSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_MachineSpec_descriptor, + new java.lang.String[] { + "MachineType", "AcceleratorType", "AcceleratorCount", "TpuTopology", + }); + internal_static_google_cloud_vertexai_v1beta1_DedicatedResources_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vertexai_v1beta1_DedicatedResources_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DedicatedResources_descriptor, + new java.lang.String[] { + "MachineSpec", "MinReplicaCount", "MaxReplicaCount", "AutoscalingMetricSpecs", + }); + internal_static_google_cloud_vertexai_v1beta1_AutomaticResources_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vertexai_v1beta1_AutomaticResources_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_AutomaticResources_descriptor, + new java.lang.String[] { + "MinReplicaCount", "MaxReplicaCount", + }); + internal_static_google_cloud_vertexai_v1beta1_BatchDedicatedResources_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vertexai_v1beta1_BatchDedicatedResources_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_BatchDedicatedResources_descriptor, + new java.lang.String[] { + "MachineSpec", "StartingReplicaCount", "MaxReplicaCount", + }); + internal_static_google_cloud_vertexai_v1beta1_ResourcesConsumed_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vertexai_v1beta1_ResourcesConsumed_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ResourcesConsumed_descriptor, + new java.lang.String[] { + "ReplicaHours", + }); + internal_static_google_cloud_vertexai_v1beta1_DiskSpec_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vertexai_v1beta1_DiskSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DiskSpec_descriptor, + new java.lang.String[] { + "BootDiskType", "BootDiskSizeGb", + }); + internal_static_google_cloud_vertexai_v1beta1_PersistentDiskSpec_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_vertexai_v1beta1_PersistentDiskSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_PersistentDiskSpec_descriptor, + new java.lang.String[] { + "DiskType", "DiskSizeGb", + }); + internal_static_google_cloud_vertexai_v1beta1_NfsMount_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_vertexai_v1beta1_NfsMount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_NfsMount_descriptor, + new java.lang.String[] { + "Server", "Path", "MountPoint", + }); + internal_static_google_cloud_vertexai_v1beta1_AutoscalingMetricSpec_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_vertexai_v1beta1_AutoscalingMetricSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_AutoscalingMetricSpec_descriptor, + new java.lang.String[] { + "MetricName", "Target", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.vertexai.api.AcceleratorTypeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MachineSpec.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MachineSpec.java new file mode 100644 index 000000000000..fbca8f24ebc6 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MachineSpec.java @@ -0,0 +1,1167 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Specification of a single machine.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.MachineSpec} + */ +public final class MachineSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.MachineSpec) + MachineSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use MachineSpec.newBuilder() to construct. + private MachineSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MachineSpec() { + machineType_ = ""; + acceleratorType_ = 0; + tpuTopology_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MachineSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_MachineSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_MachineSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.MachineSpec.class, + com.google.cloud.vertexai.api.MachineSpec.Builder.class); + } + + public static final int MACHINE_TYPE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object machineType_ = ""; + /** + * + * + *
+   * Immutable. The type of the machine.
+   *
+   * See the [list of machine types supported for
+   * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
+   *
+   * See the [list of machine types supported for custom
+   * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
+   *
+   * For [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] this
+   * field is optional, and the default value is `n1-standard-2`. For
+   * [BatchPredictionJob][google.cloud.vertexai.v1beta1.BatchPredictionJob] or
+   * as part of [WorkerPoolSpec][google.cloud.vertexai.v1beta1.WorkerPoolSpec]
+   * this field is required.
+   * 
+ * + * string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The machineType. + */ + @java.lang.Override + public java.lang.String getMachineType() { + java.lang.Object ref = machineType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + machineType_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The type of the machine.
+   *
+   * See the [list of machine types supported for
+   * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
+   *
+   * See the [list of machine types supported for custom
+   * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
+   *
+   * For [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] this
+   * field is optional, and the default value is `n1-standard-2`. For
+   * [BatchPredictionJob][google.cloud.vertexai.v1beta1.BatchPredictionJob] or
+   * as part of [WorkerPoolSpec][google.cloud.vertexai.v1beta1.WorkerPoolSpec]
+   * this field is required.
+   * 
+ * + * string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for machineType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMachineTypeBytes() { + java.lang.Object ref = machineType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + machineType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCELERATOR_TYPE_FIELD_NUMBER = 2; + private int acceleratorType_ = 0; + /** + * + * + *
+   * Immutable. The type of accelerator(s) that may be attached to the machine
+   * as per
+   * [accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count].
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for acceleratorType. + */ + @java.lang.Override + public int getAcceleratorTypeValue() { + return acceleratorType_; + } + /** + * + * + *
+   * Immutable. The type of accelerator(s) that may be attached to the machine
+   * as per
+   * [accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count].
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The acceleratorType. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.AcceleratorType getAcceleratorType() { + com.google.cloud.vertexai.api.AcceleratorType result = + com.google.cloud.vertexai.api.AcceleratorType.forNumber(acceleratorType_); + return result == null ? com.google.cloud.vertexai.api.AcceleratorType.UNRECOGNIZED : result; + } + + public static final int ACCELERATOR_COUNT_FIELD_NUMBER = 3; + private int acceleratorCount_ = 0; + /** + * + * + *
+   * The number of accelerators to attach to the machine.
+   * 
+ * + * int32 accelerator_count = 3; + * + * @return The acceleratorCount. + */ + @java.lang.Override + public int getAcceleratorCount() { + return acceleratorCount_; + } + + public static final int TPU_TOPOLOGY_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object tpuTopology_ = ""; + /** + * + * + *
+   * Immutable. The topology of the TPUs. Corresponds to the TPU topologies
+   * available from GKE. (Example: tpu_topology: "2x2x1").
+   * 
+ * + * string tpu_topology = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The tpuTopology. + */ + @java.lang.Override + public java.lang.String getTpuTopology() { + java.lang.Object ref = tpuTopology_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tpuTopology_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The topology of the TPUs. Corresponds to the TPU topologies
+   * available from GKE. (Example: tpu_topology: "2x2x1").
+   * 
+ * + * string tpu_topology = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for tpuTopology. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTpuTopologyBytes() { + java.lang.Object ref = tpuTopology_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tpuTopology_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, machineType_); + } + if (acceleratorType_ + != com.google.cloud.vertexai.api.AcceleratorType.ACCELERATOR_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, acceleratorType_); + } + if (acceleratorCount_ != 0) { + output.writeInt32(3, acceleratorCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tpuTopology_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, tpuTopology_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, machineType_); + } + if (acceleratorType_ + != com.google.cloud.vertexai.api.AcceleratorType.ACCELERATOR_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, acceleratorType_); + } + if (acceleratorCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, acceleratorCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tpuTopology_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, tpuTopology_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.MachineSpec)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.MachineSpec other = + (com.google.cloud.vertexai.api.MachineSpec) obj; + + if (!getMachineType().equals(other.getMachineType())) return false; + if (acceleratorType_ != other.acceleratorType_) return false; + if (getAcceleratorCount() != other.getAcceleratorCount()) return false; + if (!getTpuTopology().equals(other.getTpuTopology())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MACHINE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMachineType().hashCode(); + hash = (37 * hash) + ACCELERATOR_TYPE_FIELD_NUMBER; + hash = (53 * hash) + acceleratorType_; + hash = (37 * hash) + ACCELERATOR_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getAcceleratorCount(); + hash = (37 * hash) + TPU_TOPOLOGY_FIELD_NUMBER; + hash = (53 * hash) + getTpuTopology().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.MachineSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MachineSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.MachineSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Specification of a single machine.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.MachineSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.MachineSpec) + com.google.cloud.vertexai.api.MachineSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_MachineSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_MachineSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.MachineSpec.class, + com.google.cloud.vertexai.api.MachineSpec.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.MachineSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + machineType_ = ""; + acceleratorType_ = 0; + acceleratorCount_ = 0; + tpuTopology_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_MachineSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MachineSpec getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MachineSpec build() { + com.google.cloud.vertexai.api.MachineSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MachineSpec buildPartial() { + com.google.cloud.vertexai.api.MachineSpec result = + new com.google.cloud.vertexai.api.MachineSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.MachineSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.machineType_ = machineType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.acceleratorType_ = acceleratorType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.acceleratorCount_ = acceleratorCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.tpuTopology_ = tpuTopology_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.MachineSpec) { + return mergeFrom((com.google.cloud.vertexai.api.MachineSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.MachineSpec other) { + if (other == com.google.cloud.vertexai.api.MachineSpec.getDefaultInstance()) return this; + if (!other.getMachineType().isEmpty()) { + machineType_ = other.machineType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.acceleratorType_ != 0) { + setAcceleratorTypeValue(other.getAcceleratorTypeValue()); + } + if (other.getAcceleratorCount() != 0) { + setAcceleratorCount(other.getAcceleratorCount()); + } + if (!other.getTpuTopology().isEmpty()) { + tpuTopology_ = other.tpuTopology_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + machineType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + acceleratorType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + acceleratorCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + tpuTopology_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object machineType_ = ""; + /** + * + * + *
+     * Immutable. The type of the machine.
+     *
+     * See the [list of machine types supported for
+     * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
+     *
+     * See the [list of machine types supported for custom
+     * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
+     *
+     * For [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] this
+     * field is optional, and the default value is `n1-standard-2`. For
+     * [BatchPredictionJob][google.cloud.vertexai.v1beta1.BatchPredictionJob] or
+     * as part of [WorkerPoolSpec][google.cloud.vertexai.v1beta1.WorkerPoolSpec]
+     * this field is required.
+     * 
+ * + * string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The machineType. + */ + public java.lang.String getMachineType() { + java.lang.Object ref = machineType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + machineType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The type of the machine.
+     *
+     * See the [list of machine types supported for
+     * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
+     *
+     * See the [list of machine types supported for custom
+     * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
+     *
+     * For [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] this
+     * field is optional, and the default value is `n1-standard-2`. For
+     * [BatchPredictionJob][google.cloud.vertexai.v1beta1.BatchPredictionJob] or
+     * as part of [WorkerPoolSpec][google.cloud.vertexai.v1beta1.WorkerPoolSpec]
+     * this field is required.
+     * 
+ * + * string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for machineType. + */ + public com.google.protobuf.ByteString getMachineTypeBytes() { + java.lang.Object ref = machineType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + machineType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The type of the machine.
+     *
+     * See the [list of machine types supported for
+     * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
+     *
+     * See the [list of machine types supported for custom
+     * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
+     *
+     * For [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] this
+     * field is optional, and the default value is `n1-standard-2`. For
+     * [BatchPredictionJob][google.cloud.vertexai.v1beta1.BatchPredictionJob] or
+     * as part of [WorkerPoolSpec][google.cloud.vertexai.v1beta1.WorkerPoolSpec]
+     * this field is required.
+     * 
+ * + * string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The machineType to set. + * @return This builder for chaining. + */ + public Builder setMachineType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + machineType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The type of the machine.
+     *
+     * See the [list of machine types supported for
+     * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
+     *
+     * See the [list of machine types supported for custom
+     * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
+     *
+     * For [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] this
+     * field is optional, and the default value is `n1-standard-2`. For
+     * [BatchPredictionJob][google.cloud.vertexai.v1beta1.BatchPredictionJob] or
+     * as part of [WorkerPoolSpec][google.cloud.vertexai.v1beta1.WorkerPoolSpec]
+     * this field is required.
+     * 
+ * + * string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearMachineType() { + machineType_ = getDefaultInstance().getMachineType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The type of the machine.
+     *
+     * See the [list of machine types supported for
+     * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
+     *
+     * See the [list of machine types supported for custom
+     * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
+     *
+     * For [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] this
+     * field is optional, and the default value is `n1-standard-2`. For
+     * [BatchPredictionJob][google.cloud.vertexai.v1beta1.BatchPredictionJob] or
+     * as part of [WorkerPoolSpec][google.cloud.vertexai.v1beta1.WorkerPoolSpec]
+     * this field is required.
+     * 
+ * + * string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for machineType to set. + * @return This builder for chaining. + */ + public Builder setMachineTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + machineType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int acceleratorType_ = 0; + /** + * + * + *
+     * Immutable. The type of accelerator(s) that may be attached to the machine
+     * as per
+     * [accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for acceleratorType. + */ + @java.lang.Override + public int getAcceleratorTypeValue() { + return acceleratorType_; + } + /** + * + * + *
+     * Immutable. The type of accelerator(s) that may be attached to the machine
+     * as per
+     * [accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for acceleratorType to set. + * @return This builder for chaining. + */ + public Builder setAcceleratorTypeValue(int value) { + acceleratorType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The type of accelerator(s) that may be attached to the machine
+     * as per
+     * [accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The acceleratorType. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.AcceleratorType getAcceleratorType() { + com.google.cloud.vertexai.api.AcceleratorType result = + com.google.cloud.vertexai.api.AcceleratorType.forNumber(acceleratorType_); + return result == null ? com.google.cloud.vertexai.api.AcceleratorType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Immutable. The type of accelerator(s) that may be attached to the machine
+     * as per
+     * [accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The acceleratorType to set. + * @return This builder for chaining. + */ + public Builder setAcceleratorType(com.google.cloud.vertexai.api.AcceleratorType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + acceleratorType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The type of accelerator(s) that may be attached to the machine
+     * as per
+     * [accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count].
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearAcceleratorType() { + bitField0_ = (bitField0_ & ~0x00000002); + acceleratorType_ = 0; + onChanged(); + return this; + } + + private int acceleratorCount_; + /** + * + * + *
+     * The number of accelerators to attach to the machine.
+     * 
+ * + * int32 accelerator_count = 3; + * + * @return The acceleratorCount. + */ + @java.lang.Override + public int getAcceleratorCount() { + return acceleratorCount_; + } + /** + * + * + *
+     * The number of accelerators to attach to the machine.
+     * 
+ * + * int32 accelerator_count = 3; + * + * @param value The acceleratorCount to set. + * @return This builder for chaining. + */ + public Builder setAcceleratorCount(int value) { + + acceleratorCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of accelerators to attach to the machine.
+     * 
+ * + * int32 accelerator_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearAcceleratorCount() { + bitField0_ = (bitField0_ & ~0x00000004); + acceleratorCount_ = 0; + onChanged(); + return this; + } + + private java.lang.Object tpuTopology_ = ""; + /** + * + * + *
+     * Immutable. The topology of the TPUs. Corresponds to the TPU topologies
+     * available from GKE. (Example: tpu_topology: "2x2x1").
+     * 
+ * + * string tpu_topology = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The tpuTopology. + */ + public java.lang.String getTpuTopology() { + java.lang.Object ref = tpuTopology_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tpuTopology_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The topology of the TPUs. Corresponds to the TPU topologies
+     * available from GKE. (Example: tpu_topology: "2x2x1").
+     * 
+ * + * string tpu_topology = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for tpuTopology. + */ + public com.google.protobuf.ByteString getTpuTopologyBytes() { + java.lang.Object ref = tpuTopology_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tpuTopology_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The topology of the TPUs. Corresponds to the TPU topologies
+     * available from GKE. (Example: tpu_topology: "2x2x1").
+     * 
+ * + * string tpu_topology = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The tpuTopology to set. + * @return This builder for chaining. + */ + public Builder setTpuTopology(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tpuTopology_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The topology of the TPUs. Corresponds to the TPU topologies
+     * available from GKE. (Example: tpu_topology: "2x2x1").
+     * 
+ * + * string tpu_topology = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearTpuTopology() { + tpuTopology_ = getDefaultInstance().getTpuTopology(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The topology of the TPUs. Corresponds to the TPU topologies
+     * available from GKE. (Example: tpu_topology: "2x2x1").
+     * 
+ * + * string tpu_topology = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for tpuTopology to set. + * @return This builder for chaining. + */ + public Builder setTpuTopologyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tpuTopology_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.MachineSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.MachineSpec) + private static final com.google.cloud.vertexai.api.MachineSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.MachineSpec(); + } + + public static com.google.cloud.vertexai.api.MachineSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MachineSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MachineSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MachineSpecOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MachineSpecOrBuilder.java new file mode 100644 index 000000000000..499ec88d942a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MachineSpecOrBuilder.java @@ -0,0 +1,147 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +public interface MachineSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.MachineSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The type of the machine.
+   *
+   * See the [list of machine types supported for
+   * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
+   *
+   * See the [list of machine types supported for custom
+   * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
+   *
+   * For [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] this
+   * field is optional, and the default value is `n1-standard-2`. For
+   * [BatchPredictionJob][google.cloud.vertexai.v1beta1.BatchPredictionJob] or
+   * as part of [WorkerPoolSpec][google.cloud.vertexai.v1beta1.WorkerPoolSpec]
+   * this field is required.
+   * 
+ * + * string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The machineType. + */ + java.lang.String getMachineType(); + /** + * + * + *
+   * Immutable. The type of the machine.
+   *
+   * See the [list of machine types supported for
+   * prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
+   *
+   * See the [list of machine types supported for custom
+   * training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
+   *
+   * For [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] this
+   * field is optional, and the default value is `n1-standard-2`. For
+   * [BatchPredictionJob][google.cloud.vertexai.v1beta1.BatchPredictionJob] or
+   * as part of [WorkerPoolSpec][google.cloud.vertexai.v1beta1.WorkerPoolSpec]
+   * this field is required.
+   * 
+ * + * string machine_type = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for machineType. + */ + com.google.protobuf.ByteString getMachineTypeBytes(); + + /** + * + * + *
+   * Immutable. The type of accelerator(s) that may be attached to the machine
+   * as per
+   * [accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count].
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for acceleratorType. + */ + int getAcceleratorTypeValue(); + /** + * + * + *
+   * Immutable. The type of accelerator(s) that may be attached to the machine
+   * as per
+   * [accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count].
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.AcceleratorType accelerator_type = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The acceleratorType. + */ + com.google.cloud.vertexai.api.AcceleratorType getAcceleratorType(); + + /** + * + * + *
+   * The number of accelerators to attach to the machine.
+   * 
+ * + * int32 accelerator_count = 3; + * + * @return The acceleratorCount. + */ + int getAcceleratorCount(); + + /** + * + * + *
+   * Immutable. The topology of the TPUs. Corresponds to the TPU topologies
+   * available from GKE. (Example: tpu_topology: "2x2x1").
+   * 
+ * + * string tpu_topology = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The tpuTopology. + */ + java.lang.String getTpuTopology(); + /** + * + * + *
+   * Immutable. The topology of the TPUs. Corresponds to the TPU topologies
+   * available from GKE. (Example: tpu_topology: "2x2x1").
+   * 
+ * + * string tpu_topology = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for tpuTopology. + */ + com.google.protobuf.ByteString getTpuTopologyBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ModelExplanation.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ModelExplanation.java new file mode 100644 index 000000000000..70b00fc76d6e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ModelExplanation.java @@ -0,0 +1,1469 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Aggregated explanation metrics for a Model over a set of instances.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ModelExplanation} + */ +public final class ModelExplanation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ModelExplanation) + ModelExplanationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ModelExplanation.newBuilder() to construct. + private ModelExplanation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ModelExplanation() { + meanAttributions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ModelExplanation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ModelExplanation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ModelExplanation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ModelExplanation.class, + com.google.cloud.vertexai.api.ModelExplanation.Builder.class); + } + + public static final int MEAN_ATTRIBUTIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List meanAttributions_; + /** + * + * + *
+   * Output only. Aggregated attributions explaining the Model's prediction
+   * outputs over the set of instances. The attributions are grouped by outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * The
+   * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+   * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+   * and
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * fields are averaged over the test data.
+   *
+   * NOTE: Currently AutoML tabular classification Models produce only one
+   * attribution, which averages attributions over all the classes it predicts.
+   * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+   * is not populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getMeanAttributionsList() { + return meanAttributions_; + } + /** + * + * + *
+   * Output only. Aggregated attributions explaining the Model's prediction
+   * outputs over the set of instances. The attributions are grouped by outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * The
+   * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+   * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+   * and
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * fields are averaged over the test data.
+   *
+   * NOTE: Currently AutoML tabular classification Models produce only one
+   * attribution, which averages attributions over all the classes it predicts.
+   * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+   * is not populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getMeanAttributionsOrBuilderList() { + return meanAttributions_; + } + /** + * + * + *
+   * Output only. Aggregated attributions explaining the Model's prediction
+   * outputs over the set of instances. The attributions are grouped by outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * The
+   * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+   * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+   * and
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * fields are averaged over the test data.
+   *
+   * NOTE: Currently AutoML tabular classification Models produce only one
+   * attribution, which averages attributions over all the classes it predicts.
+   * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+   * is not populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getMeanAttributionsCount() { + return meanAttributions_.size(); + } + /** + * + * + *
+   * Output only. Aggregated attributions explaining the Model's prediction
+   * outputs over the set of instances. The attributions are grouped by outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * The
+   * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+   * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+   * and
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * fields are averaged over the test data.
+   *
+   * NOTE: Currently AutoML tabular classification Models produce only one
+   * attribution, which averages attributions over all the classes it predicts.
+   * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+   * is not populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Attribution getMeanAttributions(int index) { + return meanAttributions_.get(index); + } + /** + * + * + *
+   * Output only. Aggregated attributions explaining the Model's prediction
+   * outputs over the set of instances. The attributions are grouped by outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * The
+   * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+   * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+   * and
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * fields are averaged over the test data.
+   *
+   * NOTE: Currently AutoML tabular classification Models produce only one
+   * attribution, which averages attributions over all the classes it predicts.
+   * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+   * is not populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.AttributionOrBuilder getMeanAttributionsOrBuilder( + int index) { + return meanAttributions_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < meanAttributions_.size(); i++) { + output.writeMessage(1, meanAttributions_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < meanAttributions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, meanAttributions_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ModelExplanation)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ModelExplanation other = + (com.google.cloud.vertexai.api.ModelExplanation) obj; + + if (!getMeanAttributionsList().equals(other.getMeanAttributionsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getMeanAttributionsCount() > 0) { + hash = (37 * hash) + MEAN_ATTRIBUTIONS_FIELD_NUMBER; + hash = (53 * hash) + getMeanAttributionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ModelExplanation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ModelExplanation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Aggregated explanation metrics for a Model over a set of instances.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ModelExplanation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ModelExplanation) + com.google.cloud.vertexai.api.ModelExplanationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ModelExplanation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ModelExplanation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ModelExplanation.class, + com.google.cloud.vertexai.api.ModelExplanation.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ModelExplanation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (meanAttributionsBuilder_ == null) { + meanAttributions_ = java.util.Collections.emptyList(); + } else { + meanAttributions_ = null; + meanAttributionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_ModelExplanation_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ModelExplanation getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ModelExplanation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ModelExplanation build() { + com.google.cloud.vertexai.api.ModelExplanation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ModelExplanation buildPartial() { + com.google.cloud.vertexai.api.ModelExplanation result = + new com.google.cloud.vertexai.api.ModelExplanation(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.ModelExplanation result) { + if (meanAttributionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + meanAttributions_ = java.util.Collections.unmodifiableList(meanAttributions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.meanAttributions_ = meanAttributions_; + } else { + result.meanAttributions_ = meanAttributionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.ModelExplanation result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ModelExplanation) { + return mergeFrom((com.google.cloud.vertexai.api.ModelExplanation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ModelExplanation other) { + if (other == com.google.cloud.vertexai.api.ModelExplanation.getDefaultInstance()) return this; + if (meanAttributionsBuilder_ == null) { + if (!other.meanAttributions_.isEmpty()) { + if (meanAttributions_.isEmpty()) { + meanAttributions_ = other.meanAttributions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMeanAttributionsIsMutable(); + meanAttributions_.addAll(other.meanAttributions_); + } + onChanged(); + } + } else { + if (!other.meanAttributions_.isEmpty()) { + if (meanAttributionsBuilder_.isEmpty()) { + meanAttributionsBuilder_.dispose(); + meanAttributionsBuilder_ = null; + meanAttributions_ = other.meanAttributions_; + bitField0_ = (bitField0_ & ~0x00000001); + meanAttributionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMeanAttributionsFieldBuilder() + : null; + } else { + meanAttributionsBuilder_.addAllMessages(other.meanAttributions_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vertexai.api.Attribution m = + input.readMessage( + com.google.cloud.vertexai.api.Attribution.parser(), extensionRegistry); + if (meanAttributionsBuilder_ == null) { + ensureMeanAttributionsIsMutable(); + meanAttributions_.add(m); + } else { + meanAttributionsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List meanAttributions_ = + java.util.Collections.emptyList(); + + private void ensureMeanAttributionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + meanAttributions_ = + new java.util.ArrayList(meanAttributions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Attribution, + com.google.cloud.vertexai.api.Attribution.Builder, + com.google.cloud.vertexai.api.AttributionOrBuilder> + meanAttributionsBuilder_; + + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getMeanAttributionsList() { + if (meanAttributionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(meanAttributions_); + } else { + return meanAttributionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getMeanAttributionsCount() { + if (meanAttributionsBuilder_ == null) { + return meanAttributions_.size(); + } else { + return meanAttributionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Attribution getMeanAttributions(int index) { + if (meanAttributionsBuilder_ == null) { + return meanAttributions_.get(index); + } else { + return meanAttributionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMeanAttributions(int index, com.google.cloud.vertexai.api.Attribution value) { + if (meanAttributionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMeanAttributionsIsMutable(); + meanAttributions_.set(index, value); + onChanged(); + } else { + meanAttributionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMeanAttributions( + int index, com.google.cloud.vertexai.api.Attribution.Builder builderForValue) { + if (meanAttributionsBuilder_ == null) { + ensureMeanAttributionsIsMutable(); + meanAttributions_.set(index, builderForValue.build()); + onChanged(); + } else { + meanAttributionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMeanAttributions(com.google.cloud.vertexai.api.Attribution value) { + if (meanAttributionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMeanAttributionsIsMutable(); + meanAttributions_.add(value); + onChanged(); + } else { + meanAttributionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMeanAttributions(int index, com.google.cloud.vertexai.api.Attribution value) { + if (meanAttributionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMeanAttributionsIsMutable(); + meanAttributions_.add(index, value); + onChanged(); + } else { + meanAttributionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMeanAttributions( + com.google.cloud.vertexai.api.Attribution.Builder builderForValue) { + if (meanAttributionsBuilder_ == null) { + ensureMeanAttributionsIsMutable(); + meanAttributions_.add(builderForValue.build()); + onChanged(); + } else { + meanAttributionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMeanAttributions( + int index, com.google.cloud.vertexai.api.Attribution.Builder builderForValue) { + if (meanAttributionsBuilder_ == null) { + ensureMeanAttributionsIsMutable(); + meanAttributions_.add(index, builderForValue.build()); + onChanged(); + } else { + meanAttributionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllMeanAttributions( + java.lang.Iterable values) { + if (meanAttributionsBuilder_ == null) { + ensureMeanAttributionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, meanAttributions_); + onChanged(); + } else { + meanAttributionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMeanAttributions() { + if (meanAttributionsBuilder_ == null) { + meanAttributions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + meanAttributionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeMeanAttributions(int index) { + if (meanAttributionsBuilder_ == null) { + ensureMeanAttributionsIsMutable(); + meanAttributions_.remove(index); + onChanged(); + } else { + meanAttributionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Attribution.Builder getMeanAttributionsBuilder(int index) { + return getMeanAttributionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.AttributionOrBuilder getMeanAttributionsOrBuilder( + int index) { + if (meanAttributionsBuilder_ == null) { + return meanAttributions_.get(index); + } else { + return meanAttributionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMeanAttributionsOrBuilderList() { + if (meanAttributionsBuilder_ != null) { + return meanAttributionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(meanAttributions_); + } + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Attribution.Builder addMeanAttributionsBuilder() { + return getMeanAttributionsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Attribution.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.vertexai.api.Attribution.Builder addMeanAttributionsBuilder(int index) { + return getMeanAttributionsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Attribution.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Aggregated attributions explaining the Model's prediction
+     * outputs over the set of instances. The attributions are grouped by outputs.
+     *
+     * For Models that predict only one output, such as regression Models that
+     * predict only one score, there is only one attibution that explains the
+     * predicted output. For Models that predict multiple outputs, such as
+     * multiclass Models that predict multiple classes, each element explains one
+     * specific item.
+     * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+     * can be used to identify which output this attribution is explaining.
+     *
+     * The
+     * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+     * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+     * and
+     * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+     * fields are averaged over the test data.
+     *
+     * NOTE: Currently AutoML tabular classification Models produce only one
+     * attribution, which averages attributions over all the classes it predicts.
+     * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+     * is not populated.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMeanAttributionsBuilderList() { + return getMeanAttributionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Attribution, + com.google.cloud.vertexai.api.Attribution.Builder, + com.google.cloud.vertexai.api.AttributionOrBuilder> + getMeanAttributionsFieldBuilder() { + if (meanAttributionsBuilder_ == null) { + meanAttributionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Attribution, + com.google.cloud.vertexai.api.Attribution.Builder, + com.google.cloud.vertexai.api.AttributionOrBuilder>( + meanAttributions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + meanAttributions_ = null; + } + return meanAttributionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ModelExplanation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ModelExplanation) + private static final com.google.cloud.vertexai.api.ModelExplanation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ModelExplanation(); + } + + public static com.google.cloud.vertexai.api.ModelExplanation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ModelExplanation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ModelExplanation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ModelExplanationOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ModelExplanationOrBuilder.java new file mode 100644 index 000000000000..527f05d7d741 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ModelExplanationOrBuilder.java @@ -0,0 +1,192 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface ModelExplanationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ModelExplanation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Aggregated attributions explaining the Model's prediction
+   * outputs over the set of instances. The attributions are grouped by outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * The
+   * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+   * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+   * and
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * fields are averaged over the test data.
+   *
+   * NOTE: Currently AutoML tabular classification Models produce only one
+   * attribution, which averages attributions over all the classes it predicts.
+   * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+   * is not populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getMeanAttributionsList(); + /** + * + * + *
+   * Output only. Aggregated attributions explaining the Model's prediction
+   * outputs over the set of instances. The attributions are grouped by outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * The
+   * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+   * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+   * and
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * fields are averaged over the test data.
+   *
+   * NOTE: Currently AutoML tabular classification Models produce only one
+   * attribution, which averages attributions over all the classes it predicts.
+   * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+   * is not populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.Attribution getMeanAttributions(int index); + /** + * + * + *
+   * Output only. Aggregated attributions explaining the Model's prediction
+   * outputs over the set of instances. The attributions are grouped by outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * The
+   * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+   * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+   * and
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * fields are averaged over the test data.
+   *
+   * NOTE: Currently AutoML tabular classification Models produce only one
+   * attribution, which averages attributions over all the classes it predicts.
+   * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+   * is not populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getMeanAttributionsCount(); + /** + * + * + *
+   * Output only. Aggregated attributions explaining the Model's prediction
+   * outputs over the set of instances. The attributions are grouped by outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * The
+   * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+   * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+   * and
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * fields are averaged over the test data.
+   *
+   * NOTE: Currently AutoML tabular classification Models produce only one
+   * attribution, which averages attributions over all the classes it predicts.
+   * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+   * is not populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getMeanAttributionsOrBuilderList(); + /** + * + * + *
+   * Output only. Aggregated attributions explaining the Model's prediction
+   * outputs over the set of instances. The attributions are grouped by outputs.
+   *
+   * For Models that predict only one output, such as regression Models that
+   * predict only one score, there is only one attibution that explains the
+   * predicted output. For Models that predict multiple outputs, such as
+   * multiclass Models that predict multiple classes, each element explains one
+   * specific item.
+   * [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]
+   * can be used to identify which output this attribution is explaining.
+   *
+   * The
+   * [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value],
+   * [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value]
+   * and
+   * [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]
+   * fields are averaged over the test data.
+   *
+   * NOTE: Currently AutoML tabular classification Models produce only one
+   * attribution, which averages attributions over all the classes it predicts.
+   * [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error]
+   * is not populated.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.Attribution mean_attributions = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.vertexai.api.AttributionOrBuilder getMeanAttributionsOrBuilder(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelOperationMetadata.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelOperationMetadata.java new file mode 100644 index 000000000000..67053b6fb569 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelOperationMetadata.java @@ -0,0 +1,729 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Runtime operation information for
+ * [EndpointService.MutateDeployedModel][google.cloud.vertexai.v1beta1.EndpointService.MutateDeployedModel].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.MutateDeployedModelOperationMetadata} + */ +public final class MutateDeployedModelOperationMetadata + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.MutateDeployedModelOperationMetadata) + MutateDeployedModelOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use MutateDeployedModelOperationMetadata.newBuilder() to construct. + private MutateDeployedModelOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MutateDeployedModelOperationMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MutateDeployedModelOperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata.class, + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata.Builder.class); + } + + public static final int GENERIC_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.GenericOperationMetadata genericMetadata_; + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + @java.lang.Override + public boolean hasGenericMetadata() { + return genericMetadata_ != null; + } + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata() { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (genericMetadata_ != null) { + output.writeMessage(1, getGenericMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (genericMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGenericMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata other = + (com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata) obj; + + if (hasGenericMetadata() != other.hasGenericMetadata()) return false; + if (hasGenericMetadata()) { + if (!getGenericMetadata().equals(other.getGenericMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGenericMetadata()) { + hash = (37 * hash) + GENERIC_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getGenericMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for
+   * [EndpointService.MutateDeployedModel][google.cloud.vertexai.v1beta1.EndpointService.MutateDeployedModel].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.MutateDeployedModelOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.MutateDeployedModelOperationMetadata) + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata.class, + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata build() { + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata buildPartial() { + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata result = + new com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.genericMetadata_ = + genericMetadataBuilder_ == null ? genericMetadata_ : genericMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata) { + return mergeFrom( + (com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata other) { + if (other + == com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata + .getDefaultInstance()) return this; + if (other.hasGenericMetadata()) { + mergeGenericMetadata(other.getGenericMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGenericMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.GenericOperationMetadata genericMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder> + genericMetadataBuilder_; + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + public boolean hasGenericMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + public com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata() { + if (genericMetadataBuilder_ == null) { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } else { + return genericMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + genericMetadata_ = value; + } else { + genericMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder builderForValue) { + if (genericMetadataBuilder_ == null) { + genericMetadata_ = builderForValue.build(); + } else { + genericMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder mergeGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && genericMetadata_ != null + && genericMetadata_ + != com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance()) { + getGenericMetadataBuilder().mergeFrom(value); + } else { + genericMetadata_ = value; + } + } else { + genericMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder clearGenericMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.vertexai.api.GenericOperationMetadata.Builder + getGenericMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGenericMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + if (genericMetadataBuilder_ != null) { + return genericMetadataBuilder_.getMessageOrBuilder(); + } else { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder> + getGenericMetadataFieldBuilder() { + if (genericMetadataBuilder_ == null) { + genericMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder>( + getGenericMetadata(), getParentForChildren(), isClean()); + genericMetadata_ = null; + } + return genericMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.MutateDeployedModelOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.MutateDeployedModelOperationMetadata) + private static final com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata(); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MutateDeployedModelOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelOperationMetadataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..ed5e2b95aec1 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelOperationMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface MutateDeployedModelOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.MutateDeployedModelOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + boolean hasGenericMetadata(); + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata(); + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder getGenericMetadataOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelRequest.java new file mode 100644 index 000000000000..7249d0c589db --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelRequest.java @@ -0,0 +1,1361 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [EndpointService.MutateDeployedModel][google.cloud.vertexai.v1beta1.EndpointService.MutateDeployedModel].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.MutateDeployedModelRequest} + */ +public final class MutateDeployedModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.MutateDeployedModelRequest) + MutateDeployedModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use MutateDeployedModelRequest.newBuilder() to construct. + private MutateDeployedModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MutateDeployedModelRequest() { + endpoint_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MutateDeployedModelRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.MutateDeployedModelRequest.class, + com.google.cloud.vertexai.api.MutateDeployedModelRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint resource into which to mutate a
+   * DeployedModel. Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint resource into which to mutate a
+   * DeployedModel. Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPLOYED_MODEL_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.DeployedModel deployedModel_; + /** + * + * + *
+   * Required. The DeployedModel to be mutated within the Endpoint. Only the
+   * following fields can be mutated:
+   *
+   * * `min_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * `max_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+   * * `disable_container_logging` (v1 only)
+   * * `enable_container_logging` (v1beta1 only)
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployedModel field is set. + */ + @java.lang.Override + public boolean hasDeployedModel() { + return deployedModel_ != null; + } + /** + * + * + *
+   * Required. The DeployedModel to be mutated within the Endpoint. Only the
+   * following fields can be mutated:
+   *
+   * * `min_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * `max_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+   * * `disable_container_logging` (v1 only)
+   * * `enable_container_logging` (v1beta1 only)
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployedModel. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModel getDeployedModel() { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } + /** + * + * + *
+   * Required. The DeployedModel to be mutated within the Endpoint. Only the
+   * following fields can be mutated:
+   *
+   * * `min_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * `max_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+   * * `disable_container_logging` (v1 only)
+   * * `enable_container_logging` (v1beta1 only)
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder() { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 4; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + if (deployedModel_ != null) { + output.writeMessage(2, getDeployedModel()); + } + if (updateMask_ != null) { + output.writeMessage(4, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + if (deployedModel_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDeployedModel()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.MutateDeployedModelRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.MutateDeployedModelRequest other = + (com.google.cloud.vertexai.api.MutateDeployedModelRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (hasDeployedModel() != other.hasDeployedModel()) return false; + if (hasDeployedModel()) { + if (!getDeployedModel().equals(other.getDeployedModel())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + if (hasDeployedModel()) { + hash = (37 * hash) + DEPLOYED_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getDeployedModel().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.MutateDeployedModelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EndpointService.MutateDeployedModel][google.cloud.vertexai.v1beta1.EndpointService.MutateDeployedModel].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.MutateDeployedModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.MutateDeployedModelRequest) + com.google.cloud.vertexai.api.MutateDeployedModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.MutateDeployedModelRequest.class, + com.google.cloud.vertexai.api.MutateDeployedModelRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.MutateDeployedModelRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + deployedModel_ = null; + if (deployedModelBuilder_ != null) { + deployedModelBuilder_.dispose(); + deployedModelBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.MutateDeployedModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelRequest build() { + com.google.cloud.vertexai.api.MutateDeployedModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelRequest buildPartial() { + com.google.cloud.vertexai.api.MutateDeployedModelRequest result = + new com.google.cloud.vertexai.api.MutateDeployedModelRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.MutateDeployedModelRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deployedModel_ = + deployedModelBuilder_ == null ? deployedModel_ : deployedModelBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.MutateDeployedModelRequest) { + return mergeFrom((com.google.cloud.vertexai.api.MutateDeployedModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.MutateDeployedModelRequest other) { + if (other == com.google.cloud.vertexai.api.MutateDeployedModelRequest.getDefaultInstance()) + return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasDeployedModel()) { + mergeDeployedModel(other.getDeployedModel()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDeployedModelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint resource into which to mutate a
+     * DeployedModel. Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint resource into which to mutate a
+     * DeployedModel. Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint resource into which to mutate a
+     * DeployedModel. Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint resource into which to mutate a
+     * DeployedModel. Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint resource into which to mutate a
+     * DeployedModel. Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.DeployedModel deployedModel_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder> + deployedModelBuilder_; + /** + * + * + *
+     * Required. The DeployedModel to be mutated within the Endpoint. Only the
+     * following fields can be mutated:
+     *
+     * * `min_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * `max_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+     * * `disable_container_logging` (v1 only)
+     * * `enable_container_logging` (v1beta1 only)
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployedModel field is set. + */ + public boolean hasDeployedModel() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The DeployedModel to be mutated within the Endpoint. Only the
+     * following fields can be mutated:
+     *
+     * * `min_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * `max_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+     * * `disable_container_logging` (v1 only)
+     * * `enable_container_logging` (v1beta1 only)
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployedModel. + */ + public com.google.cloud.vertexai.api.DeployedModel getDeployedModel() { + if (deployedModelBuilder_ == null) { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } else { + return deployedModelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The DeployedModel to be mutated within the Endpoint. Only the
+     * following fields can be mutated:
+     *
+     * * `min_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * `max_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+     * * `disable_container_logging` (v1 only)
+     * * `enable_container_logging` (v1beta1 only)
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDeployedModel(com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deployedModel_ = value; + } else { + deployedModelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The DeployedModel to be mutated within the Endpoint. Only the
+     * following fields can be mutated:
+     *
+     * * `min_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * `max_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+     * * `disable_container_logging` (v1 only)
+     * * `enable_container_logging` (v1beta1 only)
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDeployedModel( + com.google.cloud.vertexai.api.DeployedModel.Builder builderForValue) { + if (deployedModelBuilder_ == null) { + deployedModel_ = builderForValue.build(); + } else { + deployedModelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The DeployedModel to be mutated within the Endpoint. Only the
+     * following fields can be mutated:
+     *
+     * * `min_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * `max_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+     * * `disable_container_logging` (v1 only)
+     * * `enable_container_logging` (v1beta1 only)
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDeployedModel(com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && deployedModel_ != null + && deployedModel_ != com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance()) { + getDeployedModelBuilder().mergeFrom(value); + } else { + deployedModel_ = value; + } + } else { + deployedModelBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The DeployedModel to be mutated within the Endpoint. Only the
+     * following fields can be mutated:
+     *
+     * * `min_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * `max_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+     * * `disable_container_logging` (v1 only)
+     * * `enable_container_logging` (v1beta1 only)
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDeployedModel() { + bitField0_ = (bitField0_ & ~0x00000002); + deployedModel_ = null; + if (deployedModelBuilder_ != null) { + deployedModelBuilder_.dispose(); + deployedModelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The DeployedModel to be mutated within the Endpoint. Only the
+     * following fields can be mutated:
+     *
+     * * `min_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * `max_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+     * * `disable_container_logging` (v1 only)
+     * * `enable_container_logging` (v1beta1 only)
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.DeployedModel.Builder getDeployedModelBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDeployedModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The DeployedModel to be mutated within the Endpoint. Only the
+     * following fields can be mutated:
+     *
+     * * `min_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * `max_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+     * * `disable_container_logging` (v1 only)
+     * * `enable_container_logging` (v1beta1 only)
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder() { + if (deployedModelBuilder_ != null) { + return deployedModelBuilder_.getMessageOrBuilder(); + } else { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } + } + /** + * + * + *
+     * Required. The DeployedModel to be mutated within the Endpoint. Only the
+     * following fields can be mutated:
+     *
+     * * `min_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * `max_replica_count` in either
+     * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+     * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+     * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+     * * `disable_container_logging` (v1 only)
+     * * `enable_container_logging` (v1beta1 only)
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder> + getDeployedModelFieldBuilder() { + if (deployedModelBuilder_ == null) { + deployedModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder>( + getDeployedModel(), getParentForChildren(), isClean()); + deployedModel_ = null; + } + return deployedModelBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000004); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.MutateDeployedModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.MutateDeployedModelRequest) + private static final com.google.cloud.vertexai.api.MutateDeployedModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.MutateDeployedModelRequest(); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MutateDeployedModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelRequestOrBuilder.java new file mode 100644 index 000000000000..45875c894807 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelRequestOrBuilder.java @@ -0,0 +1,173 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface MutateDeployedModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.MutateDeployedModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint resource into which to mutate a
+   * DeployedModel. Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint resource into which to mutate a
+   * DeployedModel. Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * Required. The DeployedModel to be mutated within the Endpoint. Only the
+   * following fields can be mutated:
+   *
+   * * `min_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * `max_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+   * * `disable_container_logging` (v1 only)
+   * * `enable_container_logging` (v1beta1 only)
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the deployedModel field is set. + */ + boolean hasDeployedModel(); + /** + * + * + *
+   * Required. The DeployedModel to be mutated within the Endpoint. Only the
+   * following fields can be mutated:
+   *
+   * * `min_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * `max_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+   * * `disable_container_logging` (v1 only)
+   * * `enable_container_logging` (v1beta1 only)
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The deployedModel. + */ + com.google.cloud.vertexai.api.DeployedModel getDeployedModel(); + /** + * + * + *
+   * Required. The DeployedModel to be mutated within the Endpoint. Only the
+   * following fields can be mutated:
+   *
+   * * `min_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * `max_replica_count` in either
+   * [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or
+   * [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources]
+   * * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs]
+   * * `disable_container_logging` (v1 only)
+   * * `enable_container_logging` (v1beta1 only)
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder(); + + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelResponse.java new file mode 100644 index 000000000000..6250c13c01da --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelResponse.java @@ -0,0 +1,710 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [EndpointService.MutateDeployedModel][google.cloud.vertexai.v1beta1.EndpointService.MutateDeployedModel].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.MutateDeployedModelResponse} + */ +public final class MutateDeployedModelResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.MutateDeployedModelResponse) + MutateDeployedModelResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use MutateDeployedModelResponse.newBuilder() to construct. + private MutateDeployedModelResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MutateDeployedModelResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MutateDeployedModelResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.MutateDeployedModelResponse.class, + com.google.cloud.vertexai.api.MutateDeployedModelResponse.Builder.class); + } + + public static final int DEPLOYED_MODEL_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.DeployedModel deployedModel_; + /** + * + * + *
+   * The DeployedModel that's being mutated.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return Whether the deployedModel field is set. + */ + @java.lang.Override + public boolean hasDeployedModel() { + return deployedModel_ != null; + } + /** + * + * + *
+   * The DeployedModel that's being mutated.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return The deployedModel. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModel getDeployedModel() { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } + /** + * + * + *
+   * The DeployedModel that's being mutated.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder() { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (deployedModel_ != null) { + output.writeMessage(1, getDeployedModel()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (deployedModel_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDeployedModel()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.MutateDeployedModelResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.MutateDeployedModelResponse other = + (com.google.cloud.vertexai.api.MutateDeployedModelResponse) obj; + + if (hasDeployedModel() != other.hasDeployedModel()) return false; + if (hasDeployedModel()) { + if (!getDeployedModel().equals(other.getDeployedModel())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDeployedModel()) { + hash = (37 * hash) + DEPLOYED_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getDeployedModel().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.MutateDeployedModelResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [EndpointService.MutateDeployedModel][google.cloud.vertexai.v1beta1.EndpointService.MutateDeployedModel].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.MutateDeployedModelResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.MutateDeployedModelResponse) + com.google.cloud.vertexai.api.MutateDeployedModelResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.MutateDeployedModelResponse.class, + com.google.cloud.vertexai.api.MutateDeployedModelResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.MutateDeployedModelResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + deployedModel_ = null; + if (deployedModelBuilder_ != null) { + deployedModelBuilder_.dispose(); + deployedModelBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_MutateDeployedModelResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.MutateDeployedModelResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelResponse build() { + com.google.cloud.vertexai.api.MutateDeployedModelResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelResponse buildPartial() { + com.google.cloud.vertexai.api.MutateDeployedModelResponse result = + new com.google.cloud.vertexai.api.MutateDeployedModelResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.MutateDeployedModelResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.deployedModel_ = + deployedModelBuilder_ == null ? deployedModel_ : deployedModelBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.MutateDeployedModelResponse) { + return mergeFrom((com.google.cloud.vertexai.api.MutateDeployedModelResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.MutateDeployedModelResponse other) { + if (other == com.google.cloud.vertexai.api.MutateDeployedModelResponse.getDefaultInstance()) + return this; + if (other.hasDeployedModel()) { + mergeDeployedModel(other.getDeployedModel()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDeployedModelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.DeployedModel deployedModel_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder> + deployedModelBuilder_; + /** + * + * + *
+     * The DeployedModel that's being mutated.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return Whether the deployedModel field is set. + */ + public boolean hasDeployedModel() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The DeployedModel that's being mutated.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return The deployedModel. + */ + public com.google.cloud.vertexai.api.DeployedModel getDeployedModel() { + if (deployedModelBuilder_ == null) { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } else { + return deployedModelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The DeployedModel that's being mutated.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public Builder setDeployedModel(com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deployedModel_ = value; + } else { + deployedModelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The DeployedModel that's being mutated.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public Builder setDeployedModel( + com.google.cloud.vertexai.api.DeployedModel.Builder builderForValue) { + if (deployedModelBuilder_ == null) { + deployedModel_ = builderForValue.build(); + } else { + deployedModelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The DeployedModel that's being mutated.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public Builder mergeDeployedModel(com.google.cloud.vertexai.api.DeployedModel value) { + if (deployedModelBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && deployedModel_ != null + && deployedModel_ != com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance()) { + getDeployedModelBuilder().mergeFrom(value); + } else { + deployedModel_ = value; + } + } else { + deployedModelBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The DeployedModel that's being mutated.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public Builder clearDeployedModel() { + bitField0_ = (bitField0_ & ~0x00000001); + deployedModel_ = null; + if (deployedModelBuilder_ != null) { + deployedModelBuilder_.dispose(); + deployedModelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The DeployedModel that's being mutated.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public com.google.cloud.vertexai.api.DeployedModel.Builder getDeployedModelBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDeployedModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The DeployedModel that's being mutated.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder() { + if (deployedModelBuilder_ != null) { + return deployedModelBuilder_.getMessageOrBuilder(); + } else { + return deployedModel_ == null + ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() + : deployedModel_; + } + } + /** + * + * + *
+     * The DeployedModel that's being mutated.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder> + getDeployedModelFieldBuilder() { + if (deployedModelBuilder_ == null) { + deployedModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.DeployedModel, + com.google.cloud.vertexai.api.DeployedModel.Builder, + com.google.cloud.vertexai.api.DeployedModelOrBuilder>( + getDeployedModel(), getParentForChildren(), isClean()); + deployedModel_ = null; + } + return deployedModelBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.MutateDeployedModelResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.MutateDeployedModelResponse) + private static final com.google.cloud.vertexai.api.MutateDeployedModelResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.MutateDeployedModelResponse(); + } + + public static com.google.cloud.vertexai.api.MutateDeployedModelResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MutateDeployedModelResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.MutateDeployedModelResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelResponseOrBuilder.java new file mode 100644 index 000000000000..164172073008 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/MutateDeployedModelResponseOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface MutateDeployedModelResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.MutateDeployedModelResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The DeployedModel that's being mutated.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return Whether the deployedModel field is set. + */ + boolean hasDeployedModel(); + /** + * + * + *
+   * The DeployedModel that's being mutated.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + * + * @return The deployedModel. + */ + com.google.cloud.vertexai.api.DeployedModel getDeployedModel(); + /** + * + * + *
+   * The DeployedModel that's being mutated.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.DeployedModel deployed_model = 1; + */ + com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Neighbor.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Neighbor.java new file mode 100644 index 000000000000..0f88c8db1de3 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Neighbor.java @@ -0,0 +1,719 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Neighbors for example-based explanations.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Neighbor} + */ +public final class Neighbor extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Neighbor) + NeighborOrBuilder { + private static final long serialVersionUID = 0L; + // Use Neighbor.newBuilder() to construct. + private Neighbor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Neighbor() { + neighborId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Neighbor(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Neighbor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Neighbor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Neighbor.class, + com.google.cloud.vertexai.api.Neighbor.Builder.class); + } + + public static final int NEIGHBOR_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object neighborId_ = ""; + /** + * + * + *
+   * Output only. The neighbor id.
+   * 
+ * + * string neighbor_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The neighborId. + */ + @java.lang.Override + public java.lang.String getNeighborId() { + java.lang.Object ref = neighborId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + neighborId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The neighbor id.
+   * 
+ * + * string neighbor_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for neighborId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNeighborIdBytes() { + java.lang.Object ref = neighborId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + neighborId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEIGHBOR_DISTANCE_FIELD_NUMBER = 2; + private double neighborDistance_ = 0D; + /** + * + * + *
+   * Output only. The neighbor distance.
+   * 
+ * + * double neighbor_distance = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The neighborDistance. + */ + @java.lang.Override + public double getNeighborDistance() { + return neighborDistance_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(neighborId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, neighborId_); + } + if (java.lang.Double.doubleToRawLongBits(neighborDistance_) != 0) { + output.writeDouble(2, neighborDistance_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(neighborId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, neighborId_); + } + if (java.lang.Double.doubleToRawLongBits(neighborDistance_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, neighborDistance_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Neighbor)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Neighbor other = (com.google.cloud.vertexai.api.Neighbor) obj; + + if (!getNeighborId().equals(other.getNeighborId())) return false; + if (java.lang.Double.doubleToLongBits(getNeighborDistance()) + != java.lang.Double.doubleToLongBits(other.getNeighborDistance())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NEIGHBOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getNeighborId().hashCode(); + hash = (37 * hash) + NEIGHBOR_DISTANCE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getNeighborDistance())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Neighbor parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Neighbor parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Neighbor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Neighbor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Neighbor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Neighbor parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Neighbor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Neighbor parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Neighbor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Neighbor parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Neighbor parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Neighbor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Neighbor prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Neighbors for example-based explanations.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Neighbor} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Neighbor) + com.google.cloud.vertexai.api.NeighborOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Neighbor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Neighbor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Neighbor.class, + com.google.cloud.vertexai.api.Neighbor.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Neighbor.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + neighborId_ = ""; + neighborDistance_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Neighbor_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Neighbor getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Neighbor.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Neighbor build() { + com.google.cloud.vertexai.api.Neighbor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Neighbor buildPartial() { + com.google.cloud.vertexai.api.Neighbor result = + new com.google.cloud.vertexai.api.Neighbor(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Neighbor result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.neighborId_ = neighborId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.neighborDistance_ = neighborDistance_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Neighbor) { + return mergeFrom((com.google.cloud.vertexai.api.Neighbor) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Neighbor other) { + if (other == com.google.cloud.vertexai.api.Neighbor.getDefaultInstance()) return this; + if (!other.getNeighborId().isEmpty()) { + neighborId_ = other.neighborId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getNeighborDistance() != 0D) { + setNeighborDistance(other.getNeighborDistance()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + neighborId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 17: + { + neighborDistance_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object neighborId_ = ""; + /** + * + * + *
+     * Output only. The neighbor id.
+     * 
+ * + * string neighbor_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The neighborId. + */ + public java.lang.String getNeighborId() { + java.lang.Object ref = neighborId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + neighborId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The neighbor id.
+     * 
+ * + * string neighbor_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for neighborId. + */ + public com.google.protobuf.ByteString getNeighborIdBytes() { + java.lang.Object ref = neighborId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + neighborId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The neighbor id.
+     * 
+ * + * string neighbor_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The neighborId to set. + * @return This builder for chaining. + */ + public Builder setNeighborId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + neighborId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The neighbor id.
+     * 
+ * + * string neighbor_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearNeighborId() { + neighborId_ = getDefaultInstance().getNeighborId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The neighbor id.
+     * 
+ * + * string neighbor_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for neighborId to set. + * @return This builder for chaining. + */ + public Builder setNeighborIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + neighborId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private double neighborDistance_; + /** + * + * + *
+     * Output only. The neighbor distance.
+     * 
+ * + * double neighbor_distance = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The neighborDistance. + */ + @java.lang.Override + public double getNeighborDistance() { + return neighborDistance_; + } + /** + * + * + *
+     * Output only. The neighbor distance.
+     * 
+ * + * double neighbor_distance = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The neighborDistance to set. + * @return This builder for chaining. + */ + public Builder setNeighborDistance(double value) { + + neighborDistance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The neighbor distance.
+     * 
+ * + * double neighbor_distance = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearNeighborDistance() { + bitField0_ = (bitField0_ & ~0x00000002); + neighborDistance_ = 0D; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Neighbor) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Neighbor) + private static final com.google.cloud.vertexai.api.Neighbor DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Neighbor(); + } + + public static com.google.cloud.vertexai.api.Neighbor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Neighbor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Neighbor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/NeighborOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/NeighborOrBuilder.java new file mode 100644 index 000000000000..ad086c0557c4 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/NeighborOrBuilder.java @@ -0,0 +1,63 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface NeighborOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Neighbor) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The neighbor id.
+   * 
+ * + * string neighbor_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The neighborId. + */ + java.lang.String getNeighborId(); + /** + * + * + *
+   * Output only. The neighbor id.
+   * 
+ * + * string neighbor_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for neighborId. + */ + com.google.protobuf.ByteString getNeighborIdBytes(); + + /** + * + * + *
+   * Output only. The neighbor distance.
+   * 
+ * + * double neighbor_distance = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The neighborDistance. + */ + double getNeighborDistance(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/NfsMount.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/NfsMount.java new file mode 100644 index 000000000000..e23ed7a1f1b5 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/NfsMount.java @@ -0,0 +1,1007 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Represents a mount configuration for Network File System (NFS) to mount.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.NfsMount} + */ +public final class NfsMount extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.NfsMount) + NfsMountOrBuilder { + private static final long serialVersionUID = 0L; + // Use NfsMount.newBuilder() to construct. + private NfsMount(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NfsMount() { + server_ = ""; + path_ = ""; + mountPoint_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NfsMount(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_NfsMount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_NfsMount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.NfsMount.class, + com.google.cloud.vertexai.api.NfsMount.Builder.class); + } + + public static final int SERVER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object server_ = ""; + /** + * + * + *
+   * Required. IP address of the NFS server.
+   * 
+ * + * string server = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The server. + */ + @java.lang.Override + public java.lang.String getServer() { + java.lang.Object ref = server_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + server_ = s; + return s; + } + } + /** + * + * + *
+   * Required. IP address of the NFS server.
+   * 
+ * + * string server = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for server. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServerBytes() { + java.lang.Object ref = server_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + server_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object path_ = ""; + /** + * + * + *
+   * Required. Source path exported from NFS server.
+   * Has to start with '/', and combined with the ip address, it indicates
+   * the source mount path in the form of `server:path`
+   * 
+ * + * string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The path. + */ + @java.lang.Override + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Source path exported from NFS server.
+   * Has to start with '/', and combined with the ip address, it indicates
+   * the source mount path in the form of `server:path`
+   * 
+ * + * string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for path. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MOUNT_POINT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object mountPoint_ = ""; + /** + * + * + *
+   * Required. Destination mount path. The NFS will be mounted for the user
+   * under /mnt/nfs/<mount_point>
+   * 
+ * + * string mount_point = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mountPoint. + */ + @java.lang.Override + public java.lang.String getMountPoint() { + java.lang.Object ref = mountPoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountPoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Destination mount path. The NFS will be mounted for the user
+   * under /mnt/nfs/<mount_point>
+   * 
+ * + * string mount_point = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mountPoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMountPointBytes() { + java.lang.Object ref = mountPoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(server_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, server_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, path_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountPoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, mountPoint_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(server_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, server_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, path_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountPoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, mountPoint_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.NfsMount)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.NfsMount other = (com.google.cloud.vertexai.api.NfsMount) obj; + + if (!getServer().equals(other.getServer())) return false; + if (!getPath().equals(other.getPath())) return false; + if (!getMountPoint().equals(other.getMountPoint())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERVER_FIELD_NUMBER; + hash = (53 * hash) + getServer().hashCode(); + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + hash = (37 * hash) + MOUNT_POINT_FIELD_NUMBER; + hash = (53 * hash) + getMountPoint().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.NfsMount parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.NfsMount parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.NfsMount parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.NfsMount parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.NfsMount parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.NfsMount parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.NfsMount parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.NfsMount parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.NfsMount parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.NfsMount parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.NfsMount parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.NfsMount parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.NfsMount prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a mount configuration for Network File System (NFS) to mount.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.NfsMount} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.NfsMount) + com.google.cloud.vertexai.api.NfsMountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_NfsMount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_NfsMount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.NfsMount.class, + com.google.cloud.vertexai.api.NfsMount.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.NfsMount.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + server_ = ""; + path_ = ""; + mountPoint_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_NfsMount_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.NfsMount getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.NfsMount.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.NfsMount build() { + com.google.cloud.vertexai.api.NfsMount result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.NfsMount buildPartial() { + com.google.cloud.vertexai.api.NfsMount result = + new com.google.cloud.vertexai.api.NfsMount(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.NfsMount result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.server_ = server_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.path_ = path_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mountPoint_ = mountPoint_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.NfsMount) { + return mergeFrom((com.google.cloud.vertexai.api.NfsMount) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.NfsMount other) { + if (other == com.google.cloud.vertexai.api.NfsMount.getDefaultInstance()) return this; + if (!other.getServer().isEmpty()) { + server_ = other.server_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPath().isEmpty()) { + path_ = other.path_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getMountPoint().isEmpty()) { + mountPoint_ = other.mountPoint_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + server_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + path_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + mountPoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object server_ = ""; + /** + * + * + *
+     * Required. IP address of the NFS server.
+     * 
+ * + * string server = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The server. + */ + public java.lang.String getServer() { + java.lang.Object ref = server_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + server_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. IP address of the NFS server.
+     * 
+ * + * string server = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for server. + */ + public com.google.protobuf.ByteString getServerBytes() { + java.lang.Object ref = server_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + server_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. IP address of the NFS server.
+     * 
+ * + * string server = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The server to set. + * @return This builder for chaining. + */ + public Builder setServer(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + server_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. IP address of the NFS server.
+     * 
+ * + * string server = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearServer() { + server_ = getDefaultInstance().getServer(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. IP address of the NFS server.
+     * 
+ * + * string server = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for server to set. + * @return This builder for chaining. + */ + public Builder setServerBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + server_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object path_ = ""; + /** + * + * + *
+     * Required. Source path exported from NFS server.
+     * Has to start with '/', and combined with the ip address, it indicates
+     * the source mount path in the form of `server:path`
+     * 
+ * + * string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The path. + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Source path exported from NFS server.
+     * Has to start with '/', and combined with the ip address, it indicates
+     * the source mount path in the form of `server:path`
+     * 
+ * + * string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for path. + */ + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Source path exported from NFS server.
+     * Has to start with '/', and combined with the ip address, it indicates
+     * the source mount path in the form of `server:path`
+     * 
+ * + * string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + path_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Source path exported from NFS server.
+     * Has to start with '/', and combined with the ip address, it indicates
+     * the source mount path in the form of `server:path`
+     * 
+ * + * string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPath() { + path_ = getDefaultInstance().getPath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Source path exported from NFS server.
+     * Has to start with '/', and combined with the ip address, it indicates
+     * the source mount path in the form of `server:path`
+     * 
+ * + * string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for path to set. + * @return This builder for chaining. + */ + public Builder setPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + path_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object mountPoint_ = ""; + /** + * + * + *
+     * Required. Destination mount path. The NFS will be mounted for the user
+     * under /mnt/nfs/<mount_point>
+     * 
+ * + * string mount_point = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mountPoint. + */ + public java.lang.String getMountPoint() { + java.lang.Object ref = mountPoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountPoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Destination mount path. The NFS will be mounted for the user
+     * under /mnt/nfs/<mount_point>
+     * 
+ * + * string mount_point = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mountPoint. + */ + public com.google.protobuf.ByteString getMountPointBytes() { + java.lang.Object ref = mountPoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Destination mount path. The NFS will be mounted for the user
+     * under /mnt/nfs/<mount_point>
+     * 
+ * + * string mount_point = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The mountPoint to set. + * @return This builder for chaining. + */ + public Builder setMountPoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + mountPoint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Destination mount path. The NFS will be mounted for the user
+     * under /mnt/nfs/<mount_point>
+     * 
+ * + * string mount_point = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMountPoint() { + mountPoint_ = getDefaultInstance().getMountPoint(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Destination mount path. The NFS will be mounted for the user
+     * under /mnt/nfs/<mount_point>
+     * 
+ * + * string mount_point = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for mountPoint to set. + * @return This builder for chaining. + */ + public Builder setMountPointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + mountPoint_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.NfsMount) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.NfsMount) + private static final com.google.cloud.vertexai.api.NfsMount DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.NfsMount(); + } + + public static com.google.cloud.vertexai.api.NfsMount getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NfsMount parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.NfsMount getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/NfsMountOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/NfsMountOrBuilder.java new file mode 100644 index 000000000000..5c6ed0d24d37 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/NfsMountOrBuilder.java @@ -0,0 +1,106 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +public interface NfsMountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.NfsMount) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. IP address of the NFS server.
+   * 
+ * + * string server = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The server. + */ + java.lang.String getServer(); + /** + * + * + *
+   * Required. IP address of the NFS server.
+   * 
+ * + * string server = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for server. + */ + com.google.protobuf.ByteString getServerBytes(); + + /** + * + * + *
+   * Required. Source path exported from NFS server.
+   * Has to start with '/', and combined with the ip address, it indicates
+   * the source mount path in the form of `server:path`
+   * 
+ * + * string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The path. + */ + java.lang.String getPath(); + /** + * + * + *
+   * Required. Source path exported from NFS server.
+   * Has to start with '/', and combined with the ip address, it indicates
+   * the source mount path in the form of `server:path`
+   * 
+ * + * string path = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for path. + */ + com.google.protobuf.ByteString getPathBytes(); + + /** + * + * + *
+   * Required. Destination mount path. The NFS will be mounted for the user
+   * under /mnt/nfs/<mount_point>
+   * 
+ * + * string mount_point = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The mountPoint. + */ + java.lang.String getMountPoint(); + /** + * + * + *
+   * Required. Destination mount path. The NFS will be mounted for the user
+   * under /mnt/nfs/<mount_point>
+   * 
+ * + * string mount_point = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for mountPoint. + */ + com.google.protobuf.ByteString getMountPointBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/OpenApiProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/OpenApiProto.java new file mode 100644 index 000000000000..794782cd8587 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/OpenApiProto.java @@ -0,0 +1,113 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/openapi.proto + +package com.google.cloud.vertexai.api; + +public final class OpenApiProto { + private OpenApiProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Schema_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Schema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Schema_PropertiesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Schema_PropertiesEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n+google/cloud/vertexai/v1beta1/openapi." + + "proto\022\035google.cloud.vertexai.v1beta1\032\037go" + + "ogle/api/field_behavior.proto\032\034google/pr" + + "otobuf/struct.proto\"\314\003\n\006Schema\0227\n\004type\030\001" + + " \001(\0162#.google.cloud.vertexai.v1beta1.Typ" + + "eB\004\342A\001\001\022\024\n\006format\030\007 \001(\tB\004\342A\001\001\022\031\n\013descrip" + + "tion\030\010 \001(\tB\004\342A\001\001\022\026\n\010nullable\030\006 \001(\010B\004\342A\001\001" + + "\022:\n\005items\030\002 \001(\0132%.google.cloud.vertexai." + + "v1beta1.SchemaB\004\342A\001\001\022\022\n\004enum\030\t \003(\tB\004\342A\001\001" + + "\022O\n\nproperties\030\003 \003(\01325.google.cloud.vert" + + "exai.v1beta1.Schema.PropertiesEntryB\004\342A\001" + + "\001\022\026\n\010required\030\005 \003(\tB\004\342A\001\001\022-\n\007example\030\004 \001" + + "(\0132\026.google.protobuf.ValueB\004\342A\001\001\032X\n\017Prop" + + "ertiesEntry\022\013\n\003key\030\001 \001(\t\0224\n\005value\030\002 \001(\0132" + + "%.google.cloud.vertexai.v1beta1.Schema:\002" + + "8\001*e\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\n\n\006STRI" + + "NG\020\001\022\n\n\006NUMBER\020\002\022\013\n\007INTEGER\020\003\022\013\n\007BOOLEAN" + + "\020\004\022\t\n\005ARRAY\020\005\022\n\n\006OBJECT\020\006B\321\001\n\035com.google" + + ".cloud.vertexai.apiB\014OpenApiProtoP\001Z=clo" + + "ud.google.com/go/vertexai/apiv1beta1/ver" + + "texaipb;vertexaipb\252\002\035Google.Cloud.Vertex" + + "AI.V1Beta1\312\002\035Google\\Cloud\\VertexAI\\V1bet" + + "a1\352\002 Google::Cloud::VertexAI::V1beta1b\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_Schema_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_Schema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Schema_descriptor, + new java.lang.String[] { + "Type", + "Format", + "Description", + "Nullable", + "Items", + "Enum", + "Properties", + "Required", + "Example", + }); + internal_static_google_cloud_vertexai_v1beta1_Schema_PropertiesEntry_descriptor = + internal_static_google_cloud_vertexai_v1beta1_Schema_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_Schema_PropertiesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Schema_PropertiesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/OperationProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/OperationProto.java new file mode 100644 index 000000000000..e8c3b6e8f3fb --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/OperationProto.java @@ -0,0 +1,101 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/operation.proto + +package com.google.cloud.vertexai.api; + +public final class OperationProto { + private OperationProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_GenericOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_GenericOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_DeleteOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_DeleteOperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-google/cloud/vertexai/v1beta1/operatio" + + "n.proto\022\035google.cloud.vertexai.v1beta1\032\037" + + "google/api/field_behavior.proto\032\037google/" + + "protobuf/timestamp.proto\032\027google/rpc/sta" + + "tus.proto\"\274\001\n\030GenericOperationMetadata\0222" + + "\n\020partial_failures\030\001 \003(\0132\022.google.rpc.St" + + "atusB\004\342A\001\003\0225\n\013create_time\030\002 \001(\0132\032.google" + + ".protobuf.TimestampB\004\342A\001\003\0225\n\013update_time" + + "\030\003 \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003" + + "\"l\n\027DeleteOperationMetadata\022Q\n\020generic_m" + + "etadata\030\001 \001(\01327.google.cloud.vertexai.v1" + + "beta1.GenericOperationMetadataB\323\001\n\035com.g" + + "oogle.cloud.vertexai.apiB\016OperationProto" + + "P\001Z=cloud.google.com/go/vertexai/apiv1be" + + "ta1/vertexaipb;vertexaipb\252\002\035Google.Cloud" + + ".VertexAI.V1Beta1\312\002\035Google\\Cloud\\VertexA" + + "I\\V1beta1\352\002 Google::Cloud::VertexAI::V1b" + + "eta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_GenericOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_GenericOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_GenericOperationMetadata_descriptor, + new java.lang.String[] { + "PartialFailures", "CreateTime", "UpdateTime", + }); + internal_static_google_cloud_vertexai_v1beta1_DeleteOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vertexai_v1beta1_DeleteOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DeleteOperationMetadata_descriptor, + new java.lang.String[] { + "GenericMetadata", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Part.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Part.java new file mode 100644 index 000000000000..81924dd6f7bf --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Part.java @@ -0,0 +1,2500 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A datatype containing media that is part of a multi-part `Content` message.
+ *
+ * A `Part` consists of data which has an associated datatype. A `Part` can only
+ * contain one of the accepted types in `Part.data`.
+ *
+ * A `Part` must have a fixed IANA MIME type identifying the type and subtype
+ * of the media if `inline_data` or `file_data` field is filled with raw bytes.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Part} + */ +public final class Part extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Part) + PartOrBuilder { + private static final long serialVersionUID = 0L; + // Use Part.newBuilder() to construct. + private Part(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Part() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Part(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Part_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Part_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Part.class, + com.google.cloud.vertexai.api.Part.Builder.class); + } + + private int dataCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object data_; + + public enum DataCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(1), + INLINE_DATA(2), + FILE_DATA(3), + FUNCTION_CALL(5), + FUNCTION_RESPONSE(6), + DATA_NOT_SET(0); + private final int value; + + private DataCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataCase valueOf(int value) { + return forNumber(value); + } + + public static DataCase forNumber(int value) { + switch (value) { + case 1: + return TEXT; + case 2: + return INLINE_DATA; + case 3: + return FILE_DATA; + case 5: + return FUNCTION_CALL; + case 6: + return FUNCTION_RESPONSE; + case 0: + return DATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataCase getDataCase() { + return DataCase.forNumber(dataCase_); + } + + private int metadataCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object metadata_; + + public enum MetadataCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VIDEO_METADATA(4), + METADATA_NOT_SET(0); + private final int value; + + private MetadataCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MetadataCase valueOf(int value) { + return forNumber(value); + } + + public static MetadataCase forNumber(int value) { + switch (value) { + case 4: + return VIDEO_METADATA; + case 0: + return METADATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MetadataCase getMetadataCase() { + return MetadataCase.forNumber(metadataCase_); + } + + public static final int TEXT_FIELD_NUMBER = 1; + /** + * + * + *
+   * Optional. Text part (can be code).
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the text field is set. + */ + public boolean hasText() { + return dataCase_ == 1; + } + /** + * + * + *
+   * Optional. Text part (can be code).
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = ""; + if (dataCase_ == 1) { + ref = data_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (dataCase_ == 1) { + data_ = s; + } + return s; + } + } + /** + * + * + *
+   * Optional. Text part (can be code).
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (dataCase_ == 1) { + ref = data_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataCase_ == 1) { + data_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INLINE_DATA_FIELD_NUMBER = 2; + /** + * + * + *
+   * Optional. Inlined bytes data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inlineData field is set. + */ + @java.lang.Override + public boolean hasInlineData() { + return dataCase_ == 2; + } + /** + * + * + *
+   * Optional. Inlined bytes data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inlineData. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Blob getInlineData() { + if (dataCase_ == 2) { + return (com.google.cloud.vertexai.api.Blob) data_; + } + return com.google.cloud.vertexai.api.Blob.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. Inlined bytes data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.BlobOrBuilder getInlineDataOrBuilder() { + if (dataCase_ == 2) { + return (com.google.cloud.vertexai.api.Blob) data_; + } + return com.google.cloud.vertexai.api.Blob.getDefaultInstance(); + } + + public static final int FILE_DATA_FIELD_NUMBER = 3; + /** + * + * + *
+   * Optional. URI based data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fileData field is set. + */ + @java.lang.Override + public boolean hasFileData() { + return dataCase_ == 3; + } + /** + * + * + *
+   * Optional. URI based data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fileData. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FileData getFileData() { + if (dataCase_ == 3) { + return (com.google.cloud.vertexai.api.FileData) data_; + } + return com.google.cloud.vertexai.api.FileData.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. URI based data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FileDataOrBuilder getFileDataOrBuilder() { + if (dataCase_ == 3) { + return (com.google.cloud.vertexai.api.FileData) data_; + } + return com.google.cloud.vertexai.api.FileData.getDefaultInstance(); + } + + public static final int FUNCTION_CALL_FIELD_NUMBER = 5; + /** + * + * + *
+   * Optional. A predicted [FunctionCall] returned from the model that
+   * contains a string representing the [FunctionDeclaration.name] with the
+   * parameters and their values.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the functionCall field is set. + */ + @java.lang.Override + public boolean hasFunctionCall() { + return dataCase_ == 5; + } + /** + * + * + *
+   * Optional. A predicted [FunctionCall] returned from the model that
+   * contains a string representing the [FunctionDeclaration.name] with the
+   * parameters and their values.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The functionCall. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionCall getFunctionCall() { + if (dataCase_ == 5) { + return (com.google.cloud.vertexai.api.FunctionCall) data_; + } + return com.google.cloud.vertexai.api.FunctionCall.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. A predicted [FunctionCall] returned from the model that
+   * contains a string representing the [FunctionDeclaration.name] with the
+   * parameters and their values.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionCallOrBuilder getFunctionCallOrBuilder() { + if (dataCase_ == 5) { + return (com.google.cloud.vertexai.api.FunctionCall) data_; + } + return com.google.cloud.vertexai.api.FunctionCall.getDefaultInstance(); + } + + public static final int FUNCTION_RESPONSE_FIELD_NUMBER = 6; + /** + * + * + *
+   * Optional. The result output of a [FunctionCall] that contains a string
+   * representing the [FunctionDeclaration.name] and a structured JSON object
+   * containing any output from the function call. It is used as context to
+   * the model.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the functionResponse field is set. + */ + @java.lang.Override + public boolean hasFunctionResponse() { + return dataCase_ == 6; + } + /** + * + * + *
+   * Optional. The result output of a [FunctionCall] that contains a string
+   * representing the [FunctionDeclaration.name] and a structured JSON object
+   * containing any output from the function call. It is used as context to
+   * the model.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The functionResponse. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionResponse getFunctionResponse() { + if (dataCase_ == 6) { + return (com.google.cloud.vertexai.api.FunctionResponse) data_; + } + return com.google.cloud.vertexai.api.FunctionResponse.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. The result output of a [FunctionCall] that contains a string
+   * representing the [FunctionDeclaration.name] and a structured JSON object
+   * containing any output from the function call. It is used as context to
+   * the model.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionResponseOrBuilder getFunctionResponseOrBuilder() { + if (dataCase_ == 6) { + return (com.google.cloud.vertexai.api.FunctionResponse) data_; + } + return com.google.cloud.vertexai.api.FunctionResponse.getDefaultInstance(); + } + + public static final int VIDEO_METADATA_FIELD_NUMBER = 4; + /** + * + * + *
+   * Optional. Video metadata. The metadata should only be specified while the
+   * video data is presented in inline_data or file_data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the videoMetadata field is set. + */ + @java.lang.Override + public boolean hasVideoMetadata() { + return metadataCase_ == 4; + } + /** + * + * + *
+   * Optional. Video metadata. The metadata should only be specified while the
+   * video data is presented in inline_data or file_data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The videoMetadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.VideoMetadata getVideoMetadata() { + if (metadataCase_ == 4) { + return (com.google.cloud.vertexai.api.VideoMetadata) metadata_; + } + return com.google.cloud.vertexai.api.VideoMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. Video metadata. The metadata should only be specified while the
+   * video data is presented in inline_data or file_data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.VideoMetadataOrBuilder getVideoMetadataOrBuilder() { + if (metadataCase_ == 4) { + return (com.google.cloud.vertexai.api.VideoMetadata) metadata_; + } + return com.google.cloud.vertexai.api.VideoMetadata.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (dataCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, data_); + } + if (dataCase_ == 2) { + output.writeMessage(2, (com.google.cloud.vertexai.api.Blob) data_); + } + if (dataCase_ == 3) { + output.writeMessage(3, (com.google.cloud.vertexai.api.FileData) data_); + } + if (metadataCase_ == 4) { + output.writeMessage(4, (com.google.cloud.vertexai.api.VideoMetadata) metadata_); + } + if (dataCase_ == 5) { + output.writeMessage(5, (com.google.cloud.vertexai.api.FunctionCall) data_); + } + if (dataCase_ == 6) { + output.writeMessage(6, (com.google.cloud.vertexai.api.FunctionResponse) data_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dataCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, data_); + } + if (dataCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.vertexai.api.Blob) data_); + } + if (dataCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.vertexai.api.FileData) data_); + } + if (metadataCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.vertexai.api.VideoMetadata) metadata_); + } + if (dataCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.vertexai.api.FunctionCall) data_); + } + if (dataCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.vertexai.api.FunctionResponse) data_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Part)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Part other = (com.google.cloud.vertexai.api.Part) obj; + + if (!getDataCase().equals(other.getDataCase())) return false; + switch (dataCase_) { + case 1: + if (!getText().equals(other.getText())) return false; + break; + case 2: + if (!getInlineData().equals(other.getInlineData())) return false; + break; + case 3: + if (!getFileData().equals(other.getFileData())) return false; + break; + case 5: + if (!getFunctionCall().equals(other.getFunctionCall())) return false; + break; + case 6: + if (!getFunctionResponse().equals(other.getFunctionResponse())) return false; + break; + case 0: + default: + } + if (!getMetadataCase().equals(other.getMetadataCase())) return false; + switch (metadataCase_) { + case 4: + if (!getVideoMetadata().equals(other.getVideoMetadata())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (dataCase_) { + case 1: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 2: + hash = (37 * hash) + INLINE_DATA_FIELD_NUMBER; + hash = (53 * hash) + getInlineData().hashCode(); + break; + case 3: + hash = (37 * hash) + FILE_DATA_FIELD_NUMBER; + hash = (53 * hash) + getFileData().hashCode(); + break; + case 5: + hash = (37 * hash) + FUNCTION_CALL_FIELD_NUMBER; + hash = (53 * hash) + getFunctionCall().hashCode(); + break; + case 6: + hash = (37 * hash) + FUNCTION_RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getFunctionResponse().hashCode(); + break; + case 0: + default: + } + switch (metadataCase_) { + case 4: + hash = (37 * hash) + VIDEO_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getVideoMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Part parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Part parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Part parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Part parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Part parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Part parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Part parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Part parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Part parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Part parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Part parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Part parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Part prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A datatype containing media that is part of a multi-part `Content` message.
+   *
+   * A `Part` consists of data which has an associated datatype. A `Part` can only
+   * contain one of the accepted types in `Part.data`.
+   *
+   * A `Part` must have a fixed IANA MIME type identifying the type and subtype
+   * of the media if `inline_data` or `file_data` field is filled with raw bytes.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Part} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Part) + com.google.cloud.vertexai.api.PartOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Part_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Part_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Part.class, + com.google.cloud.vertexai.api.Part.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Part.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (inlineDataBuilder_ != null) { + inlineDataBuilder_.clear(); + } + if (fileDataBuilder_ != null) { + fileDataBuilder_.clear(); + } + if (functionCallBuilder_ != null) { + functionCallBuilder_.clear(); + } + if (functionResponseBuilder_ != null) { + functionResponseBuilder_.clear(); + } + if (videoMetadataBuilder_ != null) { + videoMetadataBuilder_.clear(); + } + dataCase_ = 0; + data_ = null; + metadataCase_ = 0; + metadata_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_Part_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Part getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Part.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Part build() { + com.google.cloud.vertexai.api.Part result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Part buildPartial() { + com.google.cloud.vertexai.api.Part result = new com.google.cloud.vertexai.api.Part(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Part result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.vertexai.api.Part result) { + result.dataCase_ = dataCase_; + result.data_ = this.data_; + if (dataCase_ == 2 && inlineDataBuilder_ != null) { + result.data_ = inlineDataBuilder_.build(); + } + if (dataCase_ == 3 && fileDataBuilder_ != null) { + result.data_ = fileDataBuilder_.build(); + } + if (dataCase_ == 5 && functionCallBuilder_ != null) { + result.data_ = functionCallBuilder_.build(); + } + if (dataCase_ == 6 && functionResponseBuilder_ != null) { + result.data_ = functionResponseBuilder_.build(); + } + result.metadataCase_ = metadataCase_; + result.metadata_ = this.metadata_; + if (metadataCase_ == 4 && videoMetadataBuilder_ != null) { + result.metadata_ = videoMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Part) { + return mergeFrom((com.google.cloud.vertexai.api.Part) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Part other) { + if (other == com.google.cloud.vertexai.api.Part.getDefaultInstance()) return this; + switch (other.getDataCase()) { + case TEXT: + { + dataCase_ = 1; + data_ = other.data_; + onChanged(); + break; + } + case INLINE_DATA: + { + mergeInlineData(other.getInlineData()); + break; + } + case FILE_DATA: + { + mergeFileData(other.getFileData()); + break; + } + case FUNCTION_CALL: + { + mergeFunctionCall(other.getFunctionCall()); + break; + } + case FUNCTION_RESPONSE: + { + mergeFunctionResponse(other.getFunctionResponse()); + break; + } + case DATA_NOT_SET: + { + break; + } + } + switch (other.getMetadataCase()) { + case VIDEO_METADATA: + { + mergeVideoMetadata(other.getVideoMetadata()); + break; + } + case METADATA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + dataCase_ = 1; + data_ = s; + break; + } // case 10 + case 18: + { + input.readMessage(getInlineDataFieldBuilder().getBuilder(), extensionRegistry); + dataCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getFileDataFieldBuilder().getBuilder(), extensionRegistry); + dataCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getVideoMetadataFieldBuilder().getBuilder(), extensionRegistry); + metadataCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getFunctionCallFieldBuilder().getBuilder(), extensionRegistry); + dataCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + getFunctionResponseFieldBuilder().getBuilder(), extensionRegistry); + dataCase_ = 6; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int dataCase_ = 0; + private java.lang.Object data_; + + public DataCase getDataCase() { + return DataCase.forNumber(dataCase_); + } + + public Builder clearData() { + dataCase_ = 0; + data_ = null; + onChanged(); + return this; + } + + private int metadataCase_ = 0; + private java.lang.Object metadata_; + + public MetadataCase getMetadataCase() { + return MetadataCase.forNumber(metadataCase_); + } + + public Builder clearMetadata() { + metadataCase_ = 0; + metadata_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Optional. Text part (can be code).
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return dataCase_ == 1; + } + /** + * + * + *
+     * Optional. Text part (can be code).
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = ""; + if (dataCase_ == 1) { + ref = data_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (dataCase_ == 1) { + data_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Text part (can be code).
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (dataCase_ == 1) { + ref = data_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataCase_ == 1) { + data_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Text part (can be code).
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dataCase_ = 1; + data_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Text part (can be code).
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearText() { + if (dataCase_ == 1) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Text part (can be code).
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dataCase_ = 1; + data_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Blob, + com.google.cloud.vertexai.api.Blob.Builder, + com.google.cloud.vertexai.api.BlobOrBuilder> + inlineDataBuilder_; + /** + * + * + *
+     * Optional. Inlined bytes data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inlineData field is set. + */ + @java.lang.Override + public boolean hasInlineData() { + return dataCase_ == 2; + } + /** + * + * + *
+     * Optional. Inlined bytes data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inlineData. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Blob getInlineData() { + if (inlineDataBuilder_ == null) { + if (dataCase_ == 2) { + return (com.google.cloud.vertexai.api.Blob) data_; + } + return com.google.cloud.vertexai.api.Blob.getDefaultInstance(); + } else { + if (dataCase_ == 2) { + return inlineDataBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.Blob.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Inlined bytes data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setInlineData(com.google.cloud.vertexai.api.Blob value) { + if (inlineDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + inlineDataBuilder_.setMessage(value); + } + dataCase_ = 2; + return this; + } + /** + * + * + *
+     * Optional. Inlined bytes data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setInlineData(com.google.cloud.vertexai.api.Blob.Builder builderForValue) { + if (inlineDataBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + inlineDataBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 2; + return this; + } + /** + * + * + *
+     * Optional. Inlined bytes data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeInlineData(com.google.cloud.vertexai.api.Blob value) { + if (inlineDataBuilder_ == null) { + if (dataCase_ == 2 && data_ != com.google.cloud.vertexai.api.Blob.getDefaultInstance()) { + data_ = + com.google.cloud.vertexai.api.Blob.newBuilder( + (com.google.cloud.vertexai.api.Blob) data_) + .mergeFrom(value) + .buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 2) { + inlineDataBuilder_.mergeFrom(value); + } else { + inlineDataBuilder_.setMessage(value); + } + } + dataCase_ = 2; + return this; + } + /** + * + * + *
+     * Optional. Inlined bytes data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearInlineData() { + if (inlineDataBuilder_ == null) { + if (dataCase_ == 2) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 2) { + dataCase_ = 0; + data_ = null; + } + inlineDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Inlined bytes data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Blob.Builder getInlineDataBuilder() { + return getInlineDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Inlined bytes data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.BlobOrBuilder getInlineDataOrBuilder() { + if ((dataCase_ == 2) && (inlineDataBuilder_ != null)) { + return inlineDataBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 2) { + return (com.google.cloud.vertexai.api.Blob) data_; + } + return com.google.cloud.vertexai.api.Blob.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Inlined bytes data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Blob, + com.google.cloud.vertexai.api.Blob.Builder, + com.google.cloud.vertexai.api.BlobOrBuilder> + getInlineDataFieldBuilder() { + if (inlineDataBuilder_ == null) { + if (!(dataCase_ == 2)) { + data_ = com.google.cloud.vertexai.api.Blob.getDefaultInstance(); + } + inlineDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Blob, + com.google.cloud.vertexai.api.Blob.Builder, + com.google.cloud.vertexai.api.BlobOrBuilder>( + (com.google.cloud.vertexai.api.Blob) data_, getParentForChildren(), isClean()); + data_ = null; + } + dataCase_ = 2; + onChanged(); + return inlineDataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FileData, + com.google.cloud.vertexai.api.FileData.Builder, + com.google.cloud.vertexai.api.FileDataOrBuilder> + fileDataBuilder_; + /** + * + * + *
+     * Optional. URI based data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fileData field is set. + */ + @java.lang.Override + public boolean hasFileData() { + return dataCase_ == 3; + } + /** + * + * + *
+     * Optional. URI based data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fileData. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FileData getFileData() { + if (fileDataBuilder_ == null) { + if (dataCase_ == 3) { + return (com.google.cloud.vertexai.api.FileData) data_; + } + return com.google.cloud.vertexai.api.FileData.getDefaultInstance(); + } else { + if (dataCase_ == 3) { + return fileDataBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.FileData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. URI based data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFileData(com.google.cloud.vertexai.api.FileData value) { + if (fileDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + fileDataBuilder_.setMessage(value); + } + dataCase_ = 3; + return this; + } + /** + * + * + *
+     * Optional. URI based data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFileData(com.google.cloud.vertexai.api.FileData.Builder builderForValue) { + if (fileDataBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + fileDataBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 3; + return this; + } + /** + * + * + *
+     * Optional. URI based data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFileData(com.google.cloud.vertexai.api.FileData value) { + if (fileDataBuilder_ == null) { + if (dataCase_ == 3 + && data_ != com.google.cloud.vertexai.api.FileData.getDefaultInstance()) { + data_ = + com.google.cloud.vertexai.api.FileData.newBuilder( + (com.google.cloud.vertexai.api.FileData) data_) + .mergeFrom(value) + .buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 3) { + fileDataBuilder_.mergeFrom(value); + } else { + fileDataBuilder_.setMessage(value); + } + } + dataCase_ = 3; + return this; + } + /** + * + * + *
+     * Optional. URI based data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFileData() { + if (fileDataBuilder_ == null) { + if (dataCase_ == 3) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 3) { + dataCase_ = 0; + data_ = null; + } + fileDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. URI based data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.FileData.Builder getFileDataBuilder() { + return getFileDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. URI based data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FileDataOrBuilder getFileDataOrBuilder() { + if ((dataCase_ == 3) && (fileDataBuilder_ != null)) { + return fileDataBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 3) { + return (com.google.cloud.vertexai.api.FileData) data_; + } + return com.google.cloud.vertexai.api.FileData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. URI based data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FileData, + com.google.cloud.vertexai.api.FileData.Builder, + com.google.cloud.vertexai.api.FileDataOrBuilder> + getFileDataFieldBuilder() { + if (fileDataBuilder_ == null) { + if (!(dataCase_ == 3)) { + data_ = com.google.cloud.vertexai.api.FileData.getDefaultInstance(); + } + fileDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FileData, + com.google.cloud.vertexai.api.FileData.Builder, + com.google.cloud.vertexai.api.FileDataOrBuilder>( + (com.google.cloud.vertexai.api.FileData) data_, getParentForChildren(), isClean()); + data_ = null; + } + dataCase_ = 3; + onChanged(); + return fileDataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FunctionCall, + com.google.cloud.vertexai.api.FunctionCall.Builder, + com.google.cloud.vertexai.api.FunctionCallOrBuilder> + functionCallBuilder_; + /** + * + * + *
+     * Optional. A predicted [FunctionCall] returned from the model that
+     * contains a string representing the [FunctionDeclaration.name] with the
+     * parameters and their values.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the functionCall field is set. + */ + @java.lang.Override + public boolean hasFunctionCall() { + return dataCase_ == 5; + } + /** + * + * + *
+     * Optional. A predicted [FunctionCall] returned from the model that
+     * contains a string representing the [FunctionDeclaration.name] with the
+     * parameters and their values.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The functionCall. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionCall getFunctionCall() { + if (functionCallBuilder_ == null) { + if (dataCase_ == 5) { + return (com.google.cloud.vertexai.api.FunctionCall) data_; + } + return com.google.cloud.vertexai.api.FunctionCall.getDefaultInstance(); + } else { + if (dataCase_ == 5) { + return functionCallBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.FunctionCall.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. A predicted [FunctionCall] returned from the model that
+     * contains a string representing the [FunctionDeclaration.name] with the
+     * parameters and their values.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFunctionCall(com.google.cloud.vertexai.api.FunctionCall value) { + if (functionCallBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + functionCallBuilder_.setMessage(value); + } + dataCase_ = 5; + return this; + } + /** + * + * + *
+     * Optional. A predicted [FunctionCall] returned from the model that
+     * contains a string representing the [FunctionDeclaration.name] with the
+     * parameters and their values.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFunctionCall( + com.google.cloud.vertexai.api.FunctionCall.Builder builderForValue) { + if (functionCallBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + functionCallBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 5; + return this; + } + /** + * + * + *
+     * Optional. A predicted [FunctionCall] returned from the model that
+     * contains a string representing the [FunctionDeclaration.name] with the
+     * parameters and their values.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFunctionCall(com.google.cloud.vertexai.api.FunctionCall value) { + if (functionCallBuilder_ == null) { + if (dataCase_ == 5 + && data_ != com.google.cloud.vertexai.api.FunctionCall.getDefaultInstance()) { + data_ = + com.google.cloud.vertexai.api.FunctionCall.newBuilder( + (com.google.cloud.vertexai.api.FunctionCall) data_) + .mergeFrom(value) + .buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 5) { + functionCallBuilder_.mergeFrom(value); + } else { + functionCallBuilder_.setMessage(value); + } + } + dataCase_ = 5; + return this; + } + /** + * + * + *
+     * Optional. A predicted [FunctionCall] returned from the model that
+     * contains a string representing the [FunctionDeclaration.name] with the
+     * parameters and their values.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFunctionCall() { + if (functionCallBuilder_ == null) { + if (dataCase_ == 5) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 5) { + dataCase_ = 0; + data_ = null; + } + functionCallBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. A predicted [FunctionCall] returned from the model that
+     * contains a string representing the [FunctionDeclaration.name] with the
+     * parameters and their values.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.FunctionCall.Builder getFunctionCallBuilder() { + return getFunctionCallFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. A predicted [FunctionCall] returned from the model that
+     * contains a string representing the [FunctionDeclaration.name] with the
+     * parameters and their values.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionCallOrBuilder getFunctionCallOrBuilder() { + if ((dataCase_ == 5) && (functionCallBuilder_ != null)) { + return functionCallBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 5) { + return (com.google.cloud.vertexai.api.FunctionCall) data_; + } + return com.google.cloud.vertexai.api.FunctionCall.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. A predicted [FunctionCall] returned from the model that
+     * contains a string representing the [FunctionDeclaration.name] with the
+     * parameters and their values.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FunctionCall, + com.google.cloud.vertexai.api.FunctionCall.Builder, + com.google.cloud.vertexai.api.FunctionCallOrBuilder> + getFunctionCallFieldBuilder() { + if (functionCallBuilder_ == null) { + if (!(dataCase_ == 5)) { + data_ = com.google.cloud.vertexai.api.FunctionCall.getDefaultInstance(); + } + functionCallBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FunctionCall, + com.google.cloud.vertexai.api.FunctionCall.Builder, + com.google.cloud.vertexai.api.FunctionCallOrBuilder>( + (com.google.cloud.vertexai.api.FunctionCall) data_, + getParentForChildren(), + isClean()); + data_ = null; + } + dataCase_ = 5; + onChanged(); + return functionCallBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FunctionResponse, + com.google.cloud.vertexai.api.FunctionResponse.Builder, + com.google.cloud.vertexai.api.FunctionResponseOrBuilder> + functionResponseBuilder_; + /** + * + * + *
+     * Optional. The result output of a [FunctionCall] that contains a string
+     * representing the [FunctionDeclaration.name] and a structured JSON object
+     * containing any output from the function call. It is used as context to
+     * the model.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the functionResponse field is set. + */ + @java.lang.Override + public boolean hasFunctionResponse() { + return dataCase_ == 6; + } + /** + * + * + *
+     * Optional. The result output of a [FunctionCall] that contains a string
+     * representing the [FunctionDeclaration.name] and a structured JSON object
+     * containing any output from the function call. It is used as context to
+     * the model.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The functionResponse. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionResponse getFunctionResponse() { + if (functionResponseBuilder_ == null) { + if (dataCase_ == 6) { + return (com.google.cloud.vertexai.api.FunctionResponse) data_; + } + return com.google.cloud.vertexai.api.FunctionResponse.getDefaultInstance(); + } else { + if (dataCase_ == 6) { + return functionResponseBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.FunctionResponse.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. The result output of a [FunctionCall] that contains a string
+     * representing the [FunctionDeclaration.name] and a structured JSON object
+     * containing any output from the function call. It is used as context to
+     * the model.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFunctionResponse(com.google.cloud.vertexai.api.FunctionResponse value) { + if (functionResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + functionResponseBuilder_.setMessage(value); + } + dataCase_ = 6; + return this; + } + /** + * + * + *
+     * Optional. The result output of a [FunctionCall] that contains a string
+     * representing the [FunctionDeclaration.name] and a structured JSON object
+     * containing any output from the function call. It is used as context to
+     * the model.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFunctionResponse( + com.google.cloud.vertexai.api.FunctionResponse.Builder builderForValue) { + if (functionResponseBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + functionResponseBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 6; + return this; + } + /** + * + * + *
+     * Optional. The result output of a [FunctionCall] that contains a string
+     * representing the [FunctionDeclaration.name] and a structured JSON object
+     * containing any output from the function call. It is used as context to
+     * the model.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFunctionResponse(com.google.cloud.vertexai.api.FunctionResponse value) { + if (functionResponseBuilder_ == null) { + if (dataCase_ == 6 + && data_ != com.google.cloud.vertexai.api.FunctionResponse.getDefaultInstance()) { + data_ = + com.google.cloud.vertexai.api.FunctionResponse.newBuilder( + (com.google.cloud.vertexai.api.FunctionResponse) data_) + .mergeFrom(value) + .buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 6) { + functionResponseBuilder_.mergeFrom(value); + } else { + functionResponseBuilder_.setMessage(value); + } + } + dataCase_ = 6; + return this; + } + /** + * + * + *
+     * Optional. The result output of a [FunctionCall] that contains a string
+     * representing the [FunctionDeclaration.name] and a structured JSON object
+     * containing any output from the function call. It is used as context to
+     * the model.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFunctionResponse() { + if (functionResponseBuilder_ == null) { + if (dataCase_ == 6) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 6) { + dataCase_ = 0; + data_ = null; + } + functionResponseBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. The result output of a [FunctionCall] that contains a string
+     * representing the [FunctionDeclaration.name] and a structured JSON object
+     * containing any output from the function call. It is used as context to
+     * the model.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.FunctionResponse.Builder getFunctionResponseBuilder() { + return getFunctionResponseFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The result output of a [FunctionCall] that contains a string
+     * representing the [FunctionDeclaration.name] and a structured JSON object
+     * containing any output from the function call. It is used as context to
+     * the model.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionResponseOrBuilder getFunctionResponseOrBuilder() { + if ((dataCase_ == 6) && (functionResponseBuilder_ != null)) { + return functionResponseBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 6) { + return (com.google.cloud.vertexai.api.FunctionResponse) data_; + } + return com.google.cloud.vertexai.api.FunctionResponse.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. The result output of a [FunctionCall] that contains a string
+     * representing the [FunctionDeclaration.name] and a structured JSON object
+     * containing any output from the function call. It is used as context to
+     * the model.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FunctionResponse, + com.google.cloud.vertexai.api.FunctionResponse.Builder, + com.google.cloud.vertexai.api.FunctionResponseOrBuilder> + getFunctionResponseFieldBuilder() { + if (functionResponseBuilder_ == null) { + if (!(dataCase_ == 6)) { + data_ = com.google.cloud.vertexai.api.FunctionResponse.getDefaultInstance(); + } + functionResponseBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FunctionResponse, + com.google.cloud.vertexai.api.FunctionResponse.Builder, + com.google.cloud.vertexai.api.FunctionResponseOrBuilder>( + (com.google.cloud.vertexai.api.FunctionResponse) data_, + getParentForChildren(), + isClean()); + data_ = null; + } + dataCase_ = 6; + onChanged(); + return functionResponseBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.VideoMetadata, + com.google.cloud.vertexai.api.VideoMetadata.Builder, + com.google.cloud.vertexai.api.VideoMetadataOrBuilder> + videoMetadataBuilder_; + /** + * + * + *
+     * Optional. Video metadata. The metadata should only be specified while the
+     * video data is presented in inline_data or file_data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the videoMetadata field is set. + */ + @java.lang.Override + public boolean hasVideoMetadata() { + return metadataCase_ == 4; + } + /** + * + * + *
+     * Optional. Video metadata. The metadata should only be specified while the
+     * video data is presented in inline_data or file_data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The videoMetadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.VideoMetadata getVideoMetadata() { + if (videoMetadataBuilder_ == null) { + if (metadataCase_ == 4) { + return (com.google.cloud.vertexai.api.VideoMetadata) metadata_; + } + return com.google.cloud.vertexai.api.VideoMetadata.getDefaultInstance(); + } else { + if (metadataCase_ == 4) { + return videoMetadataBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.VideoMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Video metadata. The metadata should only be specified while the
+     * video data is presented in inline_data or file_data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setVideoMetadata(com.google.cloud.vertexai.api.VideoMetadata value) { + if (videoMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + videoMetadataBuilder_.setMessage(value); + } + metadataCase_ = 4; + return this; + } + /** + * + * + *
+     * Optional. Video metadata. The metadata should only be specified while the
+     * video data is presented in inline_data or file_data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setVideoMetadata( + com.google.cloud.vertexai.api.VideoMetadata.Builder builderForValue) { + if (videoMetadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + videoMetadataBuilder_.setMessage(builderForValue.build()); + } + metadataCase_ = 4; + return this; + } + /** + * + * + *
+     * Optional. Video metadata. The metadata should only be specified while the
+     * video data is presented in inline_data or file_data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeVideoMetadata(com.google.cloud.vertexai.api.VideoMetadata value) { + if (videoMetadataBuilder_ == null) { + if (metadataCase_ == 4 + && metadata_ != com.google.cloud.vertexai.api.VideoMetadata.getDefaultInstance()) { + metadata_ = + com.google.cloud.vertexai.api.VideoMetadata.newBuilder( + (com.google.cloud.vertexai.api.VideoMetadata) metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + if (metadataCase_ == 4) { + videoMetadataBuilder_.mergeFrom(value); + } else { + videoMetadataBuilder_.setMessage(value); + } + } + metadataCase_ = 4; + return this; + } + /** + * + * + *
+     * Optional. Video metadata. The metadata should only be specified while the
+     * video data is presented in inline_data or file_data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearVideoMetadata() { + if (videoMetadataBuilder_ == null) { + if (metadataCase_ == 4) { + metadataCase_ = 0; + metadata_ = null; + onChanged(); + } + } else { + if (metadataCase_ == 4) { + metadataCase_ = 0; + metadata_ = null; + } + videoMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Video metadata. The metadata should only be specified while the
+     * video data is presented in inline_data or file_data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.VideoMetadata.Builder getVideoMetadataBuilder() { + return getVideoMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Video metadata. The metadata should only be specified while the
+     * video data is presented in inline_data or file_data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.VideoMetadataOrBuilder getVideoMetadataOrBuilder() { + if ((metadataCase_ == 4) && (videoMetadataBuilder_ != null)) { + return videoMetadataBuilder_.getMessageOrBuilder(); + } else { + if (metadataCase_ == 4) { + return (com.google.cloud.vertexai.api.VideoMetadata) metadata_; + } + return com.google.cloud.vertexai.api.VideoMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Video metadata. The metadata should only be specified while the
+     * video data is presented in inline_data or file_data.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.VideoMetadata, + com.google.cloud.vertexai.api.VideoMetadata.Builder, + com.google.cloud.vertexai.api.VideoMetadataOrBuilder> + getVideoMetadataFieldBuilder() { + if (videoMetadataBuilder_ == null) { + if (!(metadataCase_ == 4)) { + metadata_ = com.google.cloud.vertexai.api.VideoMetadata.getDefaultInstance(); + } + videoMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.VideoMetadata, + com.google.cloud.vertexai.api.VideoMetadata.Builder, + com.google.cloud.vertexai.api.VideoMetadataOrBuilder>( + (com.google.cloud.vertexai.api.VideoMetadata) metadata_, + getParentForChildren(), + isClean()); + metadata_ = null; + } + metadataCase_ = 4; + onChanged(); + return videoMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Part) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Part) + private static final com.google.cloud.vertexai.api.Part DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Part(); + } + + public static com.google.cloud.vertexai.api.Part getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Part parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Part getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PartOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PartOrBuilder.java new file mode 100644 index 000000000000..81a28caef87a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PartOrBuilder.java @@ -0,0 +1,289 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface PartOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Part) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Text part (can be code).
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the text field is set. + */ + boolean hasText(); + /** + * + * + *
+   * Optional. Text part (can be code).
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The text. + */ + java.lang.String getText(); + /** + * + * + *
+   * Optional. Text part (can be code).
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
+   * Optional. Inlined bytes data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inlineData field is set. + */ + boolean hasInlineData(); + /** + * + * + *
+   * Optional. Inlined bytes data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inlineData. + */ + com.google.cloud.vertexai.api.Blob getInlineData(); + /** + * + * + *
+   * Optional. Inlined bytes data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Blob inline_data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.BlobOrBuilder getInlineDataOrBuilder(); + + /** + * + * + *
+   * Optional. URI based data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fileData field is set. + */ + boolean hasFileData(); + /** + * + * + *
+   * Optional. URI based data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fileData. + */ + com.google.cloud.vertexai.api.FileData getFileData(); + /** + * + * + *
+   * Optional. URI based data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FileData file_data = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.FileDataOrBuilder getFileDataOrBuilder(); + + /** + * + * + *
+   * Optional. A predicted [FunctionCall] returned from the model that
+   * contains a string representing the [FunctionDeclaration.name] with the
+   * parameters and their values.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the functionCall field is set. + */ + boolean hasFunctionCall(); + /** + * + * + *
+   * Optional. A predicted [FunctionCall] returned from the model that
+   * contains a string representing the [FunctionDeclaration.name] with the
+   * parameters and their values.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The functionCall. + */ + com.google.cloud.vertexai.api.FunctionCall getFunctionCall(); + /** + * + * + *
+   * Optional. A predicted [FunctionCall] returned from the model that
+   * contains a string representing the [FunctionDeclaration.name] with the
+   * parameters and their values.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionCall function_call = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.FunctionCallOrBuilder getFunctionCallOrBuilder(); + + /** + * + * + *
+   * Optional. The result output of a [FunctionCall] that contains a string
+   * representing the [FunctionDeclaration.name] and a structured JSON object
+   * containing any output from the function call. It is used as context to
+   * the model.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the functionResponse field is set. + */ + boolean hasFunctionResponse(); + /** + * + * + *
+   * Optional. The result output of a [FunctionCall] that contains a string
+   * representing the [FunctionDeclaration.name] and a structured JSON object
+   * containing any output from the function call. It is used as context to
+   * the model.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The functionResponse. + */ + com.google.cloud.vertexai.api.FunctionResponse getFunctionResponse(); + /** + * + * + *
+   * Optional. The result output of a [FunctionCall] that contains a string
+   * representing the [FunctionDeclaration.name] and a structured JSON object
+   * containing any output from the function call. It is used as context to
+   * the model.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.FunctionResponse function_response = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.FunctionResponseOrBuilder getFunctionResponseOrBuilder(); + + /** + * + * + *
+   * Optional. Video metadata. The metadata should only be specified while the
+   * video data is presented in inline_data or file_data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the videoMetadata field is set. + */ + boolean hasVideoMetadata(); + /** + * + * + *
+   * Optional. Video metadata. The metadata should only be specified while the
+   * video data is presented in inline_data or file_data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The videoMetadata. + */ + com.google.cloud.vertexai.api.VideoMetadata getVideoMetadata(); + /** + * + * + *
+   * Optional. Video metadata. The metadata should only be specified while the
+   * video data is presented in inline_data or file_data.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.VideoMetadata video_metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.VideoMetadataOrBuilder getVideoMetadataOrBuilder(); + + com.google.cloud.vertexai.api.Part.DataCase getDataCase(); + + com.google.cloud.vertexai.api.Part.MetadataCase getMetadataCase(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PersistentDiskSpec.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PersistentDiskSpec.java new file mode 100644 index 000000000000..974da02a9f53 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PersistentDiskSpec.java @@ -0,0 +1,747 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Represents the spec of [persistent
+ * disk][https://cloud.google.com/compute/docs/disks/persistent-disks] options.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.PersistentDiskSpec} + */ +public final class PersistentDiskSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.PersistentDiskSpec) + PersistentDiskSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use PersistentDiskSpec.newBuilder() to construct. + private PersistentDiskSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PersistentDiskSpec() { + diskType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PersistentDiskSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_PersistentDiskSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_PersistentDiskSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.PersistentDiskSpec.class, + com.google.cloud.vertexai.api.PersistentDiskSpec.Builder.class); + } + + public static final int DISK_TYPE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object diskType_ = ""; + /** + * + * + *
+   * Type of the disk (default is "pd-standard").
+   * Valid values: "pd-ssd" (Persistent Disk Solid State Drive)
+   * "pd-standard" (Persistent Disk Hard Disk Drive)
+   * "pd-balanced" (Balanced Persistent Disk)
+   * "pd-extreme" (Extreme Persistent Disk)
+   * 
+ * + * string disk_type = 1; + * + * @return The diskType. + */ + @java.lang.Override + public java.lang.String getDiskType() { + java.lang.Object ref = diskType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + diskType_ = s; + return s; + } + } + /** + * + * + *
+   * Type of the disk (default is "pd-standard").
+   * Valid values: "pd-ssd" (Persistent Disk Solid State Drive)
+   * "pd-standard" (Persistent Disk Hard Disk Drive)
+   * "pd-balanced" (Balanced Persistent Disk)
+   * "pd-extreme" (Extreme Persistent Disk)
+   * 
+ * + * string disk_type = 1; + * + * @return The bytes for diskType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDiskTypeBytes() { + java.lang.Object ref = diskType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + diskType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISK_SIZE_GB_FIELD_NUMBER = 2; + private long diskSizeGb_ = 0L; + /** + * + * + *
+   * Size in GB of the disk (default is 100GB).
+   * 
+ * + * int64 disk_size_gb = 2; + * + * @return The diskSizeGb. + */ + @java.lang.Override + public long getDiskSizeGb() { + return diskSizeGb_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diskType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, diskType_); + } + if (diskSizeGb_ != 0L) { + output.writeInt64(2, diskSizeGb_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(diskType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, diskType_); + } + if (diskSizeGb_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, diskSizeGb_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.PersistentDiskSpec)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.PersistentDiskSpec other = + (com.google.cloud.vertexai.api.PersistentDiskSpec) obj; + + if (!getDiskType().equals(other.getDiskType())) return false; + if (getDiskSizeGb() != other.getDiskSizeGb()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDiskType().hashCode(); + hash = (37 * hash) + DISK_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDiskSizeGb()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.PersistentDiskSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the spec of [persistent
+   * disk][https://cloud.google.com/compute/docs/disks/persistent-disks] options.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.PersistentDiskSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.PersistentDiskSpec) + com.google.cloud.vertexai.api.PersistentDiskSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_PersistentDiskSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_PersistentDiskSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.PersistentDiskSpec.class, + com.google.cloud.vertexai.api.PersistentDiskSpec.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.PersistentDiskSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + diskType_ = ""; + diskSizeGb_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_PersistentDiskSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PersistentDiskSpec getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.PersistentDiskSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PersistentDiskSpec build() { + com.google.cloud.vertexai.api.PersistentDiskSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PersistentDiskSpec buildPartial() { + com.google.cloud.vertexai.api.PersistentDiskSpec result = + new com.google.cloud.vertexai.api.PersistentDiskSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.PersistentDiskSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.diskType_ = diskType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.diskSizeGb_ = diskSizeGb_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.PersistentDiskSpec) { + return mergeFrom((com.google.cloud.vertexai.api.PersistentDiskSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.PersistentDiskSpec other) { + if (other == com.google.cloud.vertexai.api.PersistentDiskSpec.getDefaultInstance()) + return this; + if (!other.getDiskType().isEmpty()) { + diskType_ = other.diskType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getDiskSizeGb() != 0L) { + setDiskSizeGb(other.getDiskSizeGb()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + diskType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + diskSizeGb_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object diskType_ = ""; + /** + * + * + *
+     * Type of the disk (default is "pd-standard").
+     * Valid values: "pd-ssd" (Persistent Disk Solid State Drive)
+     * "pd-standard" (Persistent Disk Hard Disk Drive)
+     * "pd-balanced" (Balanced Persistent Disk)
+     * "pd-extreme" (Extreme Persistent Disk)
+     * 
+ * + * string disk_type = 1; + * + * @return The diskType. + */ + public java.lang.String getDiskType() { + java.lang.Object ref = diskType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + diskType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Type of the disk (default is "pd-standard").
+     * Valid values: "pd-ssd" (Persistent Disk Solid State Drive)
+     * "pd-standard" (Persistent Disk Hard Disk Drive)
+     * "pd-balanced" (Balanced Persistent Disk)
+     * "pd-extreme" (Extreme Persistent Disk)
+     * 
+ * + * string disk_type = 1; + * + * @return The bytes for diskType. + */ + public com.google.protobuf.ByteString getDiskTypeBytes() { + java.lang.Object ref = diskType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + diskType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Type of the disk (default is "pd-standard").
+     * Valid values: "pd-ssd" (Persistent Disk Solid State Drive)
+     * "pd-standard" (Persistent Disk Hard Disk Drive)
+     * "pd-balanced" (Balanced Persistent Disk)
+     * "pd-extreme" (Extreme Persistent Disk)
+     * 
+ * + * string disk_type = 1; + * + * @param value The diskType to set. + * @return This builder for chaining. + */ + public Builder setDiskType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + diskType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the disk (default is "pd-standard").
+     * Valid values: "pd-ssd" (Persistent Disk Solid State Drive)
+     * "pd-standard" (Persistent Disk Hard Disk Drive)
+     * "pd-balanced" (Balanced Persistent Disk)
+     * "pd-extreme" (Extreme Persistent Disk)
+     * 
+ * + * string disk_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearDiskType() { + diskType_ = getDefaultInstance().getDiskType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the disk (default is "pd-standard").
+     * Valid values: "pd-ssd" (Persistent Disk Solid State Drive)
+     * "pd-standard" (Persistent Disk Hard Disk Drive)
+     * "pd-balanced" (Balanced Persistent Disk)
+     * "pd-extreme" (Extreme Persistent Disk)
+     * 
+ * + * string disk_type = 1; + * + * @param value The bytes for diskType to set. + * @return This builder for chaining. + */ + public Builder setDiskTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + diskType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long diskSizeGb_; + /** + * + * + *
+     * Size in GB of the disk (default is 100GB).
+     * 
+ * + * int64 disk_size_gb = 2; + * + * @return The diskSizeGb. + */ + @java.lang.Override + public long getDiskSizeGb() { + return diskSizeGb_; + } + /** + * + * + *
+     * Size in GB of the disk (default is 100GB).
+     * 
+ * + * int64 disk_size_gb = 2; + * + * @param value The diskSizeGb to set. + * @return This builder for chaining. + */ + public Builder setDiskSizeGb(long value) { + + diskSizeGb_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Size in GB of the disk (default is 100GB).
+     * 
+ * + * int64 disk_size_gb = 2; + * + * @return This builder for chaining. + */ + public Builder clearDiskSizeGb() { + bitField0_ = (bitField0_ & ~0x00000002); + diskSizeGb_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.PersistentDiskSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.PersistentDiskSpec) + private static final com.google.cloud.vertexai.api.PersistentDiskSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.PersistentDiskSpec(); + } + + public static com.google.cloud.vertexai.api.PersistentDiskSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PersistentDiskSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PersistentDiskSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PersistentDiskSpecOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PersistentDiskSpecOrBuilder.java new file mode 100644 index 000000000000..cc7421473e2b --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PersistentDiskSpecOrBuilder.java @@ -0,0 +1,71 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +public interface PersistentDiskSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.PersistentDiskSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Type of the disk (default is "pd-standard").
+   * Valid values: "pd-ssd" (Persistent Disk Solid State Drive)
+   * "pd-standard" (Persistent Disk Hard Disk Drive)
+   * "pd-balanced" (Balanced Persistent Disk)
+   * "pd-extreme" (Extreme Persistent Disk)
+   * 
+ * + * string disk_type = 1; + * + * @return The diskType. + */ + java.lang.String getDiskType(); + /** + * + * + *
+   * Type of the disk (default is "pd-standard").
+   * Valid values: "pd-ssd" (Persistent Disk Solid State Drive)
+   * "pd-standard" (Persistent Disk Hard Disk Drive)
+   * "pd-balanced" (Balanced Persistent Disk)
+   * "pd-extreme" (Extreme Persistent Disk)
+   * 
+ * + * string disk_type = 1; + * + * @return The bytes for diskType. + */ + com.google.protobuf.ByteString getDiskTypeBytes(); + + /** + * + * + *
+   * Size in GB of the disk (default is 100GB).
+   * 
+ * + * int64 disk_size_gb = 2; + * + * @return The diskSizeGb. + */ + long getDiskSizeGb(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequest.java new file mode 100644 index 000000000000..1989795bf30c --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequest.java @@ -0,0 +1,1690 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [PredictionService.Predict][google.cloud.vertexai.v1beta1.PredictionService.Predict].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.PredictRequest} + */ +public final class PredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.PredictRequest) + PredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictRequest.newBuilder() to construct. + private PredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictRequest() { + endpoint_ = ""; + instances_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_PredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.PredictRequest.class, + com.google.cloud.vertexai.api.PredictRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getInstancesList() { + return 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getInstancesOrBuilderList() { + return 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.Value getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int PARAMETERS_FIELD_NUMBER = 3; + private com.google.protobuf.Value 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].
+   * 
+ * + * .google.protobuf.Value parameters = 3; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * 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].
+   * 
+ * + * .google.protobuf.Value parameters = 3; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.protobuf.Value getParameters() { + return parameters_ == null ? com.google.protobuf.Value.getDefaultInstance() : 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].
+   * 
+ * + * .google.protobuf.Value parameters = 3; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getParametersOrBuilder() { + return parameters_ == null ? com.google.protobuf.Value.getDefaultInstance() : parameters_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + for (int i = 0; i < instances_.size(); i++) { + output.writeMessage(2, instances_.get(i)); + } + if (parameters_ != null) { + output.writeMessage(3, getParameters()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, instances_.get(i)); + } + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getParameters()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.PredictRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.PredictRequest other = + (com.google.cloud.vertexai.api.PredictRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.PredictRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PredictRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.PredictRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [PredictionService.Predict][google.cloud.vertexai.v1beta1.PredictionService.Predict].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.PredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.PredictRequest) + com.google.cloud.vertexai.api.PredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_PredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_PredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.PredictRequest.class, + com.google.cloud.vertexai.api.PredictRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.PredictRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_PredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.PredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictRequest build() { + com.google.cloud.vertexai.api.PredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictRequest buildPartial() { + com.google.cloud.vertexai.api.PredictRequest result = + new com.google.cloud.vertexai.api.PredictRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.PredictRequest result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.PredictRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.parameters_ = parametersBuilder_ == null ? parameters_ : parametersBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.PredictRequest) { + return mergeFrom((com.google.cloud.vertexai.api.PredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.PredictRequest other) { + if (other == com.google.cloud.vertexai.api.PredictRequest.getDefaultInstance()) return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000002); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.protobuf.Value m = + input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + input.readMessage(getParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstances(int index, com.google.protobuf.Value value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstances(int index, com.google.protobuf.Value.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(com.google.protobuf.Value value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(int index, com.google.protobuf.Value value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(com.google.protobuf.Value.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addInstances(int index, com.google.protobuf.Value.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllInstances(java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value.Builder addInstancesBuilder() { + return getInstancesFieldBuilder().addBuilder(com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Value.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + instances_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private com.google.protobuf.Value parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 3; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 3; + * + * @return The parameters. + */ + public com.google.protobuf.Value getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null ? com.google.protobuf.Value.getDefaultInstance() : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 3; + */ + public Builder setParameters(com.google.protobuf.Value value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + } else { + parametersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 3; + */ + public Builder setParameters(com.google.protobuf.Value.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 3; + */ + public Builder mergeParameters(com.google.protobuf.Value value) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && parameters_ != null + && parameters_ != com.google.protobuf.Value.getDefaultInstance()) { + getParametersBuilder().mergeFrom(value); + } else { + parameters_ = value; + } + } else { + parametersBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 3; + */ + public Builder clearParameters() { + bitField0_ = (bitField0_ & ~0x00000004); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 3; + */ + public com.google.protobuf.Value.Builder getParametersBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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].
+     * 
+ * + * .google.protobuf.Value parameters = 3; + */ + public com.google.protobuf.ValueOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null ? com.google.protobuf.Value.getDefaultInstance() : 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].
+     * 
+ * + * .google.protobuf.Value parameters = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.PredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.PredictRequest) + private static final com.google.cloud.vertexai.api.PredictRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.PredictRequest(); + } + + public static com.google.cloud.vertexai.api.PredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequestOrBuilder.java new file mode 100644 index 000000000000..1b76b43e1bed --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequestOrBuilder.java @@ -0,0 +1,206 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface PredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.PredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.Value getInstances(int index); + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getInstancesCount(); + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getInstancesOrBuilderList(); + /** + * + * + *
+   * 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].
+   * 
+ * + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index); + + /** + * + * + *
+   * 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].
+   * 
+ * + * .google.protobuf.Value parameters = 3; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * 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].
+   * 
+ * + * .google.protobuf.Value parameters = 3; + * + * @return The parameters. + */ + com.google.protobuf.Value getParameters(); + /** + * + * + *
+   * 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].
+   * 
+ * + * .google.protobuf.Value parameters = 3; + */ + com.google.protobuf.ValueOrBuilder getParametersOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequestResponseLoggingConfig.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequestResponseLoggingConfig.java new file mode 100644 index 000000000000..d66061fa64b2 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequestResponseLoggingConfig.java @@ -0,0 +1,981 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Configuration for logging request-response to a BigQuery table.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig} + */ +public final class PredictRequestResponseLoggingConfig + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig) + PredictRequestResponseLoggingConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictRequestResponseLoggingConfig.newBuilder() to construct. + private PredictRequestResponseLoggingConfig( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictRequestResponseLoggingConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictRequestResponseLoggingConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_PredictRequestResponseLoggingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_PredictRequestResponseLoggingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.class, + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.Builder.class); + } + + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + /** + * + * + *
+   * If logging is enabled or not.
+   * 
+ * + * bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int SAMPLING_RATE_FIELD_NUMBER = 2; + private double samplingRate_ = 0D; + /** + * + * + *
+   * Percentage of requests to be logged, expressed as a fraction in
+   * range(0,1].
+   * 
+ * + * double sampling_rate = 2; + * + * @return The samplingRate. + */ + @java.lang.Override + public double getSamplingRate() { + return samplingRate_; + } + + public static final int BIGQUERY_DESTINATION_FIELD_NUMBER = 3; + private com.google.cloud.vertexai.api.BigQueryDestination bigqueryDestination_; + /** + * + * + *
+   * BigQuery table for logging.
+   * If only given a project, a new dataset will be created with name
+   * `logging_<endpoint-display-name>_<endpoint-id>` where
+   * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+   * most special characters will become underscores). If no table name is
+   * given, a new table will be created with name `request_response_logging`
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + * + * @return Whether the bigqueryDestination field is set. + */ + @java.lang.Override + public boolean hasBigqueryDestination() { + return bigqueryDestination_ != null; + } + /** + * + * + *
+   * BigQuery table for logging.
+   * If only given a project, a new dataset will be created with name
+   * `logging_<endpoint-display-name>_<endpoint-id>` where
+   * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+   * most special characters will become underscores). If no table name is
+   * given, a new table will be created with name `request_response_logging`
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + * + * @return The bigqueryDestination. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.BigQueryDestination getBigqueryDestination() { + return bigqueryDestination_ == null + ? com.google.cloud.vertexai.api.BigQueryDestination.getDefaultInstance() + : bigqueryDestination_; + } + /** + * + * + *
+   * BigQuery table for logging.
+   * If only given a project, a new dataset will be created with name
+   * `logging_<endpoint-display-name>_<endpoint-id>` where
+   * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+   * most special characters will become underscores). If no table name is
+   * given, a new table will be created with name `request_response_logging`
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.BigQueryDestinationOrBuilder + getBigqueryDestinationOrBuilder() { + return bigqueryDestination_ == null + ? com.google.cloud.vertexai.api.BigQueryDestination.getDefaultInstance() + : bigqueryDestination_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (enabled_ != false) { + output.writeBool(1, enabled_); + } + if (java.lang.Double.doubleToRawLongBits(samplingRate_) != 0) { + output.writeDouble(2, samplingRate_); + } + if (bigqueryDestination_ != null) { + output.writeMessage(3, getBigqueryDestination()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); + } + if (java.lang.Double.doubleToRawLongBits(samplingRate_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, samplingRate_); + } + if (bigqueryDestination_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBigqueryDestination()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig other = + (com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig) obj; + + if (getEnabled() != other.getEnabled()) return false; + if (java.lang.Double.doubleToLongBits(getSamplingRate()) + != java.lang.Double.doubleToLongBits(other.getSamplingRate())) return false; + if (hasBigqueryDestination() != other.hasBigqueryDestination()) return false; + if (hasBigqueryDestination()) { + if (!getBigqueryDestination().equals(other.getBigqueryDestination())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + hash = (37 * hash) + SAMPLING_RATE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSamplingRate())); + if (hasBigqueryDestination()) { + hash = (37 * hash) + BIGQUERY_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getBigqueryDestination().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configuration for logging request-response to a BigQuery table.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig) + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_PredictRequestResponseLoggingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_PredictRequestResponseLoggingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.class, + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + samplingRate_ = 0D; + bigqueryDestination_ = null; + if (bigqueryDestinationBuilder_ != null) { + bigqueryDestinationBuilder_.dispose(); + bigqueryDestinationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_PredictRequestResponseLoggingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig build() { + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig buildPartial() { + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig result = + new com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.samplingRate_ = samplingRate_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.bigqueryDestination_ = + bigqueryDestinationBuilder_ == null + ? bigqueryDestination_ + : bigqueryDestinationBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig) { + return mergeFrom((com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig other) { + if (other + == com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig.getDefaultInstance()) + return this; + if (other.getEnabled() != false) { + setEnabled(other.getEnabled()); + } + if (other.getSamplingRate() != 0D) { + setSamplingRate(other.getSamplingRate()); + } + if (other.hasBigqueryDestination()) { + mergeBigqueryDestination(other.getBigqueryDestination()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 17: + { + samplingRate_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 26: + { + input.readMessage( + getBigqueryDestinationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enabled_; + /** + * + * + *
+     * If logging is enabled or not.
+     * 
+ * + * bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + /** + * + * + *
+     * If logging is enabled or not.
+     * 
+ * + * bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * If logging is enabled or not.
+     * 
+ * + * bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private double samplingRate_; + /** + * + * + *
+     * Percentage of requests to be logged, expressed as a fraction in
+     * range(0,1].
+     * 
+ * + * double sampling_rate = 2; + * + * @return The samplingRate. + */ + @java.lang.Override + public double getSamplingRate() { + return samplingRate_; + } + /** + * + * + *
+     * Percentage of requests to be logged, expressed as a fraction in
+     * range(0,1].
+     * 
+ * + * double sampling_rate = 2; + * + * @param value The samplingRate to set. + * @return This builder for chaining. + */ + public Builder setSamplingRate(double value) { + + samplingRate_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Percentage of requests to be logged, expressed as a fraction in
+     * range(0,1].
+     * 
+ * + * double sampling_rate = 2; + * + * @return This builder for chaining. + */ + public Builder clearSamplingRate() { + bitField0_ = (bitField0_ & ~0x00000002); + samplingRate_ = 0D; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.BigQueryDestination bigqueryDestination_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.BigQueryDestination, + com.google.cloud.vertexai.api.BigQueryDestination.Builder, + com.google.cloud.vertexai.api.BigQueryDestinationOrBuilder> + bigqueryDestinationBuilder_; + /** + * + * + *
+     * BigQuery table for logging.
+     * If only given a project, a new dataset will be created with name
+     * `logging_<endpoint-display-name>_<endpoint-id>` where
+     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+     * most special characters will become underscores). If no table name is
+     * given, a new table will be created with name `request_response_logging`
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + * + * @return Whether the bigqueryDestination field is set. + */ + public boolean hasBigqueryDestination() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * BigQuery table for logging.
+     * If only given a project, a new dataset will be created with name
+     * `logging_<endpoint-display-name>_<endpoint-id>` where
+     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+     * most special characters will become underscores). If no table name is
+     * given, a new table will be created with name `request_response_logging`
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + * + * @return The bigqueryDestination. + */ + public com.google.cloud.vertexai.api.BigQueryDestination getBigqueryDestination() { + if (bigqueryDestinationBuilder_ == null) { + return bigqueryDestination_ == null + ? com.google.cloud.vertexai.api.BigQueryDestination.getDefaultInstance() + : bigqueryDestination_; + } else { + return bigqueryDestinationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * BigQuery table for logging.
+     * If only given a project, a new dataset will be created with name
+     * `logging_<endpoint-display-name>_<endpoint-id>` where
+     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+     * most special characters will become underscores). If no table name is
+     * given, a new table will be created with name `request_response_logging`
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + */ + public Builder setBigqueryDestination(com.google.cloud.vertexai.api.BigQueryDestination value) { + if (bigqueryDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bigqueryDestination_ = value; + } else { + bigqueryDestinationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * BigQuery table for logging.
+     * If only given a project, a new dataset will be created with name
+     * `logging_<endpoint-display-name>_<endpoint-id>` where
+     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+     * most special characters will become underscores). If no table name is
+     * given, a new table will be created with name `request_response_logging`
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + */ + public Builder setBigqueryDestination( + com.google.cloud.vertexai.api.BigQueryDestination.Builder builderForValue) { + if (bigqueryDestinationBuilder_ == null) { + bigqueryDestination_ = builderForValue.build(); + } else { + bigqueryDestinationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * BigQuery table for logging.
+     * If only given a project, a new dataset will be created with name
+     * `logging_<endpoint-display-name>_<endpoint-id>` where
+     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+     * most special characters will become underscores). If no table name is
+     * given, a new table will be created with name `request_response_logging`
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + */ + public Builder mergeBigqueryDestination( + com.google.cloud.vertexai.api.BigQueryDestination value) { + if (bigqueryDestinationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && bigqueryDestination_ != null + && bigqueryDestination_ + != com.google.cloud.vertexai.api.BigQueryDestination.getDefaultInstance()) { + getBigqueryDestinationBuilder().mergeFrom(value); + } else { + bigqueryDestination_ = value; + } + } else { + bigqueryDestinationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * BigQuery table for logging.
+     * If only given a project, a new dataset will be created with name
+     * `logging_<endpoint-display-name>_<endpoint-id>` where
+     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+     * most special characters will become underscores). If no table name is
+     * given, a new table will be created with name `request_response_logging`
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + */ + public Builder clearBigqueryDestination() { + bitField0_ = (bitField0_ & ~0x00000004); + bigqueryDestination_ = null; + if (bigqueryDestinationBuilder_ != null) { + bigqueryDestinationBuilder_.dispose(); + bigqueryDestinationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * BigQuery table for logging.
+     * If only given a project, a new dataset will be created with name
+     * `logging_<endpoint-display-name>_<endpoint-id>` where
+     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+     * most special characters will become underscores). If no table name is
+     * given, a new table will be created with name `request_response_logging`
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + */ + public com.google.cloud.vertexai.api.BigQueryDestination.Builder + getBigqueryDestinationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBigqueryDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * BigQuery table for logging.
+     * If only given a project, a new dataset will be created with name
+     * `logging_<endpoint-display-name>_<endpoint-id>` where
+     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+     * most special characters will become underscores). If no table name is
+     * given, a new table will be created with name `request_response_logging`
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + */ + public com.google.cloud.vertexai.api.BigQueryDestinationOrBuilder + getBigqueryDestinationOrBuilder() { + if (bigqueryDestinationBuilder_ != null) { + return bigqueryDestinationBuilder_.getMessageOrBuilder(); + } else { + return bigqueryDestination_ == null + ? com.google.cloud.vertexai.api.BigQueryDestination.getDefaultInstance() + : bigqueryDestination_; + } + } + /** + * + * + *
+     * BigQuery table for logging.
+     * If only given a project, a new dataset will be created with name
+     * `logging_<endpoint-display-name>_<endpoint-id>` where
+     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+     * most special characters will become underscores). If no table name is
+     * given, a new table will be created with name `request_response_logging`
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.BigQueryDestination, + com.google.cloud.vertexai.api.BigQueryDestination.Builder, + com.google.cloud.vertexai.api.BigQueryDestinationOrBuilder> + getBigqueryDestinationFieldBuilder() { + if (bigqueryDestinationBuilder_ == null) { + bigqueryDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.BigQueryDestination, + com.google.cloud.vertexai.api.BigQueryDestination.Builder, + com.google.cloud.vertexai.api.BigQueryDestinationOrBuilder>( + getBigqueryDestination(), getParentForChildren(), isClean()); + bigqueryDestination_ = null; + } + return bigqueryDestinationBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig) + private static final com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig(); + } + + public static com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictRequestResponseLoggingConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequestResponseLoggingConfigOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequestResponseLoggingConfigOrBuilder.java new file mode 100644 index 000000000000..9ff42612ba3e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictRequestResponseLoggingConfigOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint.proto + +package com.google.cloud.vertexai.api; + +public interface PredictRequestResponseLoggingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.PredictRequestResponseLoggingConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If logging is enabled or not.
+   * 
+ * + * bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+   * Percentage of requests to be logged, expressed as a fraction in
+   * range(0,1].
+   * 
+ * + * double sampling_rate = 2; + * + * @return The samplingRate. + */ + double getSamplingRate(); + + /** + * + * + *
+   * BigQuery table for logging.
+   * If only given a project, a new dataset will be created with name
+   * `logging_<endpoint-display-name>_<endpoint-id>` where
+   * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+   * most special characters will become underscores). If no table name is
+   * given, a new table will be created with name `request_response_logging`
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + * + * @return Whether the bigqueryDestination field is set. + */ + boolean hasBigqueryDestination(); + /** + * + * + *
+   * BigQuery table for logging.
+   * If only given a project, a new dataset will be created with name
+   * `logging_<endpoint-display-name>_<endpoint-id>` where
+   * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+   * most special characters will become underscores). If no table name is
+   * given, a new table will be created with name `request_response_logging`
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + * + * @return The bigqueryDestination. + */ + com.google.cloud.vertexai.api.BigQueryDestination getBigqueryDestination(); + /** + * + * + *
+   * BigQuery table for logging.
+   * If only given a project, a new dataset will be created with name
+   * `logging_<endpoint-display-name>_<endpoint-id>` where
+   * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
+   * most special characters will become underscores). If no table name is
+   * given, a new table will be created with name `request_response_logging`
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BigQueryDestination bigquery_destination = 3; + */ + com.google.cloud.vertexai.api.BigQueryDestinationOrBuilder getBigqueryDestinationOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictResponse.java new file mode 100644 index 000000000000..6fa88d94d4a9 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictResponse.java @@ -0,0 +1,2093 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [PredictionService.Predict][google.cloud.vertexai.v1beta1.PredictionService.Predict].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.PredictResponse} + */ +public final class PredictResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.PredictResponse) + PredictResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PredictResponse.newBuilder() to construct. + private PredictResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PredictResponse() { + predictions_ = java.util.Collections.emptyList(); + deployedModelId_ = ""; + model_ = ""; + modelVersionId_ = ""; + modelDisplayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PredictResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_PredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.PredictResponse.class, + com.google.cloud.vertexai.api.PredictResponse.Builder.class); + } + + public static final int PREDICTIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List predictions_; + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * The schema of any single prediction may be specified via Endpoint's
+   * DeployedModels' [Model's
+   * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+   * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+   * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + @java.lang.Override + public java.util.List getPredictionsList() { + return predictions_; + } + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * The schema of any single prediction may be specified via Endpoint's
+   * DeployedModels' [Model's
+   * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+   * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+   * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + @java.lang.Override + public java.util.List + getPredictionsOrBuilderList() { + return predictions_; + } + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * The schema of any single prediction may be specified via Endpoint's
+   * DeployedModels' [Model's
+   * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+   * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+   * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + @java.lang.Override + public int getPredictionsCount() { + return predictions_.size(); + } + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * The schema of any single prediction may be specified via Endpoint's
+   * DeployedModels' [Model's
+   * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+   * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+   * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + @java.lang.Override + public com.google.protobuf.Value getPredictions(int index) { + return predictions_.get(index); + } + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * The schema of any single prediction may be specified via Endpoint's
+   * DeployedModels' [Model's
+   * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+   * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+   * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getPredictionsOrBuilder(int index) { + return predictions_.get(index); + } + + public static final int DEPLOYED_MODEL_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object deployedModelId_ = ""; + /** + * + * + *
+   * ID of the Endpoint's DeployedModel that served this prediction.
+   * 
+ * + * string deployed_model_id = 2; + * + * @return The deployedModelId. + */ + @java.lang.Override + public java.lang.String getDeployedModelId() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedModelId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the Endpoint's DeployedModel that served this prediction.
+   * 
+ * + * string deployed_model_id = 2; + * + * @return The bytes for deployedModelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeployedModelIdBytes() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object model_ = ""; + /** + * + * + *
+   * Output only. The resource name of the Model which is deployed as the
+   * DeployedModel that this prediction hits.
+   * 
+ * + * + * string model = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the Model which is deployed as the
+   * DeployedModel that this prediction hits.
+   * 
+ * + * + * string model = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_VERSION_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object modelVersionId_ = ""; + /** + * + * + *
+   * Output only. The version ID of the Model which is deployed as the
+   * DeployedModel that this prediction hits.
+   * 
+ * + * string model_version_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The modelVersionId. + */ + @java.lang.Override + public java.lang.String getModelVersionId() { + java.lang.Object ref = modelVersionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelVersionId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The version ID of the Model which is deployed as the
+   * DeployedModel that this prediction hits.
+   * 
+ * + * string model_version_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for modelVersionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelVersionIdBytes() { + java.lang.Object ref = modelVersionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelVersionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_DISPLAY_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object modelDisplayName_ = ""; + /** + * + * + *
+   * Output only. The [display
+   * name][google.cloud.vertexai.v1beta1.Model.display_name] of the Model
+   * which is deployed as the DeployedModel that this prediction hits.
+   * 
+ * + * string model_display_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The modelDisplayName. + */ + @java.lang.Override + public java.lang.String getModelDisplayName() { + java.lang.Object ref = modelDisplayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelDisplayName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The [display
+   * name][google.cloud.vertexai.v1beta1.Model.display_name] of the Model
+   * which is deployed as the DeployedModel that this prediction hits.
+   * 
+ * + * string model_display_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for modelDisplayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelDisplayNameBytes() { + java.lang.Object ref = modelDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 6; + private com.google.protobuf.Value metadata_; + /** + * + * + *
+   * Output only. Request-level metadata returned by the model. The metadata
+   * type will be dependent upon the model implementation.
+   * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Output only. Request-level metadata returned by the model. The metadata
+   * type will be dependent upon the model implementation.
+   * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Value getMetadata() { + return metadata_ == null ? com.google.protobuf.Value.getDefaultInstance() : metadata_; + } + /** + * + * + *
+   * Output only. Request-level metadata returned by the model. The metadata
+   * type will be dependent upon the model implementation.
+   * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getMetadataOrBuilder() { + return metadata_ == null ? com.google.protobuf.Value.getDefaultInstance() : metadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < predictions_.size(); i++) { + output.writeMessage(1, predictions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedModelId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deployedModelId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, model_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelDisplayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, modelDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelVersionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, modelVersionId_); + } + if (metadata_ != null) { + output.writeMessage(6, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < predictions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, predictions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedModelId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deployedModelId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, model_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelDisplayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, modelDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelVersionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, modelVersionId_); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.PredictResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.PredictResponse other = + (com.google.cloud.vertexai.api.PredictResponse) obj; + + if (!getPredictionsList().equals(other.getPredictionsList())) return false; + if (!getDeployedModelId().equals(other.getDeployedModelId())) return false; + if (!getModel().equals(other.getModel())) return false; + if (!getModelVersionId().equals(other.getModelVersionId())) return false; + if (!getModelDisplayName().equals(other.getModelDisplayName())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPredictionsCount() > 0) { + hash = (37 * hash) + PREDICTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPredictionsList().hashCode(); + } + hash = (37 * hash) + DEPLOYED_MODEL_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeployedModelId().hashCode(); + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (37 * hash) + MODEL_VERSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getModelVersionId().hashCode(); + hash = (37 * hash) + MODEL_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getModelDisplayName().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.PredictResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PredictResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.PredictResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [PredictionService.Predict][google.cloud.vertexai.v1beta1.PredictionService.Predict].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.PredictResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.PredictResponse) + com.google.cloud.vertexai.api.PredictResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_PredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_PredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.PredictResponse.class, + com.google.cloud.vertexai.api.PredictResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.PredictResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (predictionsBuilder_ == null) { + predictions_ = java.util.Collections.emptyList(); + } else { + predictions_ = null; + predictionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + deployedModelId_ = ""; + model_ = ""; + modelVersionId_ = ""; + modelDisplayName_ = ""; + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_PredictResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.PredictResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictResponse build() { + com.google.cloud.vertexai.api.PredictResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictResponse buildPartial() { + com.google.cloud.vertexai.api.PredictResponse result = + new com.google.cloud.vertexai.api.PredictResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.PredictResponse result) { + if (predictionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + predictions_ = java.util.Collections.unmodifiableList(predictions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.predictions_ = predictions_; + } else { + result.predictions_ = predictionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.PredictResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deployedModelId_ = deployedModelId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.model_ = model_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.modelVersionId_ = modelVersionId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.modelDisplayName_ = modelDisplayName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.PredictResponse) { + return mergeFrom((com.google.cloud.vertexai.api.PredictResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.PredictResponse other) { + if (other == com.google.cloud.vertexai.api.PredictResponse.getDefaultInstance()) return this; + if (predictionsBuilder_ == null) { + if (!other.predictions_.isEmpty()) { + if (predictions_.isEmpty()) { + predictions_ = other.predictions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePredictionsIsMutable(); + predictions_.addAll(other.predictions_); + } + onChanged(); + } + } else { + if (!other.predictions_.isEmpty()) { + if (predictionsBuilder_.isEmpty()) { + predictionsBuilder_.dispose(); + predictionsBuilder_ = null; + predictions_ = other.predictions_; + bitField0_ = (bitField0_ & ~0x00000001); + predictionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPredictionsFieldBuilder() + : null; + } else { + predictionsBuilder_.addAllMessages(other.predictions_); + } + } + } + if (!other.getDeployedModelId().isEmpty()) { + deployedModelId_ = other.deployedModelId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getModelVersionId().isEmpty()) { + modelVersionId_ = other.modelVersionId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getModelDisplayName().isEmpty()) { + modelDisplayName_ = other.modelDisplayName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Value m = + input.readMessage(com.google.protobuf.Value.parser(), extensionRegistry); + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + predictions_.add(m); + } else { + predictionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + deployedModelId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + model_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + modelDisplayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + modelVersionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List predictions_ = + java.util.Collections.emptyList(); + + private void ensurePredictionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + predictions_ = new java.util.ArrayList(predictions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + predictionsBuilder_; + + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public java.util.List getPredictionsList() { + if (predictionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(predictions_); + } else { + return predictionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public int getPredictionsCount() { + if (predictionsBuilder_ == null) { + return predictions_.size(); + } else { + return predictionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public com.google.protobuf.Value getPredictions(int index) { + if (predictionsBuilder_ == null) { + return predictions_.get(index); + } else { + return predictionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public Builder setPredictions(int index, com.google.protobuf.Value value) { + if (predictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePredictionsIsMutable(); + predictions_.set(index, value); + onChanged(); + } else { + predictionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public Builder setPredictions(int index, com.google.protobuf.Value.Builder builderForValue) { + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + predictions_.set(index, builderForValue.build()); + onChanged(); + } else { + predictionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public Builder addPredictions(com.google.protobuf.Value value) { + if (predictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePredictionsIsMutable(); + predictions_.add(value); + onChanged(); + } else { + predictionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public Builder addPredictions(int index, com.google.protobuf.Value value) { + if (predictionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePredictionsIsMutable(); + predictions_.add(index, value); + onChanged(); + } else { + predictionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public Builder addPredictions(com.google.protobuf.Value.Builder builderForValue) { + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + predictions_.add(builderForValue.build()); + onChanged(); + } else { + predictionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public Builder addPredictions(int index, com.google.protobuf.Value.Builder builderForValue) { + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + predictions_.add(index, builderForValue.build()); + onChanged(); + } else { + predictionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public Builder addAllPredictions( + java.lang.Iterable values) { + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, predictions_); + onChanged(); + } else { + predictionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public Builder clearPredictions() { + if (predictionsBuilder_ == null) { + predictions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + predictionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public Builder removePredictions(int index) { + if (predictionsBuilder_ == null) { + ensurePredictionsIsMutable(); + predictions_.remove(index); + onChanged(); + } else { + predictionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public com.google.protobuf.Value.Builder getPredictionsBuilder(int index) { + return getPredictionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public com.google.protobuf.ValueOrBuilder getPredictionsOrBuilder(int index) { + if (predictionsBuilder_ == null) { + return predictions_.get(index); + } else { + return predictionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public java.util.List + getPredictionsOrBuilderList() { + if (predictionsBuilder_ != null) { + return predictionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(predictions_); + } + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public com.google.protobuf.Value.Builder addPredictionsBuilder() { + return getPredictionsFieldBuilder() + .addBuilder(com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public com.google.protobuf.Value.Builder addPredictionsBuilder(int index) { + return getPredictionsFieldBuilder() + .addBuilder(index, com.google.protobuf.Value.getDefaultInstance()); + } + /** + * + * + *
+     * The predictions that are the output of the predictions call.
+     * The schema of any single prediction may be specified via Endpoint's
+     * DeployedModels' [Model's
+     * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+     * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+     * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+     * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + public java.util.List getPredictionsBuilderList() { + return getPredictionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getPredictionsFieldBuilder() { + if (predictionsBuilder_ == null) { + predictionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + predictions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + predictions_ = null; + } + return predictionsBuilder_; + } + + private java.lang.Object deployedModelId_ = ""; + /** + * + * + *
+     * ID of the Endpoint's DeployedModel that served this prediction.
+     * 
+ * + * string deployed_model_id = 2; + * + * @return The deployedModelId. + */ + public java.lang.String getDeployedModelId() { + java.lang.Object ref = deployedModelId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedModelId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the Endpoint's DeployedModel that served this prediction.
+     * 
+ * + * string deployed_model_id = 2; + * + * @return The bytes for deployedModelId. + */ + public com.google.protobuf.ByteString getDeployedModelIdBytes() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the Endpoint's DeployedModel that served this prediction.
+     * 
+ * + * string deployed_model_id = 2; + * + * @param value The deployedModelId to set. + * @return This builder for chaining. + */ + public Builder setDeployedModelId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + deployedModelId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the Endpoint's DeployedModel that served this prediction.
+     * 
+ * + * string deployed_model_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearDeployedModelId() { + deployedModelId_ = getDefaultInstance().getDeployedModelId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the Endpoint's DeployedModel that served this prediction.
+     * 
+ * + * string deployed_model_id = 2; + * + * @param value The bytes for deployedModelId to set. + * @return This builder for chaining. + */ + public Builder setDeployedModelIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + deployedModelId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object model_ = ""; + /** + * + * + *
+     * Output only. The resource name of the Model which is deployed as the
+     * DeployedModel that this prediction hits.
+     * 
+ * + * + * string model = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Model which is deployed as the
+     * DeployedModel that this prediction hits.
+     * 
+ * + * + * string model = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for model. + */ + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Model which is deployed as the
+     * DeployedModel that this prediction hits.
+     * 
+ * + * + * string model = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + model_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Model which is deployed as the
+     * DeployedModel that this prediction hits.
+     * 
+ * + * + * string model = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearModel() { + model_ = getDefaultInstance().getModel(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Model which is deployed as the
+     * DeployedModel that this prediction hits.
+     * 
+ * + * + * string model = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + model_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object modelVersionId_ = ""; + /** + * + * + *
+     * Output only. The version ID of the Model which is deployed as the
+     * DeployedModel that this prediction hits.
+     * 
+ * + * string model_version_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The modelVersionId. + */ + public java.lang.String getModelVersionId() { + java.lang.Object ref = modelVersionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelVersionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The version ID of the Model which is deployed as the
+     * DeployedModel that this prediction hits.
+     * 
+ * + * string model_version_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for modelVersionId. + */ + public com.google.protobuf.ByteString getModelVersionIdBytes() { + java.lang.Object ref = modelVersionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelVersionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The version ID of the Model which is deployed as the
+     * DeployedModel that this prediction hits.
+     * 
+ * + * string model_version_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The modelVersionId to set. + * @return This builder for chaining. + */ + public Builder setModelVersionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + modelVersionId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version ID of the Model which is deployed as the
+     * DeployedModel that this prediction hits.
+     * 
+ * + * string model_version_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearModelVersionId() { + modelVersionId_ = getDefaultInstance().getModelVersionId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version ID of the Model which is deployed as the
+     * DeployedModel that this prediction hits.
+     * 
+ * + * string model_version_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for modelVersionId to set. + * @return This builder for chaining. + */ + public Builder setModelVersionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + modelVersionId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object modelDisplayName_ = ""; + /** + * + * + *
+     * Output only. The [display
+     * name][google.cloud.vertexai.v1beta1.Model.display_name] of the Model
+     * which is deployed as the DeployedModel that this prediction hits.
+     * 
+ * + * string model_display_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The modelDisplayName. + */ + public java.lang.String getModelDisplayName() { + java.lang.Object ref = modelDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The [display
+     * name][google.cloud.vertexai.v1beta1.Model.display_name] of the Model
+     * which is deployed as the DeployedModel that this prediction hits.
+     * 
+ * + * string model_display_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for modelDisplayName. + */ + public com.google.protobuf.ByteString getModelDisplayNameBytes() { + java.lang.Object ref = modelDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The [display
+     * name][google.cloud.vertexai.v1beta1.Model.display_name] of the Model
+     * which is deployed as the DeployedModel that this prediction hits.
+     * 
+ * + * string model_display_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The modelDisplayName to set. + * @return This builder for chaining. + */ + public Builder setModelDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + modelDisplayName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The [display
+     * name][google.cloud.vertexai.v1beta1.Model.display_name] of the Model
+     * which is deployed as the DeployedModel that this prediction hits.
+     * 
+ * + * string model_display_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearModelDisplayName() { + modelDisplayName_ = getDefaultInstance().getModelDisplayName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The [display
+     * name][google.cloud.vertexai.v1beta1.Model.display_name] of the Model
+     * which is deployed as the DeployedModel that this prediction hits.
+     * 
+ * + * string model_display_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for modelDisplayName to set. + * @return This builder for chaining. + */ + public Builder setModelDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + modelDisplayName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.Value metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Output only. Request-level metadata returned by the model. The metadata
+     * type will be dependent upon the model implementation.
+     * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Request-level metadata returned by the model. The metadata
+     * type will be dependent upon the model implementation.
+     * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The metadata. + */ + public com.google.protobuf.Value getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Value.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Request-level metadata returned by the model. The metadata
+     * type will be dependent upon the model implementation.
+     * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMetadata(com.google.protobuf.Value value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Request-level metadata returned by the model. The metadata
+     * type will be dependent upon the model implementation.
+     * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMetadata(com.google.protobuf.Value.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Request-level metadata returned by the model. The metadata
+     * type will be dependent upon the model implementation.
+     * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMetadata(com.google.protobuf.Value value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && metadata_ != null + && metadata_ != com.google.protobuf.Value.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Request-level metadata returned by the model. The metadata
+     * type will be dependent upon the model implementation.
+     * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000020); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Request-level metadata returned by the model. The metadata
+     * type will be dependent upon the model implementation.
+     * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Value.Builder getMetadataBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Request-level metadata returned by the model. The metadata
+     * type will be dependent upon the model implementation.
+     * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.ValueOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? com.google.protobuf.Value.getDefaultInstance() : metadata_; + } + } + /** + * + * + *
+     * Output only. Request-level metadata returned by the model. The metadata
+     * type will be dependent upon the model implementation.
+     * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.PredictResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.PredictResponse) + private static final com.google.cloud.vertexai.api.PredictResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.PredictResponse(); + } + + public static com.google.cloud.vertexai.api.PredictResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredictResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PredictResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictResponseOrBuilder.java new file mode 100644 index 000000000000..f5cce51c189f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictResponseOrBuilder.java @@ -0,0 +1,251 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface PredictResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.PredictResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * The schema of any single prediction may be specified via Endpoint's
+   * DeployedModels' [Model's
+   * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+   * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+   * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + java.util.List getPredictionsList(); + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * The schema of any single prediction may be specified via Endpoint's
+   * DeployedModels' [Model's
+   * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+   * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+   * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + com.google.protobuf.Value getPredictions(int index); + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * The schema of any single prediction may be specified via Endpoint's
+   * DeployedModels' [Model's
+   * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+   * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+   * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + int getPredictionsCount(); + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * The schema of any single prediction may be specified via Endpoint's
+   * DeployedModels' [Model's
+   * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+   * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+   * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + java.util.List getPredictionsOrBuilderList(); + /** + * + * + *
+   * The predictions that are the output of the predictions call.
+   * The schema of any single prediction may be specified via Endpoint's
+   * DeployedModels' [Model's
+   * ][google.cloud.vertexai.v1beta1.DeployedModel.model]
+   * [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata]
+   * [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri].
+   * 
+ * + * repeated .google.protobuf.Value predictions = 1; + */ + com.google.protobuf.ValueOrBuilder getPredictionsOrBuilder(int index); + + /** + * + * + *
+   * ID of the Endpoint's DeployedModel that served this prediction.
+   * 
+ * + * string deployed_model_id = 2; + * + * @return The deployedModelId. + */ + java.lang.String getDeployedModelId(); + /** + * + * + *
+   * ID of the Endpoint's DeployedModel that served this prediction.
+   * 
+ * + * string deployed_model_id = 2; + * + * @return The bytes for deployedModelId. + */ + com.google.protobuf.ByteString getDeployedModelIdBytes(); + + /** + * + * + *
+   * Output only. The resource name of the Model which is deployed as the
+   * DeployedModel that this prediction hits.
+   * 
+ * + * + * string model = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * Output only. The resource name of the Model which is deployed as the
+   * DeployedModel that this prediction hits.
+   * 
+ * + * + * string model = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); + + /** + * + * + *
+   * Output only. The version ID of the Model which is deployed as the
+   * DeployedModel that this prediction hits.
+   * 
+ * + * string model_version_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The modelVersionId. + */ + java.lang.String getModelVersionId(); + /** + * + * + *
+   * Output only. The version ID of the Model which is deployed as the
+   * DeployedModel that this prediction hits.
+   * 
+ * + * string model_version_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for modelVersionId. + */ + com.google.protobuf.ByteString getModelVersionIdBytes(); + + /** + * + * + *
+   * Output only. The [display
+   * name][google.cloud.vertexai.v1beta1.Model.display_name] of the Model
+   * which is deployed as the DeployedModel that this prediction hits.
+   * 
+ * + * string model_display_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The modelDisplayName. + */ + java.lang.String getModelDisplayName(); + /** + * + * + *
+   * Output only. The [display
+   * name][google.cloud.vertexai.v1beta1.Model.display_name] of the Model
+   * which is deployed as the DeployedModel that this prediction hits.
+   * 
+ * + * string model_display_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for modelDisplayName. + */ + com.google.protobuf.ByteString getModelDisplayNameBytes(); + + /** + * + * + *
+   * Output only. Request-level metadata returned by the model. The metadata
+   * type will be dependent upon the model implementation.
+   * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Output only. Request-level metadata returned by the model. The metadata
+   * type will be dependent upon the model implementation.
+   * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The metadata. + */ + com.google.protobuf.Value getMetadata(); + /** + * + * + *
+   * Output only. Request-level metadata returned by the model. The metadata
+   * type will be dependent upon the model implementation.
+   * 
+ * + * .google.protobuf.Value metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.protobuf.ValueOrBuilder getMetadataOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictionServiceProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictionServiceProto.java new file mode 100644 index 000000000000..bbc112fe0c2b --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PredictionServiceProto.java @@ -0,0 +1,545 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public final class PredictionServiceProto { + private PredictionServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_PredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_PredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_PredictResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_PredictResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_RawPredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_RawPredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_DirectPredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_DirectPredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_DirectPredictResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_DirectPredictResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_StreamingPredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_StreamingPredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_StreamingPredictResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_StreamingPredictResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_ConcurrentExplanationSpecOverrideEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_ConcurrentExplanationSpecOverrideEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_CountTokensRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_CountTokensRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_CountTokensResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_CountTokensResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_GenerateContentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_GenerateContentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_PromptFeedback_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_PromptFeedback_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_UsageMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_UsageMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/cloud/vertexai/v1beta1/predicti" + + "on_service.proto\022\035google.cloud.vertexai." + + "v1beta1\032\034google/api/annotations.proto\032\027g" + + "oogle/api/client.proto\032\037google/api/field" + + "_behavior.proto\032\031google/api/httpbody.pro" + + "to\032\031google/api/resource.proto\032+google/cl" + + "oud/vertexai/v1beta1/content.proto\032/goog" + + "le/cloud/vertexai/v1beta1/explanation.pr" + + "oto\032(google/cloud/vertexai/v1beta1/tool." + + "proto\032)google/cloud/vertexai/v1beta1/typ" + + "es.proto\032\034google/protobuf/struct.proto\"\254" + + "\001\n\016PredictRequest\022=\n\010endpoint\030\001 \001(\tB+\342A\001" + + "\002\372A$\n\"aiplatform.googleapis.com/Endpoint" + + "\022/\n\tinstances\030\002 \003(\0132\026.google.protobuf.Va" + + "lueB\004\342A\001\002\022*\n\nparameters\030\003 \001(\0132\026.google.p" + + "rotobuf.Value\"\204\002\n\017PredictResponse\022+\n\013pre" + + "dictions\030\001 \003(\0132\026.google.protobuf.Value\022\031" + + "\n\021deployed_model_id\030\002 \001(\t\0227\n\005model\030\003 \001(\t" + + "B(\342A\001\003\372A!\n\037aiplatform.googleapis.com/Mod" + + "el\022\036\n\020model_version_id\030\005 \001(\tB\004\342A\001\003\022 \n\022mo" + + "del_display_name\030\004 \001(\tB\004\342A\001\003\022.\n\010metadata" + + "\030\006 \001(\0132\026.google.protobuf.ValueB\004\342A\001\003\"{\n\021" + + "RawPredictRequest\022=\n\010endpoint\030\001 \001(\tB+\342A\001" + + "\002\372A$\n\"aiplatform.googleapis.com/Endpoint" + + "\022\'\n\thttp_body\030\002 \001(\0132\024.google.api.HttpBod" + + "y\"\307\001\n\024DirectPredictRequest\022=\n\010endpoint\030\001" + + " \001(\tB+\342A\001\002\372A$\n\"aiplatform.googleapis.com" + + "/Endpoint\0225\n\006inputs\030\002 \003(\0132%.google.cloud" + + ".vertexai.v1beta1.Tensor\0229\n\nparameters\030\003" + + " \001(\0132%.google.cloud.vertexai.v1beta1.Ten" + + "sor\"\212\001\n\025DirectPredictResponse\0226\n\007outputs" + + "\030\001 \003(\0132%.google.cloud.vertexai.v1beta1.T" + + "ensor\0229\n\nparameters\030\002 \001(\0132%.google.cloud" + + ".vertexai.v1beta1.Tensor\"|\n\027DirectRawPre" + + "dictRequest\022=\n\010endpoint\030\001 \001(\tB+\342A\001\002\372A$\n\"" + + "aiplatform.googleapis.com/Endpoint\022\023\n\013me" + + "thod_name\030\002 \001(\t\022\r\n\005input\030\003 \001(\014\"*\n\030Direct" + + "RawPredictResponse\022\016\n\006output\030\001 \001(\014\"\312\001\n\027S" + + "treamingPredictRequest\022=\n\010endpoint\030\001 \001(\t" + + "B+\342A\001\002\372A$\n\"aiplatform.googleapis.com/End" + + "point\0225\n\006inputs\030\002 \003(\0132%.google.cloud.ver" + + "texai.v1beta1.Tensor\0229\n\nparameters\030\003 \001(\013" + + "2%.google.cloud.vertexai.v1beta1.Tensor\"" + + "\215\001\n\030StreamingPredictResponse\0226\n\007outputs\030" + + "\001 \003(\0132%.google.cloud.vertexai.v1beta1.Te" + + "nsor\0229\n\nparameters\030\002 \001(\0132%.google.cloud." + + "vertexai.v1beta1.Tensor\"\177\n\032StreamingRawP" + + "redictRequest\022=\n\010endpoint\030\001 \001(\tB+\342A\001\002\372A$" + + "\n\"aiplatform.googleapis.com/Endpoint\022\023\n\013" + + "method_name\030\002 \001(\t\022\r\n\005input\030\003 \001(\014\"-\n\033Stre" + + "amingRawPredictResponse\022\016\n\006output\030\001 \001(\014\"" + + "\260\004\n\016ExplainRequest\022=\n\010endpoint\030\001 \001(\tB+\342A" + + "\001\002\372A$\n\"aiplatform.googleapis.com/Endpoin" + + "t\022/\n\tinstances\030\002 \003(\0132\026.google.protobuf.V" + + "alueB\004\342A\001\002\022*\n\nparameters\030\004 \001(\0132\026.google." + + "protobuf.Value\022Y\n\031explanation_spec_overr" + + "ide\030\005 \001(\01326.google.cloud.vertexai.v1beta" + + "1.ExplanationSpecOverride\022\210\001\n$concurrent" + + "_explanation_spec_override\030\006 \003(\0132T.googl" + + "e.cloud.vertexai.v1beta1.ExplainRequest." + + "ConcurrentExplanationSpecOverrideEntryB\004" + + "\342A\001\001\022\031\n\021deployed_model_id\030\003 \001(\t\032\200\001\n&Conc" + + "urrentExplanationSpecOverrideEntry\022\013\n\003ke" + + "y\030\001 \001(\t\022E\n\005value\030\002 \001(\01326.google.cloud.ve" + + "rtexai.v1beta1.ExplanationSpecOverride:\002" + + "8\001\"\351\003\n\017ExplainResponse\022@\n\014explanations\030\001" + + " \003(\0132*.google.cloud.vertexai.v1beta1.Exp" + + "lanation\022k\n\027concurrent_explanations\030\004 \003(" + + "\0132J.google.cloud.vertexai.v1beta1.Explai" + + "nResponse.ConcurrentExplanationsEntry\022\031\n" + + "\021deployed_model_id\030\002 \001(\t\022+\n\013predictions\030" + + "\003 \003(\0132\026.google.protobuf.Value\032Y\n\025Concurr" + + "entExplanation\022@\n\014explanations\030\001 \003(\0132*.g" + + "oogle.cloud.vertexai.v1beta1.Explanation" + + "\032\203\001\n\033ConcurrentExplanationsEntry\022\013\n\003key\030" + + "\001 \001(\t\022S\n\005value\030\002 \001(\0132D.google.cloud.vert" + + "exai.v1beta1.ExplainResponse.ConcurrentE" + + "xplanation:\0028\001\"\331\001\n\022CountTokensRequest\022=\n" + + "\010endpoint\030\001 \001(\tB+\342A\001\002\372A$\n\"aiplatform.goo" + + "gleapis.com/Endpoint\022\023\n\005model\030\003 \001(\tB\004\342A\001" + + "\002\022/\n\tinstances\030\002 \003(\0132\026.google.protobuf.V" + + "alueB\004\342A\001\002\022>\n\010contents\030\004 \003(\0132&.google.cl" + + "oud.vertexai.v1beta1.ContentB\004\342A\001\002\"N\n\023Co" + + "untTokensResponse\022\024\n\014total_tokens\030\001 \001(\005\022" + + "!\n\031total_billable_characters\030\002 \001(\005\"\205\003\n\026G" + + "enerateContentRequest\022=\n\010endpoint\030\001 \001(\tB" + + "+\342A\001\002\372A$\n\"aiplatform.googleapis.com/Endp" + + "oint\022\023\n\005model\030\005 \001(\tB\004\342A\001\002\022>\n\010contents\030\002 " + + "\003(\0132&.google.cloud.vertexai.v1beta1.Cont" + + "entB\004\342A\001\002\0228\n\005tools\030\006 \003(\0132#.google.cloud." + + "vertexai.v1beta1.ToolB\004\342A\001\001\022K\n\017safety_se" + + "ttings\030\003 \003(\0132,.google.cloud.vertexai.v1b" + + "eta1.SafetySettingB\004\342A\001\001\022P\n\021generation_c" + + "onfig\030\004 \001(\0132/.google.cloud.vertexai.v1be" + + "ta1.GenerationConfigB\004\342A\001\001\"\304\005\n\027GenerateC" + + "ontentResponse\022B\n\ncandidates\030\002 \003(\0132(.goo" + + "gle.cloud.vertexai.v1beta1.CandidateB\004\342A" + + "\001\003\022d\n\017prompt_feedback\030\003 \001(\0132E.google.clo" + + "ud.vertexai.v1beta1.GenerateContentRespo" + + "nse.PromptFeedbackB\004\342A\001\003\022\\\n\016usage_metada" + + "ta\030\004 \001(\0132D.google.cloud.vertexai.v1beta1" + + ".GenerateContentResponse.UsageMetadata\032\270" + + "\002\n\016PromptFeedback\022o\n\014block_reason\030\001 \001(\0162" + + "S.google.cloud.vertexai.v1beta1.Generate" + + "ContentResponse.PromptFeedback.BlockedRe" + + "asonB\004\342A\001\003\022I\n\016safety_ratings\030\002 \003(\0132+.goo" + + "gle.cloud.vertexai.v1beta1.SafetyRatingB" + + "\004\342A\001\003\022\"\n\024block_reason_message\030\003 \001(\tB\004\342A\001" + + "\003\"F\n\rBlockedReason\022\036\n\032BLOCKED_REASON_UNS" + + "PECIFIED\020\000\022\n\n\006SAFETY\020\001\022\t\n\005OTHER\020\002\032f\n\rUsa" + + "geMetadata\022\032\n\022prompt_token_count\030\001 \001(\005\022\036" + + "\n\026candidates_token_count\030\002 \001(\005\022\031\n\021total_" + + "token_count\030\003 \001(\0052\216\024\n\021PredictionService\022" + + "\244\002\n\007Predict\022-.google.cloud.vertexai.v1be" + + "ta1.PredictRequest\032..google.cloud.vertex" + + "ai.v1beta1.PredictResponse\"\271\001\332A\035endpoint" + + ",instances,parameters\202\323\344\223\002\222\001\">/v1beta1/{" + + "endpoint=projects/*/locations/*/endpoint" + + "s/*}:predict:\001*ZM\"H/v1beta1/{endpoint=pr" + + "ojects/*/locations/*/publishers/*/models" + + "/*}:predict:\001*\022\213\002\n\nRawPredict\0220.google.c" + + "loud.vertexai.v1beta1.RawPredictRequest\032" + + "\024.google.api.HttpBody\"\264\001\332A\022endpoint,http" + + "_body\202\323\344\223\002\230\001\"A/v1beta1/{endpoint=project" + + "s/*/locations/*/endpoints/*}:rawPredict:" + + "\001*ZP\"K/v1beta1/{endpoint=projects/*/loca" + + "tions/*/publishers/*/models/*}:rawPredic" + + "t:\001*\022\313\001\n\rDirectPredict\0223.google.cloud.ve" + + "rtexai.v1beta1.DirectPredictRequest\0324.go" + + "ogle.cloud.vertexai.v1beta1.DirectPredic" + + "tResponse\"O\202\323\344\223\002I\"D/v1beta1/{endpoint=pr" + + "ojects/*/locations/*/endpoints/*}:direct" + + "Predict:\001*\022\327\001\n\020DirectRawPredict\0226.google" + + ".cloud.vertexai.v1beta1.DirectRawPredict" + + "Request\0327.google.cloud.vertexai.v1beta1." + + "DirectRawPredictResponse\"R\202\323\344\223\002L\"G/v1bet" + + "a1/{endpoint=projects/*/locations/*/endp" + + "oints/*}:directRawPredict:\001*\022\211\001\n\020Streami" + + "ngPredict\0226.google.cloud.vertexai.v1beta" + + "1.StreamingPredictRequest\0327.google.cloud" + + ".vertexai.v1beta1.StreamingPredictRespon" + + "se\"\000(\0010\001\022\305\002\n\026ServerStreamingPredict\0226.go" + + "ogle.cloud.vertexai.v1beta1.StreamingPre" + + "dictRequest\0327.google.cloud.vertexai.v1be" + + "ta1.StreamingPredictResponse\"\267\001\202\323\344\223\002\260\001\"M" + + "/v1beta1/{endpoint=projects/*/locations/" + + "*/endpoints/*}:serverStreamingPredict:\001*" + + "Z\\\"W/v1beta1/{endpoint=projects/*/locati" + + "ons/*/publishers/*/models/*}:serverStrea" + + "mingPredict:\001*0\001\022\222\001\n\023StreamingRawPredict" + + "\0229.google.cloud.vertexai.v1beta1.Streami" + + "ngRawPredictRequest\032:.google.cloud.verte" + + "xai.v1beta1.StreamingRawPredictResponse\"" + + "\000(\0010\001\022\345\001\n\007Explain\022-.google.cloud.vertexa" + + "i.v1beta1.ExplainRequest\032..google.cloud." + + "vertexai.v1beta1.ExplainResponse\"{\332A/end" + + "point,instances,parameters,deployed_mode" + + "l_id\202\323\344\223\002C\">/v1beta1/{endpoint=projects/" + + "*/locations/*/endpoints/*}:explain:\001*\022\255\002" + + "\n\013CountTokens\0221.google.cloud.vertexai.v1" + + "beta1.CountTokensRequest\0322.google.cloud." + + "vertexai.v1beta1.CountTokensResponse\"\266\001\332" + + "A\022endpoint,instances\202\323\344\223\002\232\001\"B/v1beta1/{e" + + "ndpoint=projects/*/locations/*/endpoints" + + "/*}:countTokens:\001*ZQ\"L/v1beta1/{endpoint" + + "=projects/*/locations/*/publishers/*/mod" + + "els/*}:countTokens:\001*\022\313\002\n\025StreamGenerate" + + "Content\0225.google.cloud.vertexai.v1beta1." + + "GenerateContentRequest\0326.google.cloud.ve" + + "rtexai.v1beta1.GenerateContentResponse\"\300" + + "\001\332A\016model,contents\202\323\344\223\002\250\001\"I/v1beta1/{mod" + + "el=projects/*/locations/*/endpoints/*}:s" + + "treamGenerateContent:\001*ZX\"S/v1beta1/{mod" + + "el=projects/*/locations/*/publishers/*/m" + + "odels/*}:streamGenerateContent:\001*0\001\032M\312A\031" + + "aiplatform.googleapis.com\322A.https://www." + + "googleapis.com/auth/cloud-platformB\333\001\n\035c" + + "om.google.cloud.vertexai.apiB\026Prediction" + + "ServiceProtoP\001Z=cloud.google.com/go/vert" + + "exai/apiv1beta1/vertexaipb;vertexaipb\252\002\035" + + "Google.Cloud.VertexAI.V1Beta1\312\002\035Google\\C" + + "loud\\VertexAI\\V1beta1\352\002 Google::Cloud::V" + + "ertexAI::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.HttpBodyProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.vertexai.api.ContentProto.getDescriptor(), + com.google.cloud.vertexai.api.ExplanationProto.getDescriptor(), + com.google.cloud.vertexai.api.ToolProto.getDescriptor(), + com.google.cloud.vertexai.api.TypesProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_PredictRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_PredictRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_PredictRequest_descriptor, + new java.lang.String[] { + "Endpoint", "Instances", "Parameters", + }); + internal_static_google_cloud_vertexai_v1beta1_PredictResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vertexai_v1beta1_PredictResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_PredictResponse_descriptor, + new java.lang.String[] { + "Predictions", + "DeployedModelId", + "Model", + "ModelVersionId", + "ModelDisplayName", + "Metadata", + }); + internal_static_google_cloud_vertexai_v1beta1_RawPredictRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vertexai_v1beta1_RawPredictRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_RawPredictRequest_descriptor, + new java.lang.String[] { + "Endpoint", "HttpBody", + }); + internal_static_google_cloud_vertexai_v1beta1_DirectPredictRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vertexai_v1beta1_DirectPredictRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DirectPredictRequest_descriptor, + new java.lang.String[] { + "Endpoint", "Inputs", "Parameters", + }); + internal_static_google_cloud_vertexai_v1beta1_DirectPredictResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vertexai_v1beta1_DirectPredictResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DirectPredictResponse_descriptor, + new java.lang.String[] { + "Outputs", "Parameters", + }); + internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictRequest_descriptor, + new java.lang.String[] { + "Endpoint", "MethodName", "Input", + }); + internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DirectRawPredictResponse_descriptor, + new java.lang.String[] { + "Output", + }); + internal_static_google_cloud_vertexai_v1beta1_StreamingPredictRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_vertexai_v1beta1_StreamingPredictRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_StreamingPredictRequest_descriptor, + new java.lang.String[] { + "Endpoint", "Inputs", "Parameters", + }); + internal_static_google_cloud_vertexai_v1beta1_StreamingPredictResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_vertexai_v1beta1_StreamingPredictResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_StreamingPredictResponse_descriptor, + new java.lang.String[] { + "Outputs", "Parameters", + }); + internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictRequest_descriptor, + new java.lang.String[] { + "Endpoint", "MethodName", "Input", + }); + internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictResponse_descriptor, + new java.lang.String[] { + "Output", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_descriptor, + new java.lang.String[] { + "Endpoint", + "Instances", + "Parameters", + "ExplanationSpecOverride", + "ConcurrentExplanationSpecOverride", + "DeployedModelId", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_ConcurrentExplanationSpecOverrideEntry_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_ConcurrentExplanationSpecOverrideEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplainRequest_ConcurrentExplanationSpecOverrideEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_descriptor, + new java.lang.String[] { + "Explanations", "ConcurrentExplanations", "DeployedModelId", "Predictions", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanation_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanation_descriptor, + new java.lang.String[] { + "Explanations", + }); + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanationsEntry_descriptor = + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_ExplainResponse_ConcurrentExplanationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_vertexai_v1beta1_CountTokensRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_vertexai_v1beta1_CountTokensRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_CountTokensRequest_descriptor, + new java.lang.String[] { + "Endpoint", "Model", "Instances", "Contents", + }); + internal_static_google_cloud_vertexai_v1beta1_CountTokensResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_vertexai_v1beta1_CountTokensResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_CountTokensResponse_descriptor, + new java.lang.String[] { + "TotalTokens", "TotalBillableCharacters", + }); + internal_static_google_cloud_vertexai_v1beta1_GenerateContentRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_vertexai_v1beta1_GenerateContentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_GenerateContentRequest_descriptor, + new java.lang.String[] { + "Endpoint", "Model", "Contents", "Tools", "SafetySettings", "GenerationConfig", + }); + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_descriptor, + new java.lang.String[] { + "Candidates", "PromptFeedback", "UsageMetadata", + }); + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_PromptFeedback_descriptor = + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_PromptFeedback_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_PromptFeedback_descriptor, + new java.lang.String[] { + "BlockReason", "SafetyRatings", "BlockReasonMessage", + }); + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_UsageMetadata_descriptor = + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_UsageMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_GenerateContentResponse_UsageMetadata_descriptor, + new java.lang.String[] { + "PromptTokenCount", "CandidatesTokenCount", "TotalTokenCount", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.HttpBodyProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.vertexai.api.ContentProto.getDescriptor(); + com.google.cloud.vertexai.api.ExplanationProto.getDescriptor(); + com.google.cloud.vertexai.api.ToolProto.getDescriptor(); + com.google.cloud.vertexai.api.TypesProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Presets.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Presets.java new file mode 100644 index 000000000000..9ac287a6be7d --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Presets.java @@ -0,0 +1,1120 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Preset configuration for example-based explanations
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Presets} + */ +public final class Presets extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Presets) + PresetsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Presets.newBuilder() to construct. + private Presets(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Presets() { + query_ = 0; + modality_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Presets(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Presets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Presets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Presets.class, + com.google.cloud.vertexai.api.Presets.Builder.class); + } + + /** + * + * + *
+   * Preset option controlling parameters for query speed-precision trade-off
+   * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.Presets.Query} + */ + public enum Query implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * More precise neighbors as a trade-off against slower response.
+     * 
+ * + * PRECISE = 0; + */ + PRECISE(0), + /** + * + * + *
+     * Faster response as a trade-off against less precise neighbors.
+     * 
+ * + * FAST = 1; + */ + FAST(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * More precise neighbors as a trade-off against slower response.
+     * 
+ * + * PRECISE = 0; + */ + public static final int PRECISE_VALUE = 0; + /** + * + * + *
+     * Faster response as a trade-off against less precise neighbors.
+     * 
+ * + * FAST = 1; + */ + public static final int FAST_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Query valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Query forNumber(int value) { + switch (value) { + case 0: + return PRECISE; + case 1: + return FAST; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Query findValueByNumber(int number) { + return Query.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.Presets.getDescriptor().getEnumTypes().get(0); + } + + private static final Query[] VALUES = values(); + + public static Query valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Query(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.Presets.Query) + } + + /** + * + * + *
+   * Preset option controlling parameters for different modalities
+   * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.Presets.Modality} + */ + public enum Modality implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Should not be set. Added as a recommended best practice for enums
+     * 
+ * + * MODALITY_UNSPECIFIED = 0; + */ + MODALITY_UNSPECIFIED(0), + /** + * + * + *
+     * IMAGE modality
+     * 
+ * + * IMAGE = 1; + */ + IMAGE(1), + /** + * + * + *
+     * TEXT modality
+     * 
+ * + * TEXT = 2; + */ + TEXT(2), + /** + * + * + *
+     * TABULAR modality
+     * 
+ * + * TABULAR = 3; + */ + TABULAR(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Should not be set. Added as a recommended best practice for enums
+     * 
+ * + * MODALITY_UNSPECIFIED = 0; + */ + public static final int MODALITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * IMAGE modality
+     * 
+ * + * IMAGE = 1; + */ + public static final int IMAGE_VALUE = 1; + /** + * + * + *
+     * TEXT modality
+     * 
+ * + * TEXT = 2; + */ + public static final int TEXT_VALUE = 2; + /** + * + * + *
+     * TABULAR modality
+     * 
+ * + * TABULAR = 3; + */ + public static final int TABULAR_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Modality valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Modality forNumber(int value) { + switch (value) { + case 0: + return MODALITY_UNSPECIFIED; + case 1: + return IMAGE; + case 2: + return TEXT; + case 3: + return TABULAR; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Modality findValueByNumber(int number) { + return Modality.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.Presets.getDescriptor().getEnumTypes().get(1); + } + + private static final Modality[] VALUES = values(); + + public static Modality valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Modality(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.Presets.Modality) + } + + private int bitField0_; + public static final int QUERY_FIELD_NUMBER = 1; + private int query_ = 0; + /** + * + * + *
+   * Preset option controlling parameters for speed-precision trade-off when
+   * querying for examples. If omitted, defaults to `PRECISE`.
+   * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @return Whether the query field is set. + */ + @java.lang.Override + public boolean hasQuery() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Preset option controlling parameters for speed-precision trade-off when
+   * querying for examples. If omitted, defaults to `PRECISE`.
+   * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @return The enum numeric value on the wire for query. + */ + @java.lang.Override + public int getQueryValue() { + return query_; + } + /** + * + * + *
+   * Preset option controlling parameters for speed-precision trade-off when
+   * querying for examples. If omitted, defaults to `PRECISE`.
+   * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @return The query. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Presets.Query getQuery() { + com.google.cloud.vertexai.api.Presets.Query result = + com.google.cloud.vertexai.api.Presets.Query.forNumber(query_); + return result == null ? com.google.cloud.vertexai.api.Presets.Query.UNRECOGNIZED : result; + } + + public static final int MODALITY_FIELD_NUMBER = 2; + private int modality_ = 0; + /** + * + * + *
+   * The modality of the uploaded model, which automatically configures the
+   * distance measurement and feature normalization for the underlying example
+   * index and queries. If your model does not precisely fit one of these types,
+   * it is okay to choose the closest type.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Presets.Modality modality = 2; + * + * @return The enum numeric value on the wire for modality. + */ + @java.lang.Override + public int getModalityValue() { + return modality_; + } + /** + * + * + *
+   * The modality of the uploaded model, which automatically configures the
+   * distance measurement and feature normalization for the underlying example
+   * index and queries. If your model does not precisely fit one of these types,
+   * it is okay to choose the closest type.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Presets.Modality modality = 2; + * + * @return The modality. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Presets.Modality getModality() { + com.google.cloud.vertexai.api.Presets.Modality result = + com.google.cloud.vertexai.api.Presets.Modality.forNumber(modality_); + return result == null ? com.google.cloud.vertexai.api.Presets.Modality.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeEnum(1, query_); + } + if (modality_ + != com.google.cloud.vertexai.api.Presets.Modality.MODALITY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, modality_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, query_); + } + if (modality_ + != com.google.cloud.vertexai.api.Presets.Modality.MODALITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, modality_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Presets)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Presets other = (com.google.cloud.vertexai.api.Presets) obj; + + if (hasQuery() != other.hasQuery()) return false; + if (hasQuery()) { + if (query_ != other.query_) return false; + } + if (modality_ != other.modality_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasQuery()) { + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + query_; + } + hash = (37 * hash) + MODALITY_FIELD_NUMBER; + hash = (53 * hash) + modality_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Presets parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Presets parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Presets parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Presets parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Presets parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Presets parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Presets parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Presets parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Presets parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Presets parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Presets parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Presets parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Presets prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Preset configuration for example-based explanations
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Presets} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Presets) + com.google.cloud.vertexai.api.PresetsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Presets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Presets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Presets.class, + com.google.cloud.vertexai.api.Presets.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Presets.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + query_ = 0; + modality_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_Presets_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Presets getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Presets.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Presets build() { + com.google.cloud.vertexai.api.Presets result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Presets buildPartial() { + com.google.cloud.vertexai.api.Presets result = + new com.google.cloud.vertexai.api.Presets(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Presets result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.query_ = query_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.modality_ = modality_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Presets) { + return mergeFrom((com.google.cloud.vertexai.api.Presets) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Presets other) { + if (other == com.google.cloud.vertexai.api.Presets.getDefaultInstance()) return this; + if (other.hasQuery()) { + setQuery(other.getQuery()); + } + if (other.modality_ != 0) { + setModalityValue(other.getModalityValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + query_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + modality_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int query_ = 0; + /** + * + * + *
+     * Preset option controlling parameters for speed-precision trade-off when
+     * querying for examples. If omitted, defaults to `PRECISE`.
+     * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @return Whether the query field is set. + */ + @java.lang.Override + public boolean hasQuery() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Preset option controlling parameters for speed-precision trade-off when
+     * querying for examples. If omitted, defaults to `PRECISE`.
+     * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @return The enum numeric value on the wire for query. + */ + @java.lang.Override + public int getQueryValue() { + return query_; + } + /** + * + * + *
+     * Preset option controlling parameters for speed-precision trade-off when
+     * querying for examples. If omitted, defaults to `PRECISE`.
+     * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @param value The enum numeric value on the wire for query to set. + * @return This builder for chaining. + */ + public Builder setQueryValue(int value) { + query_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Preset option controlling parameters for speed-precision trade-off when
+     * querying for examples. If omitted, defaults to `PRECISE`.
+     * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @return The query. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Presets.Query getQuery() { + com.google.cloud.vertexai.api.Presets.Query result = + com.google.cloud.vertexai.api.Presets.Query.forNumber(query_); + return result == null ? com.google.cloud.vertexai.api.Presets.Query.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Preset option controlling parameters for speed-precision trade-off when
+     * querying for examples. If omitted, defaults to `PRECISE`.
+     * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(com.google.cloud.vertexai.api.Presets.Query value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + query_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Preset option controlling parameters for speed-precision trade-off when
+     * querying for examples. If omitted, defaults to `PRECISE`.
+     * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + bitField0_ = (bitField0_ & ~0x00000001); + query_ = 0; + onChanged(); + return this; + } + + private int modality_ = 0; + /** + * + * + *
+     * The modality of the uploaded model, which automatically configures the
+     * distance measurement and feature normalization for the underlying example
+     * index and queries. If your model does not precisely fit one of these types,
+     * it is okay to choose the closest type.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets.Modality modality = 2; + * + * @return The enum numeric value on the wire for modality. + */ + @java.lang.Override + public int getModalityValue() { + return modality_; + } + /** + * + * + *
+     * The modality of the uploaded model, which automatically configures the
+     * distance measurement and feature normalization for the underlying example
+     * index and queries. If your model does not precisely fit one of these types,
+     * it is okay to choose the closest type.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets.Modality modality = 2; + * + * @param value The enum numeric value on the wire for modality to set. + * @return This builder for chaining. + */ + public Builder setModalityValue(int value) { + modality_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The modality of the uploaded model, which automatically configures the
+     * distance measurement and feature normalization for the underlying example
+     * index and queries. If your model does not precisely fit one of these types,
+     * it is okay to choose the closest type.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets.Modality modality = 2; + * + * @return The modality. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Presets.Modality getModality() { + com.google.cloud.vertexai.api.Presets.Modality result = + com.google.cloud.vertexai.api.Presets.Modality.forNumber(modality_); + return result == null ? com.google.cloud.vertexai.api.Presets.Modality.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The modality of the uploaded model, which automatically configures the
+     * distance measurement and feature normalization for the underlying example
+     * index and queries. If your model does not precisely fit one of these types,
+     * it is okay to choose the closest type.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets.Modality modality = 2; + * + * @param value The modality to set. + * @return This builder for chaining. + */ + public Builder setModality(com.google.cloud.vertexai.api.Presets.Modality value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + modality_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The modality of the uploaded model, which automatically configures the
+     * distance measurement and feature normalization for the underlying example
+     * index and queries. If your model does not precisely fit one of these types,
+     * it is okay to choose the closest type.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Presets.Modality modality = 2; + * + * @return This builder for chaining. + */ + public Builder clearModality() { + bitField0_ = (bitField0_ & ~0x00000002); + modality_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Presets) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Presets) + private static final com.google.cloud.vertexai.api.Presets DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Presets(); + } + + public static com.google.cloud.vertexai.api.Presets getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Presets parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Presets getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PresetsOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PresetsOrBuilder.java new file mode 100644 index 000000000000..f05b1ed93728 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PresetsOrBuilder.java @@ -0,0 +1,96 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface PresetsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Presets) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Preset option controlling parameters for speed-precision trade-off when
+   * querying for examples. If omitted, defaults to `PRECISE`.
+   * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @return Whether the query field is set. + */ + boolean hasQuery(); + /** + * + * + *
+   * Preset option controlling parameters for speed-precision trade-off when
+   * querying for examples. If omitted, defaults to `PRECISE`.
+   * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @return The enum numeric value on the wire for query. + */ + int getQueryValue(); + /** + * + * + *
+   * Preset option controlling parameters for speed-precision trade-off when
+   * querying for examples. If omitted, defaults to `PRECISE`.
+   * 
+ * + * optional .google.cloud.vertexai.v1beta1.Presets.Query query = 1; + * + * @return The query. + */ + com.google.cloud.vertexai.api.Presets.Query getQuery(); + + /** + * + * + *
+   * The modality of the uploaded model, which automatically configures the
+   * distance measurement and feature normalization for the underlying example
+   * index and queries. If your model does not precisely fit one of these types,
+   * it is okay to choose the closest type.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Presets.Modality modality = 2; + * + * @return The enum numeric value on the wire for modality. + */ + int getModalityValue(); + /** + * + * + *
+   * The modality of the uploaded model, which automatically configures the
+   * distance measurement and feature normalization for the underlying example
+   * index and queries. If your model does not precisely fit one of these types,
+   * it is okay to choose the closest type.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Presets.Modality modality = 2; + * + * @return The modality. + */ + com.google.cloud.vertexai.api.Presets.Modality getModality(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PrivateEndpoints.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PrivateEndpoints.java new file mode 100644 index 000000000000..53b427ed607c --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PrivateEndpoints.java @@ -0,0 +1,1184 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * PrivateEndpoints proto is used to provide paths for users to send
+ * requests privately.
+ * To send request via private service access, use predict_http_uri,
+ * explain_http_uri or health_http_uri. To send request via private service
+ * connect, use service_attachment.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.PrivateEndpoints} + */ +public final class PrivateEndpoints extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.PrivateEndpoints) + PrivateEndpointsOrBuilder { + private static final long serialVersionUID = 0L; + // Use PrivateEndpoints.newBuilder() to construct. + private PrivateEndpoints(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PrivateEndpoints() { + predictHttpUri_ = ""; + explainHttpUri_ = ""; + healthHttpUri_ = ""; + serviceAttachment_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PrivateEndpoints(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_PrivateEndpoints_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_PrivateEndpoints_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.PrivateEndpoints.class, + com.google.cloud.vertexai.api.PrivateEndpoints.Builder.class); + } + + public static final int PREDICT_HTTP_URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object predictHttpUri_ = ""; + /** + * + * + *
+   * Output only. Http(s) path to send prediction requests.
+   * 
+ * + * string predict_http_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The predictHttpUri. + */ + @java.lang.Override + public java.lang.String getPredictHttpUri() { + java.lang.Object ref = predictHttpUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + predictHttpUri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Http(s) path to send prediction requests.
+   * 
+ * + * string predict_http_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for predictHttpUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPredictHttpUriBytes() { + java.lang.Object ref = predictHttpUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + predictHttpUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPLAIN_HTTP_URI_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object explainHttpUri_ = ""; + /** + * + * + *
+   * Output only. Http(s) path to send explain requests.
+   * 
+ * + * string explain_http_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The explainHttpUri. + */ + @java.lang.Override + public java.lang.String getExplainHttpUri() { + java.lang.Object ref = explainHttpUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + explainHttpUri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Http(s) path to send explain requests.
+   * 
+ * + * string explain_http_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for explainHttpUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExplainHttpUriBytes() { + java.lang.Object ref = explainHttpUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + explainHttpUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEALTH_HTTP_URI_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object healthHttpUri_ = ""; + /** + * + * + *
+   * Output only. Http(s) path to send health check requests.
+   * 
+ * + * string health_http_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The healthHttpUri. + */ + @java.lang.Override + public java.lang.String getHealthHttpUri() { + java.lang.Object ref = healthHttpUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + healthHttpUri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Http(s) path to send health check requests.
+   * 
+ * + * string health_http_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for healthHttpUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHealthHttpUriBytes() { + java.lang.Object ref = healthHttpUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + healthHttpUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ATTACHMENT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+   * Output only. The name of the service attachment resource. Populated if
+   * private service connect is enabled.
+   * 
+ * + * string service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAttachment. + */ + @java.lang.Override + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of the service attachment resource. Populated if
+   * private service connect is enabled.
+   * 
+ * + * string service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAttachment. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(predictHttpUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, predictHttpUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(explainHttpUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, explainHttpUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(healthHttpUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, healthHttpUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, serviceAttachment_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(predictHttpUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, predictHttpUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(explainHttpUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, explainHttpUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(healthHttpUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, healthHttpUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, serviceAttachment_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.PrivateEndpoints)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.PrivateEndpoints other = + (com.google.cloud.vertexai.api.PrivateEndpoints) obj; + + if (!getPredictHttpUri().equals(other.getPredictHttpUri())) return false; + if (!getExplainHttpUri().equals(other.getExplainHttpUri())) return false; + if (!getHealthHttpUri().equals(other.getHealthHttpUri())) return false; + if (!getServiceAttachment().equals(other.getServiceAttachment())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PREDICT_HTTP_URI_FIELD_NUMBER; + hash = (53 * hash) + getPredictHttpUri().hashCode(); + hash = (37 * hash) + EXPLAIN_HTTP_URI_FIELD_NUMBER; + hash = (53 * hash) + getExplainHttpUri().hashCode(); + hash = (37 * hash) + HEALTH_HTTP_URI_FIELD_NUMBER; + hash = (53 * hash) + getHealthHttpUri().hashCode(); + hash = (37 * hash) + SERVICE_ATTACHMENT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAttachment().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.PrivateEndpoints prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * PrivateEndpoints proto is used to provide paths for users to send
+   * requests privately.
+   * To send request via private service access, use predict_http_uri,
+   * explain_http_uri or health_http_uri. To send request via private service
+   * connect, use service_attachment.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.PrivateEndpoints} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.PrivateEndpoints) + com.google.cloud.vertexai.api.PrivateEndpointsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_PrivateEndpoints_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_PrivateEndpoints_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.PrivateEndpoints.class, + com.google.cloud.vertexai.api.PrivateEndpoints.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.PrivateEndpoints.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + predictHttpUri_ = ""; + explainHttpUri_ = ""; + healthHttpUri_ = ""; + serviceAttachment_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointProto + .internal_static_google_cloud_vertexai_v1beta1_PrivateEndpoints_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PrivateEndpoints getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.PrivateEndpoints.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PrivateEndpoints build() { + com.google.cloud.vertexai.api.PrivateEndpoints result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PrivateEndpoints buildPartial() { + com.google.cloud.vertexai.api.PrivateEndpoints result = + new com.google.cloud.vertexai.api.PrivateEndpoints(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.PrivateEndpoints result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.predictHttpUri_ = predictHttpUri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.explainHttpUri_ = explainHttpUri_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.healthHttpUri_ = healthHttpUri_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.serviceAttachment_ = serviceAttachment_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.PrivateEndpoints) { + return mergeFrom((com.google.cloud.vertexai.api.PrivateEndpoints) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.PrivateEndpoints other) { + if (other == com.google.cloud.vertexai.api.PrivateEndpoints.getDefaultInstance()) return this; + if (!other.getPredictHttpUri().isEmpty()) { + predictHttpUri_ = other.predictHttpUri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getExplainHttpUri().isEmpty()) { + explainHttpUri_ = other.explainHttpUri_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getHealthHttpUri().isEmpty()) { + healthHttpUri_ = other.healthHttpUri_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getServiceAttachment().isEmpty()) { + serviceAttachment_ = other.serviceAttachment_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + predictHttpUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + explainHttpUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + healthHttpUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + serviceAttachment_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object predictHttpUri_ = ""; + /** + * + * + *
+     * Output only. Http(s) path to send prediction requests.
+     * 
+ * + * string predict_http_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The predictHttpUri. + */ + public java.lang.String getPredictHttpUri() { + java.lang.Object ref = predictHttpUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + predictHttpUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Http(s) path to send prediction requests.
+     * 
+ * + * string predict_http_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for predictHttpUri. + */ + public com.google.protobuf.ByteString getPredictHttpUriBytes() { + java.lang.Object ref = predictHttpUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + predictHttpUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Http(s) path to send prediction requests.
+     * 
+ * + * string predict_http_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The predictHttpUri to set. + * @return This builder for chaining. + */ + public Builder setPredictHttpUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + predictHttpUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Http(s) path to send prediction requests.
+     * 
+ * + * string predict_http_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPredictHttpUri() { + predictHttpUri_ = getDefaultInstance().getPredictHttpUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Http(s) path to send prediction requests.
+     * 
+ * + * string predict_http_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for predictHttpUri to set. + * @return This builder for chaining. + */ + public Builder setPredictHttpUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + predictHttpUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object explainHttpUri_ = ""; + /** + * + * + *
+     * Output only. Http(s) path to send explain requests.
+     * 
+ * + * string explain_http_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The explainHttpUri. + */ + public java.lang.String getExplainHttpUri() { + java.lang.Object ref = explainHttpUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + explainHttpUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Http(s) path to send explain requests.
+     * 
+ * + * string explain_http_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for explainHttpUri. + */ + public com.google.protobuf.ByteString getExplainHttpUriBytes() { + java.lang.Object ref = explainHttpUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + explainHttpUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Http(s) path to send explain requests.
+     * 
+ * + * string explain_http_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The explainHttpUri to set. + * @return This builder for chaining. + */ + public Builder setExplainHttpUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + explainHttpUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Http(s) path to send explain requests.
+     * 
+ * + * string explain_http_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearExplainHttpUri() { + explainHttpUri_ = getDefaultInstance().getExplainHttpUri(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Http(s) path to send explain requests.
+     * 
+ * + * string explain_http_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for explainHttpUri to set. + * @return This builder for chaining. + */ + public Builder setExplainHttpUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + explainHttpUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object healthHttpUri_ = ""; + /** + * + * + *
+     * Output only. Http(s) path to send health check requests.
+     * 
+ * + * string health_http_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The healthHttpUri. + */ + public java.lang.String getHealthHttpUri() { + java.lang.Object ref = healthHttpUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + healthHttpUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Http(s) path to send health check requests.
+     * 
+ * + * string health_http_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for healthHttpUri. + */ + public com.google.protobuf.ByteString getHealthHttpUriBytes() { + java.lang.Object ref = healthHttpUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + healthHttpUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Http(s) path to send health check requests.
+     * 
+ * + * string health_http_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The healthHttpUri to set. + * @return This builder for chaining. + */ + public Builder setHealthHttpUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + healthHttpUri_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Http(s) path to send health check requests.
+     * 
+ * + * string health_http_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearHealthHttpUri() { + healthHttpUri_ = getDefaultInstance().getHealthHttpUri(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Http(s) path to send health check requests.
+     * 
+ * + * string health_http_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for healthHttpUri to set. + * @return This builder for chaining. + */ + public Builder setHealthHttpUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + healthHttpUri_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+     * Output only. The name of the service attachment resource. Populated if
+     * private service connect is enabled.
+     * 
+ * + * string service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAttachment. + */ + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of the service attachment resource. Populated if
+     * private service connect is enabled.
+     * 
+ * + * string service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAttachment. + */ + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of the service attachment resource. Populated if
+     * private service connect is enabled.
+     * 
+ * + * string service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAttachment_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the service attachment resource. Populated if
+     * private service connect is enabled.
+     * 
+ * + * string service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearServiceAttachment() { + serviceAttachment_ = getDefaultInstance().getServiceAttachment(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the service attachment resource. Populated if
+     * private service connect is enabled.
+     * 
+ * + * string service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachmentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAttachment_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.PrivateEndpoints) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.PrivateEndpoints) + private static final com.google.cloud.vertexai.api.PrivateEndpoints DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.PrivateEndpoints(); + } + + public static com.google.cloud.vertexai.api.PrivateEndpoints getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrivateEndpoints parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.PrivateEndpoints getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PrivateEndpointsOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PrivateEndpointsOrBuilder.java new file mode 100644 index 000000000000..a508628d317c --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/PrivateEndpointsOrBuilder.java @@ -0,0 +1,127 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint.proto + +package com.google.cloud.vertexai.api; + +public interface PrivateEndpointsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.PrivateEndpoints) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Http(s) path to send prediction requests.
+   * 
+ * + * string predict_http_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The predictHttpUri. + */ + java.lang.String getPredictHttpUri(); + /** + * + * + *
+   * Output only. Http(s) path to send prediction requests.
+   * 
+ * + * string predict_http_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for predictHttpUri. + */ + com.google.protobuf.ByteString getPredictHttpUriBytes(); + + /** + * + * + *
+   * Output only. Http(s) path to send explain requests.
+   * 
+ * + * string explain_http_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The explainHttpUri. + */ + java.lang.String getExplainHttpUri(); + /** + * + * + *
+   * Output only. Http(s) path to send explain requests.
+   * 
+ * + * string explain_http_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for explainHttpUri. + */ + com.google.protobuf.ByteString getExplainHttpUriBytes(); + + /** + * + * + *
+   * Output only. Http(s) path to send health check requests.
+   * 
+ * + * string health_http_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The healthHttpUri. + */ + java.lang.String getHealthHttpUri(); + /** + * + * + *
+   * Output only. Http(s) path to send health check requests.
+   * 
+ * + * string health_http_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for healthHttpUri. + */ + com.google.protobuf.ByteString getHealthHttpUriBytes(); + + /** + * + * + *
+   * Output only. The name of the service attachment resource. Populated if
+   * private service connect is enabled.
+   * 
+ * + * string service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAttachment. + */ + java.lang.String getServiceAttachment(); + /** + * + * + *
+   * Output only. The name of the service attachment resource. Populated if
+   * private service connect is enabled.
+   * 
+ * + * string service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAttachment. + */ + com.google.protobuf.ByteString getServiceAttachmentBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/RawPredictRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/RawPredictRequest.java new file mode 100644 index 000000000000..5dc2fbe343fc --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/RawPredictRequest.java @@ -0,0 +1,1077 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [PredictionService.RawPredict][google.cloud.vertexai.v1beta1.PredictionService.RawPredict].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.RawPredictRequest} + */ +public final class RawPredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.RawPredictRequest) + RawPredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RawPredictRequest.newBuilder() to construct. + private RawPredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RawPredictRequest() { + endpoint_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RawPredictRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_RawPredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_RawPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.RawPredictRequest.class, + com.google.cloud.vertexai.api.RawPredictRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HTTP_BODY_FIELD_NUMBER = 2; + private com.google.api.HttpBody httpBody_; + /** + * + * + *
+   * The prediction input. Supports HTTP headers and arbitrary data payload.
+   *
+   * 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.
+   * 
+ * + * .google.api.HttpBody http_body = 2; + * + * @return Whether the httpBody field is set. + */ + @java.lang.Override + public boolean hasHttpBody() { + return httpBody_ != null; + } + /** + * + * + *
+   * The prediction input. Supports HTTP headers and arbitrary data payload.
+   *
+   * 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.
+   * 
+ * + * .google.api.HttpBody http_body = 2; + * + * @return The httpBody. + */ + @java.lang.Override + public com.google.api.HttpBody getHttpBody() { + return httpBody_ == null ? com.google.api.HttpBody.getDefaultInstance() : httpBody_; + } + /** + * + * + *
+   * The prediction input. Supports HTTP headers and arbitrary data payload.
+   *
+   * 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.
+   * 
+ * + * .google.api.HttpBody http_body = 2; + */ + @java.lang.Override + public com.google.api.HttpBodyOrBuilder getHttpBodyOrBuilder() { + return httpBody_ == null ? com.google.api.HttpBody.getDefaultInstance() : httpBody_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + if (httpBody_ != null) { + output.writeMessage(2, getHttpBody()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + if (httpBody_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getHttpBody()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.RawPredictRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.RawPredictRequest other = + (com.google.cloud.vertexai.api.RawPredictRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (hasHttpBody() != other.hasHttpBody()) return false; + if (hasHttpBody()) { + if (!getHttpBody().equals(other.getHttpBody())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + if (hasHttpBody()) { + hash = (37 * hash) + HTTP_BODY_FIELD_NUMBER; + hash = (53 * hash) + getHttpBody().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.RawPredictRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [PredictionService.RawPredict][google.cloud.vertexai.v1beta1.PredictionService.RawPredict].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.RawPredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.RawPredictRequest) + com.google.cloud.vertexai.api.RawPredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_RawPredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_RawPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.RawPredictRequest.class, + com.google.cloud.vertexai.api.RawPredictRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.RawPredictRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + httpBody_ = null; + if (httpBodyBuilder_ != null) { + httpBodyBuilder_.dispose(); + httpBodyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_RawPredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.RawPredictRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.RawPredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.RawPredictRequest build() { + com.google.cloud.vertexai.api.RawPredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.RawPredictRequest buildPartial() { + com.google.cloud.vertexai.api.RawPredictRequest result = + new com.google.cloud.vertexai.api.RawPredictRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.RawPredictRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.httpBody_ = httpBodyBuilder_ == null ? httpBody_ : httpBodyBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.RawPredictRequest) { + return mergeFrom((com.google.cloud.vertexai.api.RawPredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.RawPredictRequest other) { + if (other == com.google.cloud.vertexai.api.RawPredictRequest.getDefaultInstance()) + return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasHttpBody()) { + mergeHttpBody(other.getHttpBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getHttpBodyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.api.HttpBody httpBody_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.HttpBody, + com.google.api.HttpBody.Builder, + com.google.api.HttpBodyOrBuilder> + httpBodyBuilder_; + /** + * + * + *
+     * The prediction input. Supports HTTP headers and arbitrary data payload.
+     *
+     * 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.
+     * 
+ * + * .google.api.HttpBody http_body = 2; + * + * @return Whether the httpBody field is set. + */ + public boolean hasHttpBody() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The prediction input. Supports HTTP headers and arbitrary data payload.
+     *
+     * 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.
+     * 
+ * + * .google.api.HttpBody http_body = 2; + * + * @return The httpBody. + */ + public com.google.api.HttpBody getHttpBody() { + if (httpBodyBuilder_ == null) { + return httpBody_ == null ? com.google.api.HttpBody.getDefaultInstance() : httpBody_; + } else { + return httpBodyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The prediction input. Supports HTTP headers and arbitrary data payload.
+     *
+     * 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.
+     * 
+ * + * .google.api.HttpBody http_body = 2; + */ + public Builder setHttpBody(com.google.api.HttpBody value) { + if (httpBodyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + httpBody_ = value; + } else { + httpBodyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The prediction input. Supports HTTP headers and arbitrary data payload.
+     *
+     * 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.
+     * 
+ * + * .google.api.HttpBody http_body = 2; + */ + public Builder setHttpBody(com.google.api.HttpBody.Builder builderForValue) { + if (httpBodyBuilder_ == null) { + httpBody_ = builderForValue.build(); + } else { + httpBodyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The prediction input. Supports HTTP headers and arbitrary data payload.
+     *
+     * 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.
+     * 
+ * + * .google.api.HttpBody http_body = 2; + */ + public Builder mergeHttpBody(com.google.api.HttpBody value) { + if (httpBodyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && httpBody_ != null + && httpBody_ != com.google.api.HttpBody.getDefaultInstance()) { + getHttpBodyBuilder().mergeFrom(value); + } else { + httpBody_ = value; + } + } else { + httpBodyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The prediction input. Supports HTTP headers and arbitrary data payload.
+     *
+     * 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.
+     * 
+ * + * .google.api.HttpBody http_body = 2; + */ + public Builder clearHttpBody() { + bitField0_ = (bitField0_ & ~0x00000002); + httpBody_ = null; + if (httpBodyBuilder_ != null) { + httpBodyBuilder_.dispose(); + httpBodyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The prediction input. Supports HTTP headers and arbitrary data payload.
+     *
+     * 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.
+     * 
+ * + * .google.api.HttpBody http_body = 2; + */ + public com.google.api.HttpBody.Builder getHttpBodyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getHttpBodyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The prediction input. Supports HTTP headers and arbitrary data payload.
+     *
+     * 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.
+     * 
+ * + * .google.api.HttpBody http_body = 2; + */ + public com.google.api.HttpBodyOrBuilder getHttpBodyOrBuilder() { + if (httpBodyBuilder_ != null) { + return httpBodyBuilder_.getMessageOrBuilder(); + } else { + return httpBody_ == null ? com.google.api.HttpBody.getDefaultInstance() : httpBody_; + } + } + /** + * + * + *
+     * The prediction input. Supports HTTP headers and arbitrary data payload.
+     *
+     * 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.
+     * 
+ * + * .google.api.HttpBody http_body = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.HttpBody, + com.google.api.HttpBody.Builder, + com.google.api.HttpBodyOrBuilder> + getHttpBodyFieldBuilder() { + if (httpBodyBuilder_ == null) { + httpBodyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.HttpBody, + com.google.api.HttpBody.Builder, + com.google.api.HttpBodyOrBuilder>(getHttpBody(), getParentForChildren(), isClean()); + httpBody_ = null; + } + return httpBodyBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.RawPredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.RawPredictRequest) + private static final com.google.cloud.vertexai.api.RawPredictRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.RawPredictRequest(); + } + + public static com.google.cloud.vertexai.api.RawPredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RawPredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.RawPredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/RawPredictRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/RawPredictRequestOrBuilder.java new file mode 100644 index 000000000000..e213d972847a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/RawPredictRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface RawPredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.RawPredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * The prediction input. Supports HTTP headers and arbitrary data payload.
+   *
+   * 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.
+   * 
+ * + * .google.api.HttpBody http_body = 2; + * + * @return Whether the httpBody field is set. + */ + boolean hasHttpBody(); + /** + * + * + *
+   * The prediction input. Supports HTTP headers and arbitrary data payload.
+   *
+   * 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.
+   * 
+ * + * .google.api.HttpBody http_body = 2; + * + * @return The httpBody. + */ + com.google.api.HttpBody getHttpBody(); + /** + * + * + *
+   * The prediction input. Supports HTTP headers and arbitrary data payload.
+   *
+   * 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.
+   * 
+ * + * .google.api.HttpBody http_body = 2; + */ + com.google.api.HttpBodyOrBuilder getHttpBodyOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ResourcesConsumed.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ResourcesConsumed.java new file mode 100644 index 000000000000..09dce0933b7f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ResourcesConsumed.java @@ -0,0 +1,546 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Statistics information about resource consumption.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ResourcesConsumed} + */ +public final class ResourcesConsumed extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.ResourcesConsumed) + ResourcesConsumedOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourcesConsumed.newBuilder() to construct. + private ResourcesConsumed(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourcesConsumed() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourcesConsumed(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_ResourcesConsumed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_ResourcesConsumed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ResourcesConsumed.class, + com.google.cloud.vertexai.api.ResourcesConsumed.Builder.class); + } + + public static final int REPLICA_HOURS_FIELD_NUMBER = 1; + private double replicaHours_ = 0D; + /** + * + * + *
+   * Output only. The number of replica hours used. Note that many replicas may
+   * run in parallel, and additionally any given work may be queued for some
+   * time. Therefore this value is not strictly related to wall time.
+   * 
+ * + * double replica_hours = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The replicaHours. + */ + @java.lang.Override + public double getReplicaHours() { + return replicaHours_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (java.lang.Double.doubleToRawLongBits(replicaHours_) != 0) { + output.writeDouble(1, replicaHours_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(replicaHours_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, replicaHours_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ResourcesConsumed)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ResourcesConsumed other = + (com.google.cloud.vertexai.api.ResourcesConsumed) obj; + + if (java.lang.Double.doubleToLongBits(getReplicaHours()) + != java.lang.Double.doubleToLongBits(other.getReplicaHours())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REPLICA_HOURS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getReplicaHours())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ResourcesConsumed prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Statistics information about resource consumption.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.ResourcesConsumed} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.ResourcesConsumed) + com.google.cloud.vertexai.api.ResourcesConsumedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_ResourcesConsumed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_ResourcesConsumed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ResourcesConsumed.class, + com.google.cloud.vertexai.api.ResourcesConsumed.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ResourcesConsumed.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + replicaHours_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.MachineResourcesProto + .internal_static_google_cloud_vertexai_v1beta1_ResourcesConsumed_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ResourcesConsumed getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ResourcesConsumed.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ResourcesConsumed build() { + com.google.cloud.vertexai.api.ResourcesConsumed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ResourcesConsumed buildPartial() { + com.google.cloud.vertexai.api.ResourcesConsumed result = + new com.google.cloud.vertexai.api.ResourcesConsumed(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.ResourcesConsumed result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.replicaHours_ = replicaHours_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ResourcesConsumed) { + return mergeFrom((com.google.cloud.vertexai.api.ResourcesConsumed) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ResourcesConsumed other) { + if (other == com.google.cloud.vertexai.api.ResourcesConsumed.getDefaultInstance()) + return this; + if (other.getReplicaHours() != 0D) { + setReplicaHours(other.getReplicaHours()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + replicaHours_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private double replicaHours_; + /** + * + * + *
+     * Output only. The number of replica hours used. Note that many replicas may
+     * run in parallel, and additionally any given work may be queued for some
+     * time. Therefore this value is not strictly related to wall time.
+     * 
+ * + * double replica_hours = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The replicaHours. + */ + @java.lang.Override + public double getReplicaHours() { + return replicaHours_; + } + /** + * + * + *
+     * Output only. The number of replica hours used. Note that many replicas may
+     * run in parallel, and additionally any given work may be queued for some
+     * time. Therefore this value is not strictly related to wall time.
+     * 
+ * + * double replica_hours = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The replicaHours to set. + * @return This builder for chaining. + */ + public Builder setReplicaHours(double value) { + + replicaHours_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The number of replica hours used. Note that many replicas may
+     * run in parallel, and additionally any given work may be queued for some
+     * time. Therefore this value is not strictly related to wall time.
+     * 
+ * + * double replica_hours = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReplicaHours() { + bitField0_ = (bitField0_ & ~0x00000001); + replicaHours_ = 0D; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.ResourcesConsumed) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.ResourcesConsumed) + private static final com.google.cloud.vertexai.api.ResourcesConsumed DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ResourcesConsumed(); + } + + public static com.google.cloud.vertexai.api.ResourcesConsumed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourcesConsumed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ResourcesConsumed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ResourcesConsumedOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ResourcesConsumedOrBuilder.java new file mode 100644 index 000000000000..25943e910901 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ResourcesConsumedOrBuilder.java @@ -0,0 +1,40 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/machine_resources.proto + +package com.google.cloud.vertexai.api; + +public interface ResourcesConsumedOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.ResourcesConsumed) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The number of replica hours used. Note that many replicas may
+   * run in parallel, and additionally any given work may be queued for some
+   * time. Therefore this value is not strictly related to wall time.
+   * 
+ * + * double replica_hours = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The replicaHours. + */ + double getReplicaHours(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetyRating.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetyRating.java new file mode 100644 index 000000000000..64f7c5cd0438 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetyRating.java @@ -0,0 +1,1076 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Safety rating corresponding to the generated content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.SafetyRating} + */ +public final class SafetyRating extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.SafetyRating) + SafetyRatingOrBuilder { + private static final long serialVersionUID = 0L; + // Use SafetyRating.newBuilder() to construct. + private SafetyRating(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SafetyRating() { + category_ = 0; + probability_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SafetyRating(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_SafetyRating_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_SafetyRating_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.SafetyRating.class, + com.google.cloud.vertexai.api.SafetyRating.Builder.class); + } + + /** + * + * + *
+   * Harm probability levels in the content.
+   * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability} + */ + public enum HarmProbability implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Harm probability unspecified.
+     * 
+ * + * HARM_PROBABILITY_UNSPECIFIED = 0; + */ + HARM_PROBABILITY_UNSPECIFIED(0), + /** + * + * + *
+     * Negligible level of harm.
+     * 
+ * + * NEGLIGIBLE = 1; + */ + NEGLIGIBLE(1), + /** + * + * + *
+     * Low level of harm.
+     * 
+ * + * LOW = 2; + */ + LOW(2), + /** + * + * + *
+     * Medium level of harm.
+     * 
+ * + * MEDIUM = 3; + */ + MEDIUM(3), + /** + * + * + *
+     * High level of harm.
+     * 
+ * + * HIGH = 4; + */ + HIGH(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Harm probability unspecified.
+     * 
+ * + * HARM_PROBABILITY_UNSPECIFIED = 0; + */ + public static final int HARM_PROBABILITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Negligible level of harm.
+     * 
+ * + * NEGLIGIBLE = 1; + */ + public static final int NEGLIGIBLE_VALUE = 1; + /** + * + * + *
+     * Low level of harm.
+     * 
+ * + * LOW = 2; + */ + public static final int LOW_VALUE = 2; + /** + * + * + *
+     * Medium level of harm.
+     * 
+ * + * MEDIUM = 3; + */ + public static final int MEDIUM_VALUE = 3; + /** + * + * + *
+     * High level of harm.
+     * 
+ * + * HIGH = 4; + */ + public static final int HIGH_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static HarmProbability valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static HarmProbability forNumber(int value) { + switch (value) { + case 0: + return HARM_PROBABILITY_UNSPECIFIED; + case 1: + return NEGLIGIBLE; + case 2: + return LOW; + case 3: + return MEDIUM; + case 4: + return HIGH; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public HarmProbability findValueByNumber(int number) { + return HarmProbability.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.SafetyRating.getDescriptor().getEnumTypes().get(0); + } + + private static final HarmProbability[] VALUES = values(); + + public static HarmProbability valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private HarmProbability(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability) + } + + public static final int CATEGORY_FIELD_NUMBER = 1; + private int category_ = 0; + /** + * + * + *
+   * Output only. Harm category.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for category. + */ + @java.lang.Override + public int getCategoryValue() { + return category_; + } + /** + * + * + *
+   * Output only. Harm category.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.HarmCategory getCategory() { + com.google.cloud.vertexai.api.HarmCategory result = + com.google.cloud.vertexai.api.HarmCategory.forNumber(category_); + return result == null ? com.google.cloud.vertexai.api.HarmCategory.UNRECOGNIZED : result; + } + + public static final int PROBABILITY_FIELD_NUMBER = 2; + private int probability_ = 0; + /** + * + * + *
+   * Output only. Harm probability levels in the content.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for probability. + */ + @java.lang.Override + public int getProbabilityValue() { + return probability_; + } + /** + * + * + *
+   * Output only. Harm probability levels in the content.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The probability. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SafetyRating.HarmProbability getProbability() { + com.google.cloud.vertexai.api.SafetyRating.HarmProbability result = + com.google.cloud.vertexai.api.SafetyRating.HarmProbability.forNumber(probability_); + return result == null + ? com.google.cloud.vertexai.api.SafetyRating.HarmProbability.UNRECOGNIZED + : result; + } + + public static final int BLOCKED_FIELD_NUMBER = 3; + private boolean blocked_ = false; + /** + * + * + *
+   * Output only. Indicates whether the content was filtered out because of this
+   * rating.
+   * 
+ * + * bool blocked = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The blocked. + */ + @java.lang.Override + public boolean getBlocked() { + return blocked_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (category_ + != com.google.cloud.vertexai.api.HarmCategory.HARM_CATEGORY_UNSPECIFIED.getNumber()) { + output.writeEnum(1, category_); + } + if (probability_ + != com.google.cloud.vertexai.api.SafetyRating.HarmProbability.HARM_PROBABILITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, probability_); + } + if (blocked_ != false) { + output.writeBool(3, blocked_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (category_ + != com.google.cloud.vertexai.api.HarmCategory.HARM_CATEGORY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, category_); + } + if (probability_ + != com.google.cloud.vertexai.api.SafetyRating.HarmProbability.HARM_PROBABILITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, probability_); + } + if (blocked_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, blocked_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.SafetyRating)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.SafetyRating other = + (com.google.cloud.vertexai.api.SafetyRating) obj; + + if (category_ != other.category_) return false; + if (probability_ != other.probability_) return false; + if (getBlocked() != other.getBlocked()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + category_; + hash = (37 * hash) + PROBABILITY_FIELD_NUMBER; + hash = (53 * hash) + probability_; + hash = (37 * hash) + BLOCKED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBlocked()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.SafetyRating parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SafetyRating parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.SafetyRating prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Safety rating corresponding to the generated content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.SafetyRating} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.SafetyRating) + com.google.cloud.vertexai.api.SafetyRatingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_SafetyRating_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_SafetyRating_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.SafetyRating.class, + com.google.cloud.vertexai.api.SafetyRating.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.SafetyRating.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + category_ = 0; + probability_ = 0; + blocked_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_SafetyRating_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SafetyRating getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.SafetyRating.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SafetyRating build() { + com.google.cloud.vertexai.api.SafetyRating result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SafetyRating buildPartial() { + com.google.cloud.vertexai.api.SafetyRating result = + new com.google.cloud.vertexai.api.SafetyRating(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.SafetyRating result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.category_ = category_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.probability_ = probability_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.blocked_ = blocked_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.SafetyRating) { + return mergeFrom((com.google.cloud.vertexai.api.SafetyRating) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.SafetyRating other) { + if (other == com.google.cloud.vertexai.api.SafetyRating.getDefaultInstance()) return this; + if (other.category_ != 0) { + setCategoryValue(other.getCategoryValue()); + } + if (other.probability_ != 0) { + setProbabilityValue(other.getProbabilityValue()); + } + if (other.getBlocked() != false) { + setBlocked(other.getBlocked()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + category_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + probability_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + blocked_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int category_ = 0; + /** + * + * + *
+     * Output only. Harm category.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for category. + */ + @java.lang.Override + public int getCategoryValue() { + return category_; + } + /** + * + * + *
+     * Output only. Harm category.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for category to set. + * @return This builder for chaining. + */ + public Builder setCategoryValue(int value) { + category_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Harm category.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.HarmCategory getCategory() { + com.google.cloud.vertexai.api.HarmCategory result = + com.google.cloud.vertexai.api.HarmCategory.forNumber(category_); + return result == null ? com.google.cloud.vertexai.api.HarmCategory.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. Harm category.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The category to set. + * @return This builder for chaining. + */ + public Builder setCategory(com.google.cloud.vertexai.api.HarmCategory value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + category_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Harm category.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + bitField0_ = (bitField0_ & ~0x00000001); + category_ = 0; + onChanged(); + return this; + } + + private int probability_ = 0; + /** + * + * + *
+     * Output only. Harm probability levels in the content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for probability. + */ + @java.lang.Override + public int getProbabilityValue() { + return probability_; + } + /** + * + * + *
+     * Output only. Harm probability levels in the content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for probability to set. + * @return This builder for chaining. + */ + public Builder setProbabilityValue(int value) { + probability_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Harm probability levels in the content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The probability. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SafetyRating.HarmProbability getProbability() { + com.google.cloud.vertexai.api.SafetyRating.HarmProbability result = + com.google.cloud.vertexai.api.SafetyRating.HarmProbability.forNumber(probability_); + return result == null + ? com.google.cloud.vertexai.api.SafetyRating.HarmProbability.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Harm probability levels in the content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The probability to set. + * @return This builder for chaining. + */ + public Builder setProbability( + com.google.cloud.vertexai.api.SafetyRating.HarmProbability value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + probability_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Harm probability levels in the content.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearProbability() { + bitField0_ = (bitField0_ & ~0x00000002); + probability_ = 0; + onChanged(); + return this; + } + + private boolean blocked_; + /** + * + * + *
+     * Output only. Indicates whether the content was filtered out because of this
+     * rating.
+     * 
+ * + * bool blocked = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The blocked. + */ + @java.lang.Override + public boolean getBlocked() { + return blocked_; + } + /** + * + * + *
+     * Output only. Indicates whether the content was filtered out because of this
+     * rating.
+     * 
+ * + * bool blocked = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The blocked to set. + * @return This builder for chaining. + */ + public Builder setBlocked(boolean value) { + + blocked_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates whether the content was filtered out because of this
+     * rating.
+     * 
+ * + * bool blocked = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBlocked() { + bitField0_ = (bitField0_ & ~0x00000004); + blocked_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.SafetyRating) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.SafetyRating) + private static final com.google.cloud.vertexai.api.SafetyRating DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.SafetyRating(); + } + + public static com.google.cloud.vertexai.api.SafetyRating getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SafetyRating parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SafetyRating getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetyRatingOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetyRatingOrBuilder.java new file mode 100644 index 000000000000..ca1598b9a54f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetyRatingOrBuilder.java @@ -0,0 +1,97 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface SafetyRatingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.SafetyRating) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Harm category.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for category. + */ + int getCategoryValue(); + /** + * + * + *
+   * Output only. Harm category.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + com.google.cloud.vertexai.api.HarmCategory getCategory(); + + /** + * + * + *
+   * Output only. Harm probability levels in the content.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for probability. + */ + int getProbabilityValue(); + /** + * + * + *
+   * Output only. Harm probability levels in the content.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetyRating.HarmProbability probability = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The probability. + */ + com.google.cloud.vertexai.api.SafetyRating.HarmProbability getProbability(); + + /** + * + * + *
+   * Output only. Indicates whether the content was filtered out because of this
+   * rating.
+   * 
+ * + * bool blocked = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The blocked. + */ + boolean getBlocked(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetySetting.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetySetting.java new file mode 100644 index 000000000000..013e39e4244c --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetySetting.java @@ -0,0 +1,982 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Safety settings.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.SafetySetting} + */ +public final class SafetySetting extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.SafetySetting) + SafetySettingOrBuilder { + private static final long serialVersionUID = 0L; + // Use SafetySetting.newBuilder() to construct. + private SafetySetting(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SafetySetting() { + category_ = 0; + threshold_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SafetySetting(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_SafetySetting_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_SafetySetting_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.SafetySetting.class, + com.google.cloud.vertexai.api.SafetySetting.Builder.class); + } + + /** + * + * + *
+   * Probability based thresholds levels for blocking.
+   * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold} + */ + public enum HarmBlockThreshold implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified harm block threshold.
+     * 
+ * + * HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + */ + HARM_BLOCK_THRESHOLD_UNSPECIFIED(0), + /** + * + * + *
+     * Block low threshold and above (i.e. block more).
+     * 
+ * + * BLOCK_LOW_AND_ABOVE = 1; + */ + BLOCK_LOW_AND_ABOVE(1), + /** + * + * + *
+     * Block medium threshold and above.
+     * 
+ * + * BLOCK_MEDIUM_AND_ABOVE = 2; + */ + BLOCK_MEDIUM_AND_ABOVE(2), + /** + * + * + *
+     * Block only high threshold (i.e. block less).
+     * 
+ * + * BLOCK_ONLY_HIGH = 3; + */ + BLOCK_ONLY_HIGH(3), + /** + * + * + *
+     * Block none.
+     * 
+ * + * BLOCK_NONE = 4; + */ + BLOCK_NONE(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified harm block threshold.
+     * 
+ * + * HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + */ + public static final int HARM_BLOCK_THRESHOLD_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Block low threshold and above (i.e. block more).
+     * 
+ * + * BLOCK_LOW_AND_ABOVE = 1; + */ + public static final int BLOCK_LOW_AND_ABOVE_VALUE = 1; + /** + * + * + *
+     * Block medium threshold and above.
+     * 
+ * + * BLOCK_MEDIUM_AND_ABOVE = 2; + */ + public static final int BLOCK_MEDIUM_AND_ABOVE_VALUE = 2; + /** + * + * + *
+     * Block only high threshold (i.e. block less).
+     * 
+ * + * BLOCK_ONLY_HIGH = 3; + */ + public static final int BLOCK_ONLY_HIGH_VALUE = 3; + /** + * + * + *
+     * Block none.
+     * 
+ * + * BLOCK_NONE = 4; + */ + public static final int BLOCK_NONE_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static HarmBlockThreshold valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static HarmBlockThreshold forNumber(int value) { + switch (value) { + case 0: + return HARM_BLOCK_THRESHOLD_UNSPECIFIED; + case 1: + return BLOCK_LOW_AND_ABOVE; + case 2: + return BLOCK_MEDIUM_AND_ABOVE; + case 3: + return BLOCK_ONLY_HIGH; + case 4: + return BLOCK_NONE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public HarmBlockThreshold findValueByNumber(int number) { + return HarmBlockThreshold.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.SafetySetting.getDescriptor().getEnumTypes().get(0); + } + + private static final HarmBlockThreshold[] VALUES = values(); + + public static HarmBlockThreshold valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private HarmBlockThreshold(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold) + } + + public static final int CATEGORY_FIELD_NUMBER = 1; + private int category_ = 0; + /** + * + * + *
+   * Required. Harm category.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for category. + */ + @java.lang.Override + public int getCategoryValue() { + return category_; + } + /** + * + * + *
+   * Required. Harm category.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.HarmCategory getCategory() { + com.google.cloud.vertexai.api.HarmCategory result = + com.google.cloud.vertexai.api.HarmCategory.forNumber(category_); + return result == null ? com.google.cloud.vertexai.api.HarmCategory.UNRECOGNIZED : result; + } + + public static final int THRESHOLD_FIELD_NUMBER = 2; + private int threshold_ = 0; + /** + * + * + *
+   * Required. The harm block threshold.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for threshold. + */ + @java.lang.Override + public int getThresholdValue() { + return threshold_; + } + /** + * + * + *
+   * Required. The harm block threshold.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The threshold. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold getThreshold() { + com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold result = + com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold.forNumber(threshold_); + return result == null + ? com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (category_ + != com.google.cloud.vertexai.api.HarmCategory.HARM_CATEGORY_UNSPECIFIED.getNumber()) { + output.writeEnum(1, category_); + } + if (threshold_ + != com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold + .HARM_BLOCK_THRESHOLD_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, threshold_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (category_ + != com.google.cloud.vertexai.api.HarmCategory.HARM_CATEGORY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, category_); + } + if (threshold_ + != com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold + .HARM_BLOCK_THRESHOLD_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, threshold_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.SafetySetting)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.SafetySetting other = + (com.google.cloud.vertexai.api.SafetySetting) obj; + + if (category_ != other.category_) return false; + if (threshold_ != other.threshold_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + category_; + hash = (37 * hash) + THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + threshold_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.SafetySetting parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SafetySetting parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.SafetySetting prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Safety settings.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.SafetySetting} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.SafetySetting) + com.google.cloud.vertexai.api.SafetySettingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_SafetySetting_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_SafetySetting_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.SafetySetting.class, + com.google.cloud.vertexai.api.SafetySetting.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.SafetySetting.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + category_ = 0; + threshold_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_SafetySetting_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SafetySetting getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.SafetySetting.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SafetySetting build() { + com.google.cloud.vertexai.api.SafetySetting result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SafetySetting buildPartial() { + com.google.cloud.vertexai.api.SafetySetting result = + new com.google.cloud.vertexai.api.SafetySetting(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.SafetySetting result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.category_ = category_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.threshold_ = threshold_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.SafetySetting) { + return mergeFrom((com.google.cloud.vertexai.api.SafetySetting) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.SafetySetting other) { + if (other == com.google.cloud.vertexai.api.SafetySetting.getDefaultInstance()) return this; + if (other.category_ != 0) { + setCategoryValue(other.getCategoryValue()); + } + if (other.threshold_ != 0) { + setThresholdValue(other.getThresholdValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + category_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + threshold_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int category_ = 0; + /** + * + * + *
+     * Required. Harm category.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for category. + */ + @java.lang.Override + public int getCategoryValue() { + return category_; + } + /** + * + * + *
+     * Required. Harm category.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for category to set. + * @return This builder for chaining. + */ + public Builder setCategoryValue(int value) { + category_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Harm category.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.HarmCategory getCategory() { + com.google.cloud.vertexai.api.HarmCategory result = + com.google.cloud.vertexai.api.HarmCategory.forNumber(category_); + return result == null ? com.google.cloud.vertexai.api.HarmCategory.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. Harm category.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The category to set. + * @return This builder for chaining. + */ + public Builder setCategory(com.google.cloud.vertexai.api.HarmCategory value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + category_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Harm category.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + bitField0_ = (bitField0_ & ~0x00000001); + category_ = 0; + onChanged(); + return this; + } + + private int threshold_ = 0; + /** + * + * + *
+     * Required. The harm block threshold.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for threshold. + */ + @java.lang.Override + public int getThresholdValue() { + return threshold_; + } + /** + * + * + *
+     * Required. The harm block threshold.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for threshold to set. + * @return This builder for chaining. + */ + public Builder setThresholdValue(int value) { + threshold_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The harm block threshold.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The threshold. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold getThreshold() { + com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold result = + com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold.forNumber(threshold_); + return result == null + ? com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The harm block threshold.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The threshold to set. + * @return This builder for chaining. + */ + public Builder setThreshold( + com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + threshold_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The harm block threshold.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearThreshold() { + bitField0_ = (bitField0_ & ~0x00000002); + threshold_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.SafetySetting) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.SafetySetting) + private static final com.google.cloud.vertexai.api.SafetySetting DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.SafetySetting(); + } + + public static com.google.cloud.vertexai.api.SafetySetting getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SafetySetting parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SafetySetting getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetySettingOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetySettingOrBuilder.java new file mode 100644 index 000000000000..c8f98528b55e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SafetySettingOrBuilder.java @@ -0,0 +1,83 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface SafetySettingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.SafetySetting) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Harm category.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for category. + */ + int getCategoryValue(); + /** + * + * + *
+   * Required. Harm category.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.HarmCategory category = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The category. + */ + com.google.cloud.vertexai.api.HarmCategory getCategory(); + + /** + * + * + *
+   * Required. The harm block threshold.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for threshold. + */ + int getThresholdValue(); + /** + * + * + *
+   * Required. The harm block threshold.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.SafetySetting.HarmBlockThreshold threshold = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The threshold. + */ + com.google.cloud.vertexai.api.SafetySetting.HarmBlockThreshold getThreshold(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SampledShapleyAttribution.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SampledShapleyAttribution.java new file mode 100644 index 000000000000..fc403da27a17 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SampledShapleyAttribution.java @@ -0,0 +1,551 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * An attribution method that approximates Shapley values for features that
+ * contribute to the label being predicted. A sampling strategy is used to
+ * approximate the value rather than considering all subsets of features.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.SampledShapleyAttribution} + */ +public final class SampledShapleyAttribution extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.SampledShapleyAttribution) + SampledShapleyAttributionOrBuilder { + private static final long serialVersionUID = 0L; + // Use SampledShapleyAttribution.newBuilder() to construct. + private SampledShapleyAttribution(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SampledShapleyAttribution() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SampledShapleyAttribution(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_SampledShapleyAttribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_SampledShapleyAttribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.SampledShapleyAttribution.class, + com.google.cloud.vertexai.api.SampledShapleyAttribution.Builder.class); + } + + public static final int PATH_COUNT_FIELD_NUMBER = 1; + private int pathCount_ = 0; + /** + * + * + *
+   * Required. The number of feature permutations to consider when approximating
+   * the Shapley values.
+   *
+   * Valid range of its value is [1, 50], inclusively.
+   * 
+ * + * int32 path_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pathCount. + */ + @java.lang.Override + public int getPathCount() { + return pathCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (pathCount_ != 0) { + output.writeInt32(1, pathCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pathCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, pathCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.SampledShapleyAttribution)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.SampledShapleyAttribution other = + (com.google.cloud.vertexai.api.SampledShapleyAttribution) obj; + + if (getPathCount() != other.getPathCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PATH_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPathCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.SampledShapleyAttribution prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An attribution method that approximates Shapley values for features that
+   * contribute to the label being predicted. A sampling strategy is used to
+   * approximate the value rather than considering all subsets of features.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.SampledShapleyAttribution} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.SampledShapleyAttribution) + com.google.cloud.vertexai.api.SampledShapleyAttributionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_SampledShapleyAttribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_SampledShapleyAttribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.SampledShapleyAttribution.class, + com.google.cloud.vertexai.api.SampledShapleyAttribution.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.SampledShapleyAttribution.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pathCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_SampledShapleyAttribution_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SampledShapleyAttribution getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.SampledShapleyAttribution.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SampledShapleyAttribution build() { + com.google.cloud.vertexai.api.SampledShapleyAttribution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SampledShapleyAttribution buildPartial() { + com.google.cloud.vertexai.api.SampledShapleyAttribution result = + new com.google.cloud.vertexai.api.SampledShapleyAttribution(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.SampledShapleyAttribution result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pathCount_ = pathCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.SampledShapleyAttribution) { + return mergeFrom((com.google.cloud.vertexai.api.SampledShapleyAttribution) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.SampledShapleyAttribution other) { + if (other == com.google.cloud.vertexai.api.SampledShapleyAttribution.getDefaultInstance()) + return this; + if (other.getPathCount() != 0) { + setPathCount(other.getPathCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + pathCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int pathCount_; + /** + * + * + *
+     * Required. The number of feature permutations to consider when approximating
+     * the Shapley values.
+     *
+     * Valid range of its value is [1, 50], inclusively.
+     * 
+ * + * int32 path_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pathCount. + */ + @java.lang.Override + public int getPathCount() { + return pathCount_; + } + /** + * + * + *
+     * Required. The number of feature permutations to consider when approximating
+     * the Shapley values.
+     *
+     * Valid range of its value is [1, 50], inclusively.
+     * 
+ * + * int32 path_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The pathCount to set. + * @return This builder for chaining. + */ + public Builder setPathCount(int value) { + + pathCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The number of feature permutations to consider when approximating
+     * the Shapley values.
+     *
+     * Valid range of its value is [1, 50], inclusively.
+     * 
+ * + * int32 path_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPathCount() { + bitField0_ = (bitField0_ & ~0x00000001); + pathCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.SampledShapleyAttribution) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.SampledShapleyAttribution) + private static final com.google.cloud.vertexai.api.SampledShapleyAttribution DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.SampledShapleyAttribution(); + } + + public static com.google.cloud.vertexai.api.SampledShapleyAttribution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SampledShapleyAttribution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SampledShapleyAttribution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SampledShapleyAttributionOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SampledShapleyAttributionOrBuilder.java new file mode 100644 index 000000000000..553b910b56ba --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SampledShapleyAttributionOrBuilder.java @@ -0,0 +1,41 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface SampledShapleyAttributionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.SampledShapleyAttribution) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The number of feature permutations to consider when approximating
+   * the Shapley values.
+   *
+   * Valid range of its value is [1, 50], inclusively.
+   * 
+ * + * int32 path_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pathCount. + */ + int getPathCount(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Schema.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Schema.java new file mode 100644 index 000000000000..14bfc27a9d1b --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Schema.java @@ -0,0 +1,2576 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/openapi.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Schema is used to define the format of input/output data. Represents a select
+ * subset of an [OpenAPI 3.0 schema
+ * object](https://spec.openapis.org/oas/v3.0.3#schema). More fields may be
+ * added in the future as needed.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Schema} + */ +public final class Schema extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Schema) + SchemaOrBuilder { + private static final long serialVersionUID = 0L; + // Use Schema.newBuilder() to construct. + private Schema(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Schema() { + type_ = 0; + format_ = ""; + description_ = ""; + enum_ = com.google.protobuf.LazyStringArrayList.emptyList(); + required_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Schema(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.OpenApiProto + .internal_static_google_cloud_vertexai_v1beta1_Schema_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.OpenApiProto + .internal_static_google_cloud_vertexai_v1beta1_Schema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Schema.class, + com.google.cloud.vertexai.api.Schema.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + /** + * + * + *
+   * Optional. The type of the data.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Optional. The type of the data.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Type getType() { + com.google.cloud.vertexai.api.Type result = com.google.cloud.vertexai.api.Type.forNumber(type_); + return result == null ? com.google.cloud.vertexai.api.Type.UNRECOGNIZED : result; + } + + public static final int FORMAT_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object format_ = ""; + /** + * + * + *
+   * Optional. The format of the data.
+   * Supported formats:
+   *  for NUMBER type: float, double
+   *  for INTEGER type: int32, int64
+   * 
+ * + * string format = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The format. + */ + @java.lang.Override + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The format of the data.
+   * Supported formats:
+   *  for NUMBER type: float, double
+   *  for INTEGER type: int32, int64
+   * 
+ * + * string format = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for format. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. The description of the data.
+   * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The description of the data.
+   * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NULLABLE_FIELD_NUMBER = 6; + private boolean nullable_ = false; + /** + * + * + *
+   * Optional. Indicates if the value may be null.
+   * 
+ * + * bool nullable = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nullable. + */ + @java.lang.Override + public boolean getNullable() { + return nullable_; + } + + public static final int ITEMS_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.Schema items_; + /** + * + * + *
+   * Optional. Schema of the elements of Type.ARRAY.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the items field is set. + */ + @java.lang.Override + public boolean hasItems() { + return items_ != null; + } + /** + * + * + *
+   * Optional. Schema of the elements of Type.ARRAY.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The items. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Schema getItems() { + return items_ == null ? com.google.cloud.vertexai.api.Schema.getDefaultInstance() : items_; + } + /** + * + * + *
+   * Optional. Schema of the elements of Type.ARRAY.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SchemaOrBuilder getItemsOrBuilder() { + return items_ == null ? com.google.cloud.vertexai.api.Schema.getDefaultInstance() : items_; + } + + public static final int ENUM_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList enum_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. Possible values of the element of Type.STRING with enum format.
+   * For example we can define an Enum Direction as :
+   * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+   * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the enum. + */ + public com.google.protobuf.ProtocolStringList getEnumList() { + return enum_; + } + /** + * + * + *
+   * Optional. Possible values of the element of Type.STRING with enum format.
+   * For example we can define an Enum Direction as :
+   * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+   * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of enum. + */ + public int getEnumCount() { + return enum_.size(); + } + /** + * + * + *
+   * Optional. Possible values of the element of Type.STRING with enum format.
+   * For example we can define an Enum Direction as :
+   * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+   * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The enum at the given index. + */ + public java.lang.String getEnum(int index) { + return enum_.get(index); + } + /** + * + * + *
+   * Optional. Possible values of the element of Type.STRING with enum format.
+   * For example we can define an Enum Direction as :
+   * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+   * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the enum at the given index. + */ + public com.google.protobuf.ByteString getEnumBytes(int index) { + return enum_.getByteString(index); + } + + public static final int PROPERTIES_FIELD_NUMBER = 3; + + private static final class PropertiesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.Schema> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.vertexai.api.OpenApiProto + .internal_static_google_cloud_vertexai_v1beta1_Schema_PropertiesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.vertexai.api.Schema.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + properties_; + + private com.google.protobuf.MapField + internalGetProperties() { + if (properties_ == null) { + return com.google.protobuf.MapField.emptyMapField(PropertiesDefaultEntryHolder.defaultEntry); + } + return properties_; + } + + public int getPropertiesCount() { + return internalGetProperties().getMap().size(); + } + /** + * + * + *
+   * Optional. Properties of Type.OBJECT.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsProperties(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetProperties().getMap().containsKey(key); + } + /** Use {@link #getPropertiesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getProperties() { + return getPropertiesMap(); + } + /** + * + * + *
+   * Optional. Properties of Type.OBJECT.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getPropertiesMap() { + return internalGetProperties().getMap(); + } + /** + * + * + *
+   * Optional. Properties of Type.OBJECT.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.Schema getPropertiesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.Schema defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Properties of Type.OBJECT.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Schema getPropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int REQUIRED_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList required_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. Required properties of Type.OBJECT.
+   * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the required. + */ + public com.google.protobuf.ProtocolStringList getRequiredList() { + return required_; + } + /** + * + * + *
+   * Optional. Required properties of Type.OBJECT.
+   * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of required. + */ + public int getRequiredCount() { + return required_.size(); + } + /** + * + * + *
+   * Optional. Required properties of Type.OBJECT.
+   * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The required at the given index. + */ + public java.lang.String getRequired(int index) { + return required_.get(index); + } + /** + * + * + *
+   * Optional. Required properties of Type.OBJECT.
+   * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the required at the given index. + */ + public com.google.protobuf.ByteString getRequiredBytes(int index) { + return required_.getByteString(index); + } + + public static final int EXAMPLE_FIELD_NUMBER = 4; + private com.google.protobuf.Value example_; + /** + * + * + *
+   * Optional. Example of the object. Will only populated when the object is the
+   * root.
+   * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the example field is set. + */ + @java.lang.Override + public boolean hasExample() { + return example_ != null; + } + /** + * + * + *
+   * Optional. Example of the object. Will only populated when the object is the
+   * root.
+   * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The example. + */ + @java.lang.Override + public com.google.protobuf.Value getExample() { + return example_ == null ? com.google.protobuf.Value.getDefaultInstance() : example_; + } + /** + * + * + *
+   * Optional. Example of the object. Will only populated when the object is the
+   * root.
+   * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getExampleOrBuilder() { + return example_ == null ? com.google.protobuf.Value.getDefaultInstance() : example_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ != com.google.cloud.vertexai.api.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (items_ != null) { + output.writeMessage(2, getItems()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetProperties(), PropertiesDefaultEntryHolder.defaultEntry, 3); + if (example_ != null) { + output.writeMessage(4, getExample()); + } + for (int i = 0; i < required_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, required_.getRaw(i)); + } + if (nullable_ != false) { + output.writeBool(6, nullable_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(format_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, format_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, description_); + } + for (int i = 0; i < enum_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, enum_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != com.google.cloud.vertexai.api.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (items_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getItems()); + } + for (java.util.Map.Entry entry : + internalGetProperties().getMap().entrySet()) { + com.google.protobuf.MapEntry + properties__ = + PropertiesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, properties__); + } + if (example_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getExample()); + } + { + int dataSize = 0; + for (int i = 0; i < required_.size(); i++) { + dataSize += computeStringSizeNoTag(required_.getRaw(i)); + } + size += dataSize; + size += 1 * getRequiredList().size(); + } + if (nullable_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, nullable_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(format_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, format_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, description_); + } + { + int dataSize = 0; + for (int i = 0; i < enum_.size(); i++) { + dataSize += computeStringSizeNoTag(enum_.getRaw(i)); + } + size += dataSize; + size += 1 * getEnumList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Schema)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Schema other = (com.google.cloud.vertexai.api.Schema) obj; + + if (type_ != other.type_) return false; + if (!getFormat().equals(other.getFormat())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (getNullable() != other.getNullable()) return false; + if (hasItems() != other.hasItems()) return false; + if (hasItems()) { + if (!getItems().equals(other.getItems())) return false; + } + if (!getEnumList().equals(other.getEnumList())) return false; + if (!internalGetProperties().equals(other.internalGetProperties())) return false; + if (!getRequiredList().equals(other.getRequiredList())) return false; + if (hasExample() != other.hasExample()) return false; + if (hasExample()) { + if (!getExample().equals(other.getExample())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + NULLABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getNullable()); + if (hasItems()) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItems().hashCode(); + } + if (getEnumCount() > 0) { + hash = (37 * hash) + ENUM_FIELD_NUMBER; + hash = (53 * hash) + getEnumList().hashCode(); + } + if (!internalGetProperties().getMap().isEmpty()) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + internalGetProperties().hashCode(); + } + if (getRequiredCount() > 0) { + hash = (37 * hash) + REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + getRequiredList().hashCode(); + } + if (hasExample()) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExample().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Schema parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Schema parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Schema parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Schema parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Schema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Schema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Schema parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Schema parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Schema parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Schema parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Schema parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Schema parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Schema prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Schema is used to define the format of input/output data. Represents a select
+   * subset of an [OpenAPI 3.0 schema
+   * object](https://spec.openapis.org/oas/v3.0.3#schema). More fields may be
+   * added in the future as needed.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Schema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Schema) + com.google.cloud.vertexai.api.SchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.OpenApiProto + .internal_static_google_cloud_vertexai_v1beta1_Schema_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 3: + return internalGetMutableProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.OpenApiProto + .internal_static_google_cloud_vertexai_v1beta1_Schema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Schema.class, + com.google.cloud.vertexai.api.Schema.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Schema.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + format_ = ""; + description_ = ""; + nullable_ = false; + items_ = null; + if (itemsBuilder_ != null) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + } + enum_ = com.google.protobuf.LazyStringArrayList.emptyList(); + internalGetMutableProperties().clear(); + required_ = com.google.protobuf.LazyStringArrayList.emptyList(); + example_ = null; + if (exampleBuilder_ != null) { + exampleBuilder_.dispose(); + exampleBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.OpenApiProto + .internal_static_google_cloud_vertexai_v1beta1_Schema_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Schema getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Schema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Schema build() { + com.google.cloud.vertexai.api.Schema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Schema buildPartial() { + com.google.cloud.vertexai.api.Schema result = new com.google.cloud.vertexai.api.Schema(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Schema result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.format_ = format_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.nullable_ = nullable_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.items_ = itemsBuilder_ == null ? items_ : itemsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + enum_.makeImmutable(); + result.enum_ = enum_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.properties_ = internalGetProperties(); + result.properties_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + required_.makeImmutable(); + result.required_ = required_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.example_ = exampleBuilder_ == null ? example_ : exampleBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Schema) { + return mergeFrom((com.google.cloud.vertexai.api.Schema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Schema other) { + if (other == com.google.cloud.vertexai.api.Schema.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getNullable() != false) { + setNullable(other.getNullable()); + } + if (other.hasItems()) { + mergeItems(other.getItems()); + } + if (!other.enum_.isEmpty()) { + if (enum_.isEmpty()) { + enum_ = other.enum_; + bitField0_ |= 0x00000020; + } else { + ensureEnumIsMutable(); + enum_.addAll(other.enum_); + } + onChanged(); + } + internalGetMutableProperties().mergeFrom(other.internalGetProperties()); + bitField0_ |= 0x00000040; + if (!other.required_.isEmpty()) { + if (required_.isEmpty()) { + required_ = other.required_; + bitField0_ |= 0x00000080; + } else { + ensureRequiredIsMutable(); + required_.addAll(other.required_); + } + onChanged(); + } + if (other.hasExample()) { + mergeExample(other.getExample()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getItemsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry + properties__ = + input.readMessage( + PropertiesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableProperties() + .getMutableMap() + .put(properties__.getKey(), properties__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 26 + case 34: + { + input.readMessage(getExampleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRequiredIsMutable(); + required_.add(s); + break; + } // case 42 + case 48: + { + nullable_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 48 + case 58: + { + format_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 58 + case 66: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 66 + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureEnumIsMutable(); + enum_.add(s); + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int type_ = 0; + /** + * + * + *
+     * Optional. The type of the data.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Optional. The type of the data.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The type of the data.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Type getType() { + com.google.cloud.vertexai.api.Type result = + com.google.cloud.vertexai.api.Type.forNumber(type_); + return result == null ? com.google.cloud.vertexai.api.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. The type of the data.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.vertexai.api.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The type of the data.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * + * + *
+     * Optional. The format of the data.
+     * Supported formats:
+     *  for NUMBER type: float, double
+     *  for INTEGER type: int32, int64
+     * 
+ * + * string format = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The format. + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The format of the data.
+     * Supported formats:
+     *  for NUMBER type: float, double
+     *  for INTEGER type: int32, int64
+     * 
+ * + * string format = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for format. + */ + public com.google.protobuf.ByteString getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The format of the data.
+     * Supported formats:
+     *  for NUMBER type: float, double
+     *  for INTEGER type: int32, int64
+     * 
+ * + * string format = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The format to set. + * @return This builder for chaining. + */ + public Builder setFormat(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + format_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The format of the data.
+     * Supported formats:
+     *  for NUMBER type: float, double
+     *  for INTEGER type: int32, int64
+     * 
+ * + * string format = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFormat() { + format_ = getDefaultInstance().getFormat(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The format of the data.
+     * Supported formats:
+     *  for NUMBER type: float, double
+     *  for INTEGER type: int32, int64
+     * 
+ * + * string format = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for format to set. + * @return This builder for chaining. + */ + public Builder setFormatBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + format_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. The description of the data.
+     * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The description of the data.
+     * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The description of the data.
+     * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The description of the data.
+     * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The description of the data.
+     * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean nullable_; + /** + * + * + *
+     * Optional. Indicates if the value may be null.
+     * 
+ * + * bool nullable = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nullable. + */ + @java.lang.Override + public boolean getNullable() { + return nullable_; + } + /** + * + * + *
+     * Optional. Indicates if the value may be null.
+     * 
+ * + * bool nullable = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The nullable to set. + * @return This builder for chaining. + */ + public Builder setNullable(boolean value) { + + nullable_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Indicates if the value may be null.
+     * 
+ * + * bool nullable = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNullable() { + bitField0_ = (bitField0_ & ~0x00000008); + nullable_ = false; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.Schema items_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Schema, + com.google.cloud.vertexai.api.Schema.Builder, + com.google.cloud.vertexai.api.SchemaOrBuilder> + itemsBuilder_; + /** + * + * + *
+     * Optional. Schema of the elements of Type.ARRAY.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the items field is set. + */ + public boolean hasItems() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Optional. Schema of the elements of Type.ARRAY.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The items. + */ + public com.google.cloud.vertexai.api.Schema getItems() { + if (itemsBuilder_ == null) { + return items_ == null ? com.google.cloud.vertexai.api.Schema.getDefaultInstance() : items_; + } else { + return itemsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Schema of the elements of Type.ARRAY.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setItems(com.google.cloud.vertexai.api.Schema value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + items_ = value; + } else { + itemsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Schema of the elements of Type.ARRAY.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setItems(com.google.cloud.vertexai.api.Schema.Builder builderForValue) { + if (itemsBuilder_ == null) { + items_ = builderForValue.build(); + } else { + itemsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Schema of the elements of Type.ARRAY.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeItems(com.google.cloud.vertexai.api.Schema value) { + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && items_ != null + && items_ != com.google.cloud.vertexai.api.Schema.getDefaultInstance()) { + getItemsBuilder().mergeFrom(value); + } else { + items_ = value; + } + } else { + itemsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Schema of the elements of Type.ARRAY.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearItems() { + bitField0_ = (bitField0_ & ~0x00000010); + items_ = null; + if (itemsBuilder_ != null) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Schema of the elements of Type.ARRAY.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Schema.Builder getItemsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getItemsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Schema of the elements of Type.ARRAY.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.SchemaOrBuilder getItemsOrBuilder() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilder(); + } else { + return items_ == null ? com.google.cloud.vertexai.api.Schema.getDefaultInstance() : items_; + } + } + /** + * + * + *
+     * Optional. Schema of the elements of Type.ARRAY.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Schema, + com.google.cloud.vertexai.api.Schema.Builder, + com.google.cloud.vertexai.api.SchemaOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Schema, + com.google.cloud.vertexai.api.Schema.Builder, + com.google.cloud.vertexai.api.SchemaOrBuilder>( + getItems(), getParentForChildren(), isClean()); + items_ = null; + } + return itemsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList enum_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureEnumIsMutable() { + if (!enum_.isModifiable()) { + enum_ = new com.google.protobuf.LazyStringArrayList(enum_); + } + bitField0_ |= 0x00000020; + } + /** + * + * + *
+     * Optional. Possible values of the element of Type.STRING with enum format.
+     * For example we can define an Enum Direction as :
+     * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+     * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the enum. + */ + public com.google.protobuf.ProtocolStringList getEnumList() { + enum_.makeImmutable(); + return enum_; + } + /** + * + * + *
+     * Optional. Possible values of the element of Type.STRING with enum format.
+     * For example we can define an Enum Direction as :
+     * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+     * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of enum. + */ + public int getEnumCount() { + return enum_.size(); + } + /** + * + * + *
+     * Optional. Possible values of the element of Type.STRING with enum format.
+     * For example we can define an Enum Direction as :
+     * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+     * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The enum at the given index. + */ + public java.lang.String getEnum(int index) { + return enum_.get(index); + } + /** + * + * + *
+     * Optional. Possible values of the element of Type.STRING with enum format.
+     * For example we can define an Enum Direction as :
+     * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+     * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the enum at the given index. + */ + public com.google.protobuf.ByteString getEnumBytes(int index) { + return enum_.getByteString(index); + } + /** + * + * + *
+     * Optional. Possible values of the element of Type.STRING with enum format.
+     * For example we can define an Enum Direction as :
+     * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+     * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The enum to set. + * @return This builder for chaining. + */ + public Builder setEnum(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnumIsMutable(); + enum_.set(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Possible values of the element of Type.STRING with enum format.
+     * For example we can define an Enum Direction as :
+     * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+     * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The enum to add. + * @return This builder for chaining. + */ + public Builder addEnum(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnumIsMutable(); + enum_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Possible values of the element of Type.STRING with enum format.
+     * For example we can define an Enum Direction as :
+     * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+     * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The enum to add. + * @return This builder for chaining. + */ + public Builder addAllEnum(java.lang.Iterable values) { + ensureEnumIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, enum_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Possible values of the element of Type.STRING with enum format.
+     * For example we can define an Enum Direction as :
+     * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+     * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEnum() { + enum_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Possible values of the element of Type.STRING with enum format.
+     * For example we can define an Enum Direction as :
+     * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+     * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the enum to add. + * @return This builder for chaining. + */ + public Builder addEnumBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureEnumIsMutable(); + enum_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.MapField + properties_; + + private com.google.protobuf.MapField + internalGetProperties() { + if (properties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PropertiesDefaultEntryHolder.defaultEntry); + } + return properties_; + } + + private com.google.protobuf.MapField + internalGetMutableProperties() { + if (properties_ == null) { + properties_ = + com.google.protobuf.MapField.newMapField(PropertiesDefaultEntryHolder.defaultEntry); + } + if (!properties_.isMutable()) { + properties_ = properties_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return properties_; + } + + public int getPropertiesCount() { + return internalGetProperties().getMap().size(); + } + /** + * + * + *
+     * Optional. Properties of Type.OBJECT.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsProperties(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetProperties().getMap().containsKey(key); + } + /** Use {@link #getPropertiesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getProperties() { + return getPropertiesMap(); + } + /** + * + * + *
+     * Optional. Properties of Type.OBJECT.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map + getPropertiesMap() { + return internalGetProperties().getMap(); + } + /** + * + * + *
+     * Optional. Properties of Type.OBJECT.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.Schema getPropertiesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.Schema defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Properties of Type.OBJECT.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Schema getPropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearProperties() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableProperties().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Properties of Type.OBJECT.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeProperties(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableProperties().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableProperties() { + bitField0_ |= 0x00000040; + return internalGetMutableProperties().getMutableMap(); + } + /** + * + * + *
+     * Optional. Properties of Type.OBJECT.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putProperties(java.lang.String key, com.google.cloud.vertexai.api.Schema value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableProperties().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * Optional. Properties of Type.OBJECT.
+     * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllProperties( + java.util.Map values) { + internalGetMutableProperties().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private com.google.protobuf.LazyStringArrayList required_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRequiredIsMutable() { + if (!required_.isModifiable()) { + required_ = new com.google.protobuf.LazyStringArrayList(required_); + } + bitField0_ |= 0x00000080; + } + /** + * + * + *
+     * Optional. Required properties of Type.OBJECT.
+     * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the required. + */ + public com.google.protobuf.ProtocolStringList getRequiredList() { + required_.makeImmutable(); + return required_; + } + /** + * + * + *
+     * Optional. Required properties of Type.OBJECT.
+     * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of required. + */ + public int getRequiredCount() { + return required_.size(); + } + /** + * + * + *
+     * Optional. Required properties of Type.OBJECT.
+     * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The required at the given index. + */ + public java.lang.String getRequired(int index) { + return required_.get(index); + } + /** + * + * + *
+     * Optional. Required properties of Type.OBJECT.
+     * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the required at the given index. + */ + public com.google.protobuf.ByteString getRequiredBytes(int index) { + return required_.getByteString(index); + } + /** + * + * + *
+     * Optional. Required properties of Type.OBJECT.
+     * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The required to set. + * @return This builder for chaining. + */ + public Builder setRequired(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequiredIsMutable(); + required_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required properties of Type.OBJECT.
+     * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The required to add. + * @return This builder for chaining. + */ + public Builder addRequired(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequiredIsMutable(); + required_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required properties of Type.OBJECT.
+     * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The required to add. + * @return This builder for chaining. + */ + public Builder addAllRequired(java.lang.Iterable values) { + ensureRequiredIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, required_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required properties of Type.OBJECT.
+     * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequired() { + required_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Required properties of Type.OBJECT.
+     * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the required to add. + * @return This builder for chaining. + */ + public Builder addRequiredBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRequiredIsMutable(); + required_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.Value example_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + exampleBuilder_; + /** + * + * + *
+     * Optional. Example of the object. Will only populated when the object is the
+     * root.
+     * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the example field is set. + */ + public boolean hasExample() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Optional. Example of the object. Will only populated when the object is the
+     * root.
+     * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The example. + */ + public com.google.protobuf.Value getExample() { + if (exampleBuilder_ == null) { + return example_ == null ? com.google.protobuf.Value.getDefaultInstance() : example_; + } else { + return exampleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Example of the object. Will only populated when the object is the
+     * root.
+     * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setExample(com.google.protobuf.Value value) { + if (exampleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + example_ = value; + } else { + exampleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Example of the object. Will only populated when the object is the
+     * root.
+     * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setExample(com.google.protobuf.Value.Builder builderForValue) { + if (exampleBuilder_ == null) { + example_ = builderForValue.build(); + } else { + exampleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Example of the object. Will only populated when the object is the
+     * root.
+     * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder mergeExample(com.google.protobuf.Value value) { + if (exampleBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && example_ != null + && example_ != com.google.protobuf.Value.getDefaultInstance()) { + getExampleBuilder().mergeFrom(value); + } else { + example_ = value; + } + } else { + exampleBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Example of the object. Will only populated when the object is the
+     * root.
+     * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearExample() { + bitField0_ = (bitField0_ & ~0x00000100); + example_ = null; + if (exampleBuilder_ != null) { + exampleBuilder_.dispose(); + exampleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Example of the object. Will only populated when the object is the
+     * root.
+     * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.Value.Builder getExampleBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getExampleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Example of the object. Will only populated when the object is the
+     * root.
+     * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.ValueOrBuilder getExampleOrBuilder() { + if (exampleBuilder_ != null) { + return exampleBuilder_.getMessageOrBuilder(); + } else { + return example_ == null ? com.google.protobuf.Value.getDefaultInstance() : example_; + } + } + /** + * + * + *
+     * Optional. Example of the object. Will only populated when the object is the
+     * root.
+     * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getExampleFieldBuilder() { + if (exampleBuilder_ == null) { + exampleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getExample(), getParentForChildren(), isClean()); + example_ = null; + } + return exampleBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Schema) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Schema) + private static final com.google.cloud.vertexai.api.Schema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Schema(); + } + + public static com.google.cloud.vertexai.api.Schema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Schema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Schema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SchemaOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SchemaOrBuilder.java new file mode 100644 index 000000000000..ec7b1f224327 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SchemaOrBuilder.java @@ -0,0 +1,378 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/openapi.proto + +package com.google.cloud.vertexai.api; + +public interface SchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Schema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The type of the data.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Optional. The type of the data.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Type type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The type. + */ + com.google.cloud.vertexai.api.Type getType(); + + /** + * + * + *
+   * Optional. The format of the data.
+   * Supported formats:
+   *  for NUMBER type: float, double
+   *  for INTEGER type: int32, int64
+   * 
+ * + * string format = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The format. + */ + java.lang.String getFormat(); + /** + * + * + *
+   * Optional. The format of the data.
+   * Supported formats:
+   *  for NUMBER type: float, double
+   *  for INTEGER type: int32, int64
+   * 
+ * + * string format = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for format. + */ + com.google.protobuf.ByteString getFormatBytes(); + + /** + * + * + *
+   * Optional. The description of the data.
+   * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. The description of the data.
+   * 
+ * + * string description = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. Indicates if the value may be null.
+   * 
+ * + * bool nullable = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nullable. + */ + boolean getNullable(); + + /** + * + * + *
+   * Optional. Schema of the elements of Type.ARRAY.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the items field is set. + */ + boolean hasItems(); + /** + * + * + *
+   * Optional. Schema of the elements of Type.ARRAY.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The items. + */ + com.google.cloud.vertexai.api.Schema getItems(); + /** + * + * + *
+   * Optional. Schema of the elements of Type.ARRAY.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Schema items = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.SchemaOrBuilder getItemsOrBuilder(); + + /** + * + * + *
+   * Optional. Possible values of the element of Type.STRING with enum format.
+   * For example we can define an Enum Direction as :
+   * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+   * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the enum. + */ + java.util.List getEnumList(); + /** + * + * + *
+   * Optional. Possible values of the element of Type.STRING with enum format.
+   * For example we can define an Enum Direction as :
+   * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+   * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of enum. + */ + int getEnumCount(); + /** + * + * + *
+   * Optional. Possible values of the element of Type.STRING with enum format.
+   * For example we can define an Enum Direction as :
+   * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+   * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The enum at the given index. + */ + java.lang.String getEnum(int index); + /** + * + * + *
+   * Optional. Possible values of the element of Type.STRING with enum format.
+   * For example we can define an Enum Direction as :
+   * {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
+   * 
+ * + * repeated string enum = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the enum at the given index. + */ + com.google.protobuf.ByteString getEnumBytes(int index); + + /** + * + * + *
+   * Optional. Properties of Type.OBJECT.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getPropertiesCount(); + /** + * + * + *
+   * Optional. Properties of Type.OBJECT.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsProperties(java.lang.String key); + /** Use {@link #getPropertiesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getProperties(); + /** + * + * + *
+   * Optional. Properties of Type.OBJECT.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getPropertiesMap(); + /** + * + * + *
+   * Optional. Properties of Type.OBJECT.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + com.google.cloud.vertexai.api.Schema getPropertiesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.Schema defaultValue); + /** + * + * + *
+   * Optional. Properties of Type.OBJECT.
+   * 
+ * + * + * map<string, .google.cloud.vertexai.v1beta1.Schema> properties = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.Schema getPropertiesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. Required properties of Type.OBJECT.
+   * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the required. + */ + java.util.List getRequiredList(); + /** + * + * + *
+   * Optional. Required properties of Type.OBJECT.
+   * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of required. + */ + int getRequiredCount(); + /** + * + * + *
+   * Optional. Required properties of Type.OBJECT.
+   * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The required at the given index. + */ + java.lang.String getRequired(int index); + /** + * + * + *
+   * Optional. Required properties of Type.OBJECT.
+   * 
+ * + * repeated string required = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the required at the given index. + */ + com.google.protobuf.ByteString getRequiredBytes(int index); + + /** + * + * + *
+   * Optional. Example of the object. Will only populated when the object is the
+   * root.
+   * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the example field is set. + */ + boolean hasExample(); + /** + * + * + *
+   * Optional. Example of the object. Will only populated when the object is the
+   * root.
+   * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The example. + */ + com.google.protobuf.Value getExample(); + /** + * + * + *
+   * Optional. Example of the object. Will only populated when the object is the
+   * root.
+   * 
+ * + * .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.protobuf.ValueOrBuilder getExampleOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SmoothGradConfig.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SmoothGradConfig.java new file mode 100644 index 000000000000..08e761a4916e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SmoothGradConfig.java @@ -0,0 +1,1225 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Config for SmoothGrad approximation of gradients.
+ *
+ * When enabled, the gradients are approximated by averaging the gradients from
+ * noisy samples in the vicinity of the inputs. Adding noise can help improve
+ * the computed gradients. Refer to this paper for more details:
+ * https://arxiv.org/pdf/1706.03825.pdf
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.SmoothGradConfig} + */ +public final class SmoothGradConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.SmoothGradConfig) + SmoothGradConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use SmoothGradConfig.newBuilder() to construct. + private SmoothGradConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SmoothGradConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SmoothGradConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_SmoothGradConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_SmoothGradConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.SmoothGradConfig.class, + com.google.cloud.vertexai.api.SmoothGradConfig.Builder.class); + } + + private int gradientNoiseSigmaCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object gradientNoiseSigma_; + + public enum GradientNoiseSigmaCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + NOISE_SIGMA(1), + FEATURE_NOISE_SIGMA(2), + GRADIENTNOISESIGMA_NOT_SET(0); + private final int value; + + private GradientNoiseSigmaCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static GradientNoiseSigmaCase valueOf(int value) { + return forNumber(value); + } + + public static GradientNoiseSigmaCase forNumber(int value) { + switch (value) { + case 1: + return NOISE_SIGMA; + case 2: + return FEATURE_NOISE_SIGMA; + case 0: + return GRADIENTNOISESIGMA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public GradientNoiseSigmaCase getGradientNoiseSigmaCase() { + return GradientNoiseSigmaCase.forNumber(gradientNoiseSigmaCase_); + } + + public static final int NOISE_SIGMA_FIELD_NUMBER = 1; + /** + * + * + *
+   * This is a single float value and will be used to add noise to all the
+   * features. Use this field when all features are normalized to have the
+   * same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where
+   * features are normalized to have 0-mean and 1-variance. Learn more about
+   * [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization).
+   *
+   * For best results the recommended value is about 10% - 20% of the standard
+   * deviation of the input feature. Refer to section 3.2 of the SmoothGrad
+   * paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1.
+   *
+   * If the distribution is different per feature, set
+   * [feature_noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.feature_noise_sigma]
+   * instead for each feature.
+   * 
+ * + * float noise_sigma = 1; + * + * @return Whether the noiseSigma field is set. + */ + @java.lang.Override + public boolean hasNoiseSigma() { + return gradientNoiseSigmaCase_ == 1; + } + /** + * + * + *
+   * This is a single float value and will be used to add noise to all the
+   * features. Use this field when all features are normalized to have the
+   * same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where
+   * features are normalized to have 0-mean and 1-variance. Learn more about
+   * [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization).
+   *
+   * For best results the recommended value is about 10% - 20% of the standard
+   * deviation of the input feature. Refer to section 3.2 of the SmoothGrad
+   * paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1.
+   *
+   * If the distribution is different per feature, set
+   * [feature_noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.feature_noise_sigma]
+   * instead for each feature.
+   * 
+ * + * float noise_sigma = 1; + * + * @return The noiseSigma. + */ + @java.lang.Override + public float getNoiseSigma() { + if (gradientNoiseSigmaCase_ == 1) { + return (java.lang.Float) gradientNoiseSigma_; + } + return 0F; + } + + public static final int FEATURE_NOISE_SIGMA_FIELD_NUMBER = 2; + /** + * + * + *
+   * This is similar to
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+   * but provides additional flexibility. A separate noise sigma can be
+   * provided for each feature, which is useful if their distributions are
+   * different. No noise is added to features that are not set. If this field
+   * is unset,
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+   * will be used for all features.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + * + * @return Whether the featureNoiseSigma field is set. + */ + @java.lang.Override + public boolean hasFeatureNoiseSigma() { + return gradientNoiseSigmaCase_ == 2; + } + /** + * + * + *
+   * This is similar to
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+   * but provides additional flexibility. A separate noise sigma can be
+   * provided for each feature, which is useful if their distributions are
+   * different. No noise is added to features that are not set. If this field
+   * is unset,
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+   * will be used for all features.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + * + * @return The featureNoiseSigma. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma getFeatureNoiseSigma() { + if (gradientNoiseSigmaCase_ == 2) { + return (com.google.cloud.vertexai.api.FeatureNoiseSigma) gradientNoiseSigma_; + } + return com.google.cloud.vertexai.api.FeatureNoiseSigma.getDefaultInstance(); + } + /** + * + * + *
+   * This is similar to
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+   * but provides additional flexibility. A separate noise sigma can be
+   * provided for each feature, which is useful if their distributions are
+   * different. No noise is added to features that are not set. If this field
+   * is unset,
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+   * will be used for all features.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigmaOrBuilder getFeatureNoiseSigmaOrBuilder() { + if (gradientNoiseSigmaCase_ == 2) { + return (com.google.cloud.vertexai.api.FeatureNoiseSigma) gradientNoiseSigma_; + } + return com.google.cloud.vertexai.api.FeatureNoiseSigma.getDefaultInstance(); + } + + public static final int NOISY_SAMPLE_COUNT_FIELD_NUMBER = 3; + private int noisySampleCount_ = 0; + /** + * + * + *
+   * The number of gradient samples to use for
+   * approximation. The higher this number, the more accurate the gradient
+   * is, but the runtime complexity increases by this factor as well.
+   * Valid range of its value is [1, 50]. Defaults to 3.
+   * 
+ * + * int32 noisy_sample_count = 3; + * + * @return The noisySampleCount. + */ + @java.lang.Override + public int getNoisySampleCount() { + return noisySampleCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gradientNoiseSigmaCase_ == 1) { + output.writeFloat(1, (float) ((java.lang.Float) gradientNoiseSigma_)); + } + if (gradientNoiseSigmaCase_ == 2) { + output.writeMessage(2, (com.google.cloud.vertexai.api.FeatureNoiseSigma) gradientNoiseSigma_); + } + if (noisySampleCount_ != 0) { + output.writeInt32(3, noisySampleCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gradientNoiseSigmaCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeFloatSize( + 1, (float) ((java.lang.Float) gradientNoiseSigma_)); + } + if (gradientNoiseSigmaCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.vertexai.api.FeatureNoiseSigma) gradientNoiseSigma_); + } + if (noisySampleCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, noisySampleCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.SmoothGradConfig)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.SmoothGradConfig other = + (com.google.cloud.vertexai.api.SmoothGradConfig) obj; + + if (getNoisySampleCount() != other.getNoisySampleCount()) return false; + if (!getGradientNoiseSigmaCase().equals(other.getGradientNoiseSigmaCase())) return false; + switch (gradientNoiseSigmaCase_) { + case 1: + if (java.lang.Float.floatToIntBits(getNoiseSigma()) + != java.lang.Float.floatToIntBits(other.getNoiseSigma())) return false; + break; + case 2: + if (!getFeatureNoiseSigma().equals(other.getFeatureNoiseSigma())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NOISY_SAMPLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNoisySampleCount(); + switch (gradientNoiseSigmaCase_) { + case 1: + hash = (37 * hash) + NOISE_SIGMA_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getNoiseSigma()); + break; + case 2: + hash = (37 * hash) + FEATURE_NOISE_SIGMA_FIELD_NUMBER; + hash = (53 * hash) + getFeatureNoiseSigma().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.SmoothGradConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients from
+   * noisy samples in the vicinity of the inputs. Adding noise can help improve
+   * the computed gradients. Refer to this paper for more details:
+   * https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.SmoothGradConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.SmoothGradConfig) + com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_SmoothGradConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_SmoothGradConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.SmoothGradConfig.class, + com.google.cloud.vertexai.api.SmoothGradConfig.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.SmoothGradConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (featureNoiseSigmaBuilder_ != null) { + featureNoiseSigmaBuilder_.clear(); + } + noisySampleCount_ = 0; + gradientNoiseSigmaCase_ = 0; + gradientNoiseSigma_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_SmoothGradConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SmoothGradConfig getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SmoothGradConfig build() { + com.google.cloud.vertexai.api.SmoothGradConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SmoothGradConfig buildPartial() { + com.google.cloud.vertexai.api.SmoothGradConfig result = + new com.google.cloud.vertexai.api.SmoothGradConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.SmoothGradConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.noisySampleCount_ = noisySampleCount_; + } + } + + private void buildPartialOneofs(com.google.cloud.vertexai.api.SmoothGradConfig result) { + result.gradientNoiseSigmaCase_ = gradientNoiseSigmaCase_; + result.gradientNoiseSigma_ = this.gradientNoiseSigma_; + if (gradientNoiseSigmaCase_ == 2 && featureNoiseSigmaBuilder_ != null) { + result.gradientNoiseSigma_ = featureNoiseSigmaBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.SmoothGradConfig) { + return mergeFrom((com.google.cloud.vertexai.api.SmoothGradConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.SmoothGradConfig other) { + if (other == com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance()) return this; + if (other.getNoisySampleCount() != 0) { + setNoisySampleCount(other.getNoisySampleCount()); + } + switch (other.getGradientNoiseSigmaCase()) { + case NOISE_SIGMA: + { + setNoiseSigma(other.getNoiseSigma()); + break; + } + case FEATURE_NOISE_SIGMA: + { + mergeFeatureNoiseSigma(other.getFeatureNoiseSigma()); + break; + } + case GRADIENTNOISESIGMA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + gradientNoiseSigma_ = input.readFloat(); + gradientNoiseSigmaCase_ = 1; + break; + } // case 13 + case 18: + { + input.readMessage( + getFeatureNoiseSigmaFieldBuilder().getBuilder(), extensionRegistry); + gradientNoiseSigmaCase_ = 2; + break; + } // case 18 + case 24: + { + noisySampleCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int gradientNoiseSigmaCase_ = 0; + private java.lang.Object gradientNoiseSigma_; + + public GradientNoiseSigmaCase getGradientNoiseSigmaCase() { + return GradientNoiseSigmaCase.forNumber(gradientNoiseSigmaCase_); + } + + public Builder clearGradientNoiseSigma() { + gradientNoiseSigmaCase_ = 0; + gradientNoiseSigma_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * This is a single float value and will be used to add noise to all the
+     * features. Use this field when all features are normalized to have the
+     * same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where
+     * features are normalized to have 0-mean and 1-variance. Learn more about
+     * [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization).
+     *
+     * For best results the recommended value is about 10% - 20% of the standard
+     * deviation of the input feature. Refer to section 3.2 of the SmoothGrad
+     * paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1.
+     *
+     * If the distribution is different per feature, set
+     * [feature_noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.feature_noise_sigma]
+     * instead for each feature.
+     * 
+ * + * float noise_sigma = 1; + * + * @return Whether the noiseSigma field is set. + */ + public boolean hasNoiseSigma() { + return gradientNoiseSigmaCase_ == 1; + } + /** + * + * + *
+     * This is a single float value and will be used to add noise to all the
+     * features. Use this field when all features are normalized to have the
+     * same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where
+     * features are normalized to have 0-mean and 1-variance. Learn more about
+     * [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization).
+     *
+     * For best results the recommended value is about 10% - 20% of the standard
+     * deviation of the input feature. Refer to section 3.2 of the SmoothGrad
+     * paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1.
+     *
+     * If the distribution is different per feature, set
+     * [feature_noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.feature_noise_sigma]
+     * instead for each feature.
+     * 
+ * + * float noise_sigma = 1; + * + * @return The noiseSigma. + */ + public float getNoiseSigma() { + if (gradientNoiseSigmaCase_ == 1) { + return (java.lang.Float) gradientNoiseSigma_; + } + return 0F; + } + /** + * + * + *
+     * This is a single float value and will be used to add noise to all the
+     * features. Use this field when all features are normalized to have the
+     * same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where
+     * features are normalized to have 0-mean and 1-variance. Learn more about
+     * [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization).
+     *
+     * For best results the recommended value is about 10% - 20% of the standard
+     * deviation of the input feature. Refer to section 3.2 of the SmoothGrad
+     * paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1.
+     *
+     * If the distribution is different per feature, set
+     * [feature_noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.feature_noise_sigma]
+     * instead for each feature.
+     * 
+ * + * float noise_sigma = 1; + * + * @param value The noiseSigma to set. + * @return This builder for chaining. + */ + public Builder setNoiseSigma(float value) { + + gradientNoiseSigmaCase_ = 1; + gradientNoiseSigma_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This is a single float value and will be used to add noise to all the
+     * features. Use this field when all features are normalized to have the
+     * same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where
+     * features are normalized to have 0-mean and 1-variance. Learn more about
+     * [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization).
+     *
+     * For best results the recommended value is about 10% - 20% of the standard
+     * deviation of the input feature. Refer to section 3.2 of the SmoothGrad
+     * paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1.
+     *
+     * If the distribution is different per feature, set
+     * [feature_noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.feature_noise_sigma]
+     * instead for each feature.
+     * 
+ * + * float noise_sigma = 1; + * + * @return This builder for chaining. + */ + public Builder clearNoiseSigma() { + if (gradientNoiseSigmaCase_ == 1) { + gradientNoiseSigmaCase_ = 0; + gradientNoiseSigma_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FeatureNoiseSigma, + com.google.cloud.vertexai.api.FeatureNoiseSigma.Builder, + com.google.cloud.vertexai.api.FeatureNoiseSigmaOrBuilder> + featureNoiseSigmaBuilder_; + /** + * + * + *
+     * This is similar to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+     * but provides additional flexibility. A separate noise sigma can be
+     * provided for each feature, which is useful if their distributions are
+     * different. No noise is added to features that are not set. If this field
+     * is unset,
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * will be used for all features.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + * + * @return Whether the featureNoiseSigma field is set. + */ + @java.lang.Override + public boolean hasFeatureNoiseSigma() { + return gradientNoiseSigmaCase_ == 2; + } + /** + * + * + *
+     * This is similar to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+     * but provides additional flexibility. A separate noise sigma can be
+     * provided for each feature, which is useful if their distributions are
+     * different. No noise is added to features that are not set. If this field
+     * is unset,
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * will be used for all features.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + * + * @return The featureNoiseSigma. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigma getFeatureNoiseSigma() { + if (featureNoiseSigmaBuilder_ == null) { + if (gradientNoiseSigmaCase_ == 2) { + return (com.google.cloud.vertexai.api.FeatureNoiseSigma) gradientNoiseSigma_; + } + return com.google.cloud.vertexai.api.FeatureNoiseSigma.getDefaultInstance(); + } else { + if (gradientNoiseSigmaCase_ == 2) { + return featureNoiseSigmaBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.FeatureNoiseSigma.getDefaultInstance(); + } + } + /** + * + * + *
+     * This is similar to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+     * but provides additional flexibility. A separate noise sigma can be
+     * provided for each feature, which is useful if their distributions are
+     * different. No noise is added to features that are not set. If this field
+     * is unset,
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * will be used for all features.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + */ + public Builder setFeatureNoiseSigma(com.google.cloud.vertexai.api.FeatureNoiseSigma value) { + if (featureNoiseSigmaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gradientNoiseSigma_ = value; + onChanged(); + } else { + featureNoiseSigmaBuilder_.setMessage(value); + } + gradientNoiseSigmaCase_ = 2; + return this; + } + /** + * + * + *
+     * This is similar to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+     * but provides additional flexibility. A separate noise sigma can be
+     * provided for each feature, which is useful if their distributions are
+     * different. No noise is added to features that are not set. If this field
+     * is unset,
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * will be used for all features.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + */ + public Builder setFeatureNoiseSigma( + com.google.cloud.vertexai.api.FeatureNoiseSigma.Builder builderForValue) { + if (featureNoiseSigmaBuilder_ == null) { + gradientNoiseSigma_ = builderForValue.build(); + onChanged(); + } else { + featureNoiseSigmaBuilder_.setMessage(builderForValue.build()); + } + gradientNoiseSigmaCase_ = 2; + return this; + } + /** + * + * + *
+     * This is similar to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+     * but provides additional flexibility. A separate noise sigma can be
+     * provided for each feature, which is useful if their distributions are
+     * different. No noise is added to features that are not set. If this field
+     * is unset,
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * will be used for all features.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + */ + public Builder mergeFeatureNoiseSigma(com.google.cloud.vertexai.api.FeatureNoiseSigma value) { + if (featureNoiseSigmaBuilder_ == null) { + if (gradientNoiseSigmaCase_ == 2 + && gradientNoiseSigma_ + != com.google.cloud.vertexai.api.FeatureNoiseSigma.getDefaultInstance()) { + gradientNoiseSigma_ = + com.google.cloud.vertexai.api.FeatureNoiseSigma.newBuilder( + (com.google.cloud.vertexai.api.FeatureNoiseSigma) gradientNoiseSigma_) + .mergeFrom(value) + .buildPartial(); + } else { + gradientNoiseSigma_ = value; + } + onChanged(); + } else { + if (gradientNoiseSigmaCase_ == 2) { + featureNoiseSigmaBuilder_.mergeFrom(value); + } else { + featureNoiseSigmaBuilder_.setMessage(value); + } + } + gradientNoiseSigmaCase_ = 2; + return this; + } + /** + * + * + *
+     * This is similar to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+     * but provides additional flexibility. A separate noise sigma can be
+     * provided for each feature, which is useful if their distributions are
+     * different. No noise is added to features that are not set. If this field
+     * is unset,
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * will be used for all features.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + */ + public Builder clearFeatureNoiseSigma() { + if (featureNoiseSigmaBuilder_ == null) { + if (gradientNoiseSigmaCase_ == 2) { + gradientNoiseSigmaCase_ = 0; + gradientNoiseSigma_ = null; + onChanged(); + } + } else { + if (gradientNoiseSigmaCase_ == 2) { + gradientNoiseSigmaCase_ = 0; + gradientNoiseSigma_ = null; + } + featureNoiseSigmaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * This is similar to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+     * but provides additional flexibility. A separate noise sigma can be
+     * provided for each feature, which is useful if their distributions are
+     * different. No noise is added to features that are not set. If this field
+     * is unset,
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * will be used for all features.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + */ + public com.google.cloud.vertexai.api.FeatureNoiseSigma.Builder getFeatureNoiseSigmaBuilder() { + return getFeatureNoiseSigmaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This is similar to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+     * but provides additional flexibility. A separate noise sigma can be
+     * provided for each feature, which is useful if their distributions are
+     * different. No noise is added to features that are not set. If this field
+     * is unset,
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * will be used for all features.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FeatureNoiseSigmaOrBuilder + getFeatureNoiseSigmaOrBuilder() { + if ((gradientNoiseSigmaCase_ == 2) && (featureNoiseSigmaBuilder_ != null)) { + return featureNoiseSigmaBuilder_.getMessageOrBuilder(); + } else { + if (gradientNoiseSigmaCase_ == 2) { + return (com.google.cloud.vertexai.api.FeatureNoiseSigma) gradientNoiseSigma_; + } + return com.google.cloud.vertexai.api.FeatureNoiseSigma.getDefaultInstance(); + } + } + /** + * + * + *
+     * This is similar to
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+     * but provides additional flexibility. A separate noise sigma can be
+     * provided for each feature, which is useful if their distributions are
+     * different. No noise is added to features that are not set. If this field
+     * is unset,
+     * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+     * will be used for all features.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FeatureNoiseSigma, + com.google.cloud.vertexai.api.FeatureNoiseSigma.Builder, + com.google.cloud.vertexai.api.FeatureNoiseSigmaOrBuilder> + getFeatureNoiseSigmaFieldBuilder() { + if (featureNoiseSigmaBuilder_ == null) { + if (!(gradientNoiseSigmaCase_ == 2)) { + gradientNoiseSigma_ = + com.google.cloud.vertexai.api.FeatureNoiseSigma.getDefaultInstance(); + } + featureNoiseSigmaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.FeatureNoiseSigma, + com.google.cloud.vertexai.api.FeatureNoiseSigma.Builder, + com.google.cloud.vertexai.api.FeatureNoiseSigmaOrBuilder>( + (com.google.cloud.vertexai.api.FeatureNoiseSigma) gradientNoiseSigma_, + getParentForChildren(), + isClean()); + gradientNoiseSigma_ = null; + } + gradientNoiseSigmaCase_ = 2; + onChanged(); + return featureNoiseSigmaBuilder_; + } + + private int noisySampleCount_; + /** + * + * + *
+     * The number of gradient samples to use for
+     * approximation. The higher this number, the more accurate the gradient
+     * is, but the runtime complexity increases by this factor as well.
+     * Valid range of its value is [1, 50]. Defaults to 3.
+     * 
+ * + * int32 noisy_sample_count = 3; + * + * @return The noisySampleCount. + */ + @java.lang.Override + public int getNoisySampleCount() { + return noisySampleCount_; + } + /** + * + * + *
+     * The number of gradient samples to use for
+     * approximation. The higher this number, the more accurate the gradient
+     * is, but the runtime complexity increases by this factor as well.
+     * Valid range of its value is [1, 50]. Defaults to 3.
+     * 
+ * + * int32 noisy_sample_count = 3; + * + * @param value The noisySampleCount to set. + * @return This builder for chaining. + */ + public Builder setNoisySampleCount(int value) { + + noisySampleCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of gradient samples to use for
+     * approximation. The higher this number, the more accurate the gradient
+     * is, but the runtime complexity increases by this factor as well.
+     * Valid range of its value is [1, 50]. Defaults to 3.
+     * 
+ * + * int32 noisy_sample_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearNoisySampleCount() { + bitField0_ = (bitField0_ & ~0x00000004); + noisySampleCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.SmoothGradConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.SmoothGradConfig) + private static final com.google.cloud.vertexai.api.SmoothGradConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.SmoothGradConfig(); + } + + public static com.google.cloud.vertexai.api.SmoothGradConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SmoothGradConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.SmoothGradConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SmoothGradConfigOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SmoothGradConfigOrBuilder.java new file mode 100644 index 000000000000..951744d35142 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/SmoothGradConfigOrBuilder.java @@ -0,0 +1,148 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface SmoothGradConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.SmoothGradConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * This is a single float value and will be used to add noise to all the
+   * features. Use this field when all features are normalized to have the
+   * same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where
+   * features are normalized to have 0-mean and 1-variance. Learn more about
+   * [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization).
+   *
+   * For best results the recommended value is about 10% - 20% of the standard
+   * deviation of the input feature. Refer to section 3.2 of the SmoothGrad
+   * paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1.
+   *
+   * If the distribution is different per feature, set
+   * [feature_noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.feature_noise_sigma]
+   * instead for each feature.
+   * 
+ * + * float noise_sigma = 1; + * + * @return Whether the noiseSigma field is set. + */ + boolean hasNoiseSigma(); + /** + * + * + *
+   * This is a single float value and will be used to add noise to all the
+   * features. Use this field when all features are normalized to have the
+   * same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where
+   * features are normalized to have 0-mean and 1-variance. Learn more about
+   * [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization).
+   *
+   * For best results the recommended value is about 10% - 20% of the standard
+   * deviation of the input feature. Refer to section 3.2 of the SmoothGrad
+   * paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1.
+   *
+   * If the distribution is different per feature, set
+   * [feature_noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.feature_noise_sigma]
+   * instead for each feature.
+   * 
+ * + * float noise_sigma = 1; + * + * @return The noiseSigma. + */ + float getNoiseSigma(); + + /** + * + * + *
+   * This is similar to
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+   * but provides additional flexibility. A separate noise sigma can be
+   * provided for each feature, which is useful if their distributions are
+   * different. No noise is added to features that are not set. If this field
+   * is unset,
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+   * will be used for all features.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + * + * @return Whether the featureNoiseSigma field is set. + */ + boolean hasFeatureNoiseSigma(); + /** + * + * + *
+   * This is similar to
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+   * but provides additional flexibility. A separate noise sigma can be
+   * provided for each feature, which is useful if their distributions are
+   * different. No noise is added to features that are not set. If this field
+   * is unset,
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+   * will be used for all features.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + * + * @return The featureNoiseSigma. + */ + com.google.cloud.vertexai.api.FeatureNoiseSigma getFeatureNoiseSigma(); + /** + * + * + *
+   * This is similar to
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma],
+   * but provides additional flexibility. A separate noise sigma can be
+   * provided for each feature, which is useful if their distributions are
+   * different. No noise is added to features that are not set. If this field
+   * is unset,
+   * [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma]
+   * will be used for all features.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.FeatureNoiseSigma feature_noise_sigma = 2; + */ + com.google.cloud.vertexai.api.FeatureNoiseSigmaOrBuilder getFeatureNoiseSigmaOrBuilder(); + + /** + * + * + *
+   * The number of gradient samples to use for
+   * approximation. The higher this number, the more accurate the gradient
+   * is, but the runtime complexity increases by this factor as well.
+   * Valid range of its value is [1, 50]. Defaults to 3.
+   * 
+ * + * int32 noisy_sample_count = 3; + * + * @return The noisySampleCount. + */ + int getNoisySampleCount(); + + com.google.cloud.vertexai.api.SmoothGradConfig.GradientNoiseSigmaCase getGradientNoiseSigmaCase(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictRequest.java new file mode 100644 index 000000000000..272f99e14ed5 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictRequest.java @@ -0,0 +1,1421 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [PredictionService.StreamingPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingPredict].
+ *
+ * The first message must contain
+ * [endpoint][google.cloud.vertexai.v1beta1.StreamingPredictRequest.endpoint]
+ * field and optionally [input][]. The subsequent messages must contain
+ * [input][].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.StreamingPredictRequest} + */ +public final class StreamingPredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.StreamingPredictRequest) + StreamingPredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamingPredictRequest.newBuilder() to construct. + private StreamingPredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingPredictRequest() { + endpoint_ = ""; + inputs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingPredictRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingPredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.StreamingPredictRequest.class, + com.google.cloud.vertexai.api.StreamingPredictRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List inputs_; + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + @java.lang.Override + public java.util.List getInputsList() { + return inputs_; + } + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + @java.lang.Override + public java.util.List + getInputsOrBuilderList() { + return inputs_; + } + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + @java.lang.Override + public int getInputsCount() { + return inputs_.size(); + } + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getInputs(int index) { + return inputs_.get(index); + } + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.TensorOrBuilder getInputsOrBuilder(int index) { + return inputs_.get(index); + } + + public static final int PARAMETERS_FIELD_NUMBER = 3; + private com.google.cloud.vertexai.api.Tensor parameters_; + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getParameters() { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder() { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + for (int i = 0; i < inputs_.size(); i++) { + output.writeMessage(2, inputs_.get(i)); + } + if (parameters_ != null) { + output.writeMessage(3, getParameters()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + for (int i = 0; i < inputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, inputs_.get(i)); + } + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getParameters()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.StreamingPredictRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.StreamingPredictRequest other = + (com.google.cloud.vertexai.api.StreamingPredictRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (!getInputsList().equals(other.getInputsList())) return false; + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + if (getInputsCount() > 0) { + hash = (37 * hash) + INPUTS_FIELD_NUMBER; + hash = (53 * hash) + getInputsList().hashCode(); + } + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.StreamingPredictRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [PredictionService.StreamingPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingPredict].
+   *
+   * The first message must contain
+   * [endpoint][google.cloud.vertexai.v1beta1.StreamingPredictRequest.endpoint]
+   * field and optionally [input][]. The subsequent messages must contain
+   * [input][].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.StreamingPredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.StreamingPredictRequest) + com.google.cloud.vertexai.api.StreamingPredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingPredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.StreamingPredictRequest.class, + com.google.cloud.vertexai.api.StreamingPredictRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.StreamingPredictRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + if (inputsBuilder_ == null) { + inputs_ = java.util.Collections.emptyList(); + } else { + inputs_ = null; + inputsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingPredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingPredictRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.StreamingPredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingPredictRequest build() { + com.google.cloud.vertexai.api.StreamingPredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingPredictRequest buildPartial() { + com.google.cloud.vertexai.api.StreamingPredictRequest result = + new com.google.cloud.vertexai.api.StreamingPredictRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.StreamingPredictRequest result) { + if (inputsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + inputs_ = java.util.Collections.unmodifiableList(inputs_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.inputs_ = inputs_; + } else { + result.inputs_ = inputsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.StreamingPredictRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.parameters_ = parametersBuilder_ == null ? parameters_ : parametersBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.StreamingPredictRequest) { + return mergeFrom((com.google.cloud.vertexai.api.StreamingPredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.StreamingPredictRequest other) { + if (other == com.google.cloud.vertexai.api.StreamingPredictRequest.getDefaultInstance()) + return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (inputsBuilder_ == null) { + if (!other.inputs_.isEmpty()) { + if (inputs_.isEmpty()) { + inputs_ = other.inputs_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInputsIsMutable(); + inputs_.addAll(other.inputs_); + } + onChanged(); + } + } else { + if (!other.inputs_.isEmpty()) { + if (inputsBuilder_.isEmpty()) { + inputsBuilder_.dispose(); + inputsBuilder_ = null; + inputs_ = other.inputs_; + bitField0_ = (bitField0_ & ~0x00000002); + inputsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInputsFieldBuilder() + : null; + } else { + inputsBuilder_.addAllMessages(other.inputs_); + } + } + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.vertexai.api.Tensor m = + input.readMessage( + com.google.cloud.vertexai.api.Tensor.parser(), extensionRegistry); + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(m); + } else { + inputsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + input.readMessage(getParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List inputs_ = + java.util.Collections.emptyList(); + + private void ensureInputsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + inputs_ = new java.util.ArrayList(inputs_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + inputsBuilder_; + + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public java.util.List getInputsList() { + if (inputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(inputs_); + } else { + return inputsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public int getInputsCount() { + if (inputsBuilder_ == null) { + return inputs_.size(); + } else { + return inputsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public com.google.cloud.vertexai.api.Tensor getInputs(int index) { + if (inputsBuilder_ == null) { + return inputs_.get(index); + } else { + return inputsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder setInputs(int index, com.google.cloud.vertexai.api.Tensor value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.set(index, value); + onChanged(); + } else { + inputsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder setInputs( + int index, com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.set(index, builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder addInputs(com.google.cloud.vertexai.api.Tensor value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.add(value); + onChanged(); + } else { + inputsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder addInputs(int index, com.google.cloud.vertexai.api.Tensor value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.add(index, value); + onChanged(); + } else { + inputsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder addInputs(com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder addInputs( + int index, com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(index, builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder addAllInputs( + java.lang.Iterable values) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inputs_); + onChanged(); + } else { + inputsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder clearInputs() { + if (inputsBuilder_ == null) { + inputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + inputsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public Builder removeInputs(int index) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.remove(index); + onChanged(); + } else { + inputsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public com.google.cloud.vertexai.api.Tensor.Builder getInputsBuilder(int index) { + return getInputsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public com.google.cloud.vertexai.api.TensorOrBuilder getInputsOrBuilder(int index) { + if (inputsBuilder_ == null) { + return inputs_.get(index); + } else { + return inputsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public java.util.List + getInputsOrBuilderList() { + if (inputsBuilder_ != null) { + return inputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inputs_); + } + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public com.google.cloud.vertexai.api.Tensor.Builder addInputsBuilder() { + return getInputsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public com.google.cloud.vertexai.api.Tensor.Builder addInputsBuilder(int index) { + return getInputsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + public java.util.List getInputsBuilderList() { + return getInputsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + getInputsFieldBuilder() { + if (inputsBuilder_ == null) { + inputsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder>( + inputs_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + inputs_ = null; + } + return inputsBuilder_; + } + + private com.google.cloud.vertexai.api.Tensor parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return The parameters. + */ + public com.google.cloud.vertexai.api.Tensor getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public Builder setParameters(com.google.cloud.vertexai.api.Tensor value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + } else { + parametersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public Builder setParameters(com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public Builder mergeParameters(com.google.cloud.vertexai.api.Tensor value) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && parameters_ != null + && parameters_ != com.google.cloud.vertexai.api.Tensor.getDefaultInstance()) { + getParametersBuilder().mergeFrom(value); + } else { + parameters_ = value; + } + } else { + parametersBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public Builder clearParameters() { + bitField0_ = (bitField0_ & ~0x00000004); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public com.google.cloud.vertexai.api.Tensor.Builder getParametersBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + public com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.StreamingPredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.StreamingPredictRequest) + private static final com.google.cloud.vertexai.api.StreamingPredictRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.StreamingPredictRequest(); + } + + public static com.google.cloud.vertexai.api.StreamingPredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingPredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingPredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictRequestOrBuilder.java new file mode 100644 index 000000000000..139191f644a7 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface StreamingPredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.StreamingPredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + java.util.List getInputsList(); + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + com.google.cloud.vertexai.api.Tensor getInputs(int index); + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + int getInputsCount(); + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + java.util.List getInputsOrBuilderList(); + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor inputs = 2; + */ + com.google.cloud.vertexai.api.TensorOrBuilder getInputsOrBuilder(int index); + + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + * + * @return The parameters. + */ + com.google.cloud.vertexai.api.Tensor getParameters(); + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 3; + */ + com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictResponse.java new file mode 100644 index 000000000000..3de94ab21a09 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictResponse.java @@ -0,0 +1,1201 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [PredictionService.StreamingPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingPredict].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.StreamingPredictResponse} + */ +public final class StreamingPredictResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.StreamingPredictResponse) + StreamingPredictResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamingPredictResponse.newBuilder() to construct. + private StreamingPredictResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingPredictResponse() { + outputs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingPredictResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingPredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingPredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.StreamingPredictResponse.class, + com.google.cloud.vertexai.api.StreamingPredictResponse.Builder.class); + } + + public static final int OUTPUTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List outputs_; + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + @java.lang.Override + public java.util.List getOutputsList() { + return outputs_; + } + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + @java.lang.Override + public java.util.List + getOutputsOrBuilderList() { + return outputs_; + } + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + @java.lang.Override + public int getOutputsCount() { + return outputs_.size(); + } + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getOutputs(int index) { + return outputs_.get(index); + } + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.TensorOrBuilder getOutputsOrBuilder(int index) { + return outputs_.get(index); + } + + public static final int PARAMETERS_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.Tensor parameters_; + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return parameters_ != null; + } + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getParameters() { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder() { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < outputs_.size(); i++) { + output.writeMessage(1, outputs_.get(i)); + } + if (parameters_ != null) { + output.writeMessage(2, getParameters()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < outputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, outputs_.get(i)); + } + if (parameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getParameters()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.StreamingPredictResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.StreamingPredictResponse other = + (com.google.cloud.vertexai.api.StreamingPredictResponse) obj; + + if (!getOutputsList().equals(other.getOutputsList())) return false; + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOutputsCount() > 0) { + hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getOutputsList().hashCode(); + } + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.StreamingPredictResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [PredictionService.StreamingPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingPredict].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.StreamingPredictResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.StreamingPredictResponse) + com.google.cloud.vertexai.api.StreamingPredictResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingPredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingPredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.StreamingPredictResponse.class, + com.google.cloud.vertexai.api.StreamingPredictResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.StreamingPredictResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + } else { + outputs_ = null; + outputsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingPredictResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingPredictResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.StreamingPredictResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingPredictResponse build() { + com.google.cloud.vertexai.api.StreamingPredictResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingPredictResponse buildPartial() { + com.google.cloud.vertexai.api.StreamingPredictResponse result = + new com.google.cloud.vertexai.api.StreamingPredictResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.StreamingPredictResponse result) { + if (outputsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.outputs_ = outputs_; + } else { + result.outputs_ = outputsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.StreamingPredictResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parameters_ = parametersBuilder_ == null ? parameters_ : parametersBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.StreamingPredictResponse) { + return mergeFrom((com.google.cloud.vertexai.api.StreamingPredictResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.StreamingPredictResponse other) { + if (other == com.google.cloud.vertexai.api.StreamingPredictResponse.getDefaultInstance()) + return this; + if (outputsBuilder_ == null) { + if (!other.outputs_.isEmpty()) { + if (outputs_.isEmpty()) { + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOutputsIsMutable(); + outputs_.addAll(other.outputs_); + } + onChanged(); + } + } else { + if (!other.outputs_.isEmpty()) { + if (outputsBuilder_.isEmpty()) { + outputsBuilder_.dispose(); + outputsBuilder_ = null; + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000001); + outputsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOutputsFieldBuilder() + : null; + } else { + outputsBuilder_.addAllMessages(other.outputs_); + } + } + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vertexai.api.Tensor m = + input.readMessage( + com.google.cloud.vertexai.api.Tensor.parser(), extensionRegistry); + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(m); + } else { + outputsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage(getParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List outputs_ = + java.util.Collections.emptyList(); + + private void ensureOutputsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + outputs_ = new java.util.ArrayList(outputs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + outputsBuilder_; + + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public java.util.List getOutputsList() { + if (outputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(outputs_); + } else { + return outputsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public int getOutputsCount() { + if (outputsBuilder_ == null) { + return outputs_.size(); + } else { + return outputsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public com.google.cloud.vertexai.api.Tensor getOutputs(int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); + } else { + return outputsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder setOutputs(int index, com.google.cloud.vertexai.api.Tensor value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.set(index, value); + onChanged(); + } else { + outputsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder setOutputs( + int index, com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.set(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder addOutputs(com.google.cloud.vertexai.api.Tensor value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(value); + onChanged(); + } else { + outputsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder addOutputs(int index, com.google.cloud.vertexai.api.Tensor value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(index, value); + onChanged(); + } else { + outputsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder addOutputs(com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder addOutputs( + int index, com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder addAllOutputs( + java.lang.Iterable values) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, outputs_); + onChanged(); + } else { + outputsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder clearOutputs() { + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + outputsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public Builder removeOutputs(int index) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.remove(index); + onChanged(); + } else { + outputsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public com.google.cloud.vertexai.api.Tensor.Builder getOutputsBuilder(int index) { + return getOutputsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public com.google.cloud.vertexai.api.TensorOrBuilder getOutputsOrBuilder(int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); + } else { + return outputsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public java.util.List + getOutputsOrBuilderList() { + if (outputsBuilder_ != null) { + return outputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outputs_); + } + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public com.google.cloud.vertexai.api.Tensor.Builder addOutputsBuilder() { + return getOutputsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public com.google.cloud.vertexai.api.Tensor.Builder addOutputsBuilder(int index) { + return getOutputsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + public java.util.List getOutputsBuilderList() { + return getOutputsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + getOutputsFieldBuilder() { + if (outputsBuilder_ == null) { + outputsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder>( + outputs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + outputs_ = null; + } + return outputsBuilder_; + } + + private com.google.cloud.vertexai.api.Tensor parameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + parametersBuilder_; + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return The parameters. + */ + public com.google.cloud.vertexai.api.Tensor getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public Builder setParameters(com.google.cloud.vertexai.api.Tensor value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + } else { + parametersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public Builder setParameters(com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public Builder mergeParameters(com.google.cloud.vertexai.api.Tensor value) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && parameters_ != null + && parameters_ != com.google.cloud.vertexai.api.Tensor.getDefaultInstance()) { + getParametersBuilder().mergeFrom(value); + } else { + parameters_ = value; + } + } else { + parametersBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public Builder clearParameters() { + bitField0_ = (bitField0_ & ~0x00000002); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public com.google.cloud.vertexai.api.Tensor.Builder getParametersBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + public com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null + ? com.google.cloud.vertexai.api.Tensor.getDefaultInstance() + : parameters_; + } + } + /** + * + * + *
+     * The parameters that govern the prediction.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.StreamingPredictResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.StreamingPredictResponse) + private static final com.google.cloud.vertexai.api.StreamingPredictResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.StreamingPredictResponse(); + } + + public static com.google.cloud.vertexai.api.StreamingPredictResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingPredictResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingPredictResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictResponseOrBuilder.java new file mode 100644 index 000000000000..c7f111bcdcca --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingPredictResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface StreamingPredictResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.StreamingPredictResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + java.util.List getOutputsList(); + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + com.google.cloud.vertexai.api.Tensor getOutputs(int index); + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + int getOutputsCount(); + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + java.util.List getOutputsOrBuilderList(); + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor outputs = 1; + */ + com.google.cloud.vertexai.api.TensorOrBuilder getOutputsOrBuilder(int index); + + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + * + * @return The parameters. + */ + com.google.cloud.vertexai.api.Tensor getParameters(); + /** + * + * + *
+   * The parameters that govern the prediction.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor parameters = 2; + */ + com.google.cloud.vertexai.api.TensorOrBuilder getParametersOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictRequest.java new file mode 100644 index 000000000000..a8da77de6b4b --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictRequest.java @@ -0,0 +1,997 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [PredictionService.StreamingRawPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingRawPredict].
+ *
+ * The first message must contain
+ * [endpoint][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.endpoint]
+ * and
+ * [method_name][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.method_name]
+ * fields and optionally
+ * [input][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.input].
+ * The subsequent messages must contain
+ * [input][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.input].
+ * [method_name][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.method_name]
+ * in the subsequent messages have no effect.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.StreamingRawPredictRequest} + */ +public final class StreamingRawPredictRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.StreamingRawPredictRequest) + StreamingRawPredictRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamingRawPredictRequest.newBuilder() to construct. + private StreamingRawPredictRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingRawPredictRequest() { + endpoint_ = ""; + methodName_ = ""; + input_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingRawPredictRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.StreamingRawPredictRequest.class, + com.google.cloud.vertexai.api.StreamingRawPredictRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METHOD_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object methodName_ = ""; + /** + * + * + *
+   * Fully qualified name of the API method being invoked to perform
+   * predictions.
+   *
+   * Format:
+   * `/namespace.Service/Method/`
+   * Example:
+   * `/tensorflow.serving.PredictionService/Predict`
+   * 
+ * + * string method_name = 2; + * + * @return The methodName. + */ + @java.lang.Override + public java.lang.String getMethodName() { + java.lang.Object ref = methodName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + methodName_ = s; + return s; + } + } + /** + * + * + *
+   * Fully qualified name of the API method being invoked to perform
+   * predictions.
+   *
+   * Format:
+   * `/namespace.Service/Method/`
+   * Example:
+   * `/tensorflow.serving.PredictionService/Predict`
+   * 
+ * + * string method_name = 2; + * + * @return The bytes for methodName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString input_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * bytes input = 3; + * + * @return The input. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInput() { + return input_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(methodName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, methodName_); + } + if (!input_.isEmpty()) { + output.writeBytes(3, input_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(methodName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, methodName_); + } + if (!input_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, input_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.StreamingRawPredictRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.StreamingRawPredictRequest other = + (com.google.cloud.vertexai.api.StreamingRawPredictRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (!getMethodName().equals(other.getMethodName())) return false; + if (!getInput().equals(other.getInput())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + hash = (37 * hash) + METHOD_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMethodName().hashCode(); + hash = (37 * hash) + INPUT_FIELD_NUMBER; + hash = (53 * hash) + getInput().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.StreamingRawPredictRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [PredictionService.StreamingRawPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingRawPredict].
+   *
+   * The first message must contain
+   * [endpoint][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.endpoint]
+   * and
+   * [method_name][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.method_name]
+   * fields and optionally
+   * [input][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.input].
+   * The subsequent messages must contain
+   * [input][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.input].
+   * [method_name][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.method_name]
+   * in the subsequent messages have no effect.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.StreamingRawPredictRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.StreamingRawPredictRequest) + com.google.cloud.vertexai.api.StreamingRawPredictRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.StreamingRawPredictRequest.class, + com.google.cloud.vertexai.api.StreamingRawPredictRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.StreamingRawPredictRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + methodName_ = ""; + input_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingRawPredictRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.StreamingRawPredictRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingRawPredictRequest build() { + com.google.cloud.vertexai.api.StreamingRawPredictRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingRawPredictRequest buildPartial() { + com.google.cloud.vertexai.api.StreamingRawPredictRequest result = + new com.google.cloud.vertexai.api.StreamingRawPredictRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.StreamingRawPredictRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.methodName_ = methodName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.input_ = input_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.StreamingRawPredictRequest) { + return mergeFrom((com.google.cloud.vertexai.api.StreamingRawPredictRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.StreamingRawPredictRequest other) { + if (other == com.google.cloud.vertexai.api.StreamingRawPredictRequest.getDefaultInstance()) + return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getMethodName().isEmpty()) { + methodName_ = other.methodName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getInput() != com.google.protobuf.ByteString.EMPTY) { + setInput(other.getInput()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + methodName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input_ = input.readBytes(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint requested to serve the prediction.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object methodName_ = ""; + /** + * + * + *
+     * Fully qualified name of the API method being invoked to perform
+     * predictions.
+     *
+     * Format:
+     * `/namespace.Service/Method/`
+     * Example:
+     * `/tensorflow.serving.PredictionService/Predict`
+     * 
+ * + * string method_name = 2; + * + * @return The methodName. + */ + public java.lang.String getMethodName() { + java.lang.Object ref = methodName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + methodName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Fully qualified name of the API method being invoked to perform
+     * predictions.
+     *
+     * Format:
+     * `/namespace.Service/Method/`
+     * Example:
+     * `/tensorflow.serving.PredictionService/Predict`
+     * 
+ * + * string method_name = 2; + * + * @return The bytes for methodName. + */ + public com.google.protobuf.ByteString getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Fully qualified name of the API method being invoked to perform
+     * predictions.
+     *
+     * Format:
+     * `/namespace.Service/Method/`
+     * Example:
+     * `/tensorflow.serving.PredictionService/Predict`
+     * 
+ * + * string method_name = 2; + * + * @param value The methodName to set. + * @return This builder for chaining. + */ + public Builder setMethodName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + methodName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Fully qualified name of the API method being invoked to perform
+     * predictions.
+     *
+     * Format:
+     * `/namespace.Service/Method/`
+     * Example:
+     * `/tensorflow.serving.PredictionService/Predict`
+     * 
+ * + * string method_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearMethodName() { + methodName_ = getDefaultInstance().getMethodName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Fully qualified name of the API method being invoked to perform
+     * predictions.
+     *
+     * Format:
+     * `/namespace.Service/Method/`
+     * Example:
+     * `/tensorflow.serving.PredictionService/Predict`
+     * 
+ * + * string method_name = 2; + * + * @param value The bytes for methodName to set. + * @return This builder for chaining. + */ + public Builder setMethodNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + methodName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString input_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * bytes input = 3; + * + * @return The input. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInput() { + return input_; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * bytes input = 3; + * + * @param value The input to set. + * @return This builder for chaining. + */ + public Builder setInput(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The prediction input.
+     * 
+ * + * bytes input = 3; + * + * @return This builder for chaining. + */ + public Builder clearInput() { + bitField0_ = (bitField0_ & ~0x00000004); + input_ = getDefaultInstance().getInput(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.StreamingRawPredictRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.StreamingRawPredictRequest) + private static final com.google.cloud.vertexai.api.StreamingRawPredictRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.StreamingRawPredictRequest(); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRawPredictRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingRawPredictRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictRequestOrBuilder.java new file mode 100644 index 000000000000..62a02f8e24a9 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictRequestOrBuilder.java @@ -0,0 +1,108 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface StreamingRawPredictRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.StreamingRawPredictRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint requested to serve the prediction.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * Fully qualified name of the API method being invoked to perform
+   * predictions.
+   *
+   * Format:
+   * `/namespace.Service/Method/`
+   * Example:
+   * `/tensorflow.serving.PredictionService/Predict`
+   * 
+ * + * string method_name = 2; + * + * @return The methodName. + */ + java.lang.String getMethodName(); + /** + * + * + *
+   * Fully qualified name of the API method being invoked to perform
+   * predictions.
+   *
+   * Format:
+   * `/namespace.Service/Method/`
+   * Example:
+   * `/tensorflow.serving.PredictionService/Predict`
+   * 
+ * + * string method_name = 2; + * + * @return The bytes for methodName. + */ + com.google.protobuf.ByteString getMethodNameBytes(); + + /** + * + * + *
+   * The prediction input.
+   * 
+ * + * bytes input = 3; + * + * @return The input. + */ + com.google.protobuf.ByteString getInput(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictResponse.java new file mode 100644 index 000000000000..8f4d59edff70 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictResponse.java @@ -0,0 +1,541 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [PredictionService.StreamingRawPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingRawPredict].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.StreamingRawPredictResponse} + */ +public final class StreamingRawPredictResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.StreamingRawPredictResponse) + StreamingRawPredictResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamingRawPredictResponse.newBuilder() to construct. + private StreamingRawPredictResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingRawPredictResponse() { + output_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingRawPredictResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.StreamingRawPredictResponse.class, + com.google.cloud.vertexai.api.StreamingRawPredictResponse.Builder.class); + } + + public static final int OUTPUT_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString output_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * bytes output = 1; + * + * @return The output. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutput() { + return output_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!output_.isEmpty()) { + output.writeBytes(1, output_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!output_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, output_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.StreamingRawPredictResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.StreamingRawPredictResponse other = + (com.google.cloud.vertexai.api.StreamingRawPredictResponse) obj; + + if (!getOutput().equals(other.getOutput())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getOutput().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.StreamingRawPredictResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [PredictionService.StreamingRawPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingRawPredict].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.StreamingRawPredictResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.StreamingRawPredictResponse) + com.google.cloud.vertexai.api.StreamingRawPredictResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.StreamingRawPredictResponse.class, + com.google.cloud.vertexai.api.StreamingRawPredictResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.StreamingRawPredictResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + output_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.PredictionServiceProto + .internal_static_google_cloud_vertexai_v1beta1_StreamingRawPredictResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingRawPredictResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.StreamingRawPredictResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingRawPredictResponse build() { + com.google.cloud.vertexai.api.StreamingRawPredictResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingRawPredictResponse buildPartial() { + com.google.cloud.vertexai.api.StreamingRawPredictResponse result = + new com.google.cloud.vertexai.api.StreamingRawPredictResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.StreamingRawPredictResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.output_ = output_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.StreamingRawPredictResponse) { + return mergeFrom((com.google.cloud.vertexai.api.StreamingRawPredictResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.StreamingRawPredictResponse other) { + if (other == com.google.cloud.vertexai.api.StreamingRawPredictResponse.getDefaultInstance()) + return this; + if (other.getOutput() != com.google.protobuf.ByteString.EMPTY) { + setOutput(other.getOutput()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + output_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString output_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * bytes output = 1; + * + * @return The output. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutput() { + return output_; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * bytes output = 1; + * + * @param value The output to set. + * @return This builder for chaining. + */ + public Builder setOutput(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + output_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The prediction output.
+     * 
+ * + * bytes output = 1; + * + * @return This builder for chaining. + */ + public Builder clearOutput() { + bitField0_ = (bitField0_ & ~0x00000001); + output_ = getDefaultInstance().getOutput(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.StreamingRawPredictResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.StreamingRawPredictResponse) + private static final com.google.cloud.vertexai.api.StreamingRawPredictResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.StreamingRawPredictResponse(); + } + + public static com.google.cloud.vertexai.api.StreamingRawPredictResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRawPredictResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StreamingRawPredictResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictResponseOrBuilder.java new file mode 100644 index 000000000000..13ca9e0a92ce --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StreamingRawPredictResponseOrBuilder.java @@ -0,0 +1,38 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/prediction_service.proto + +package com.google.cloud.vertexai.api; + +public interface StreamingRawPredictResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.StreamingRawPredictResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The prediction output.
+   * 
+ * + * bytes output = 1; + * + * @return The output. + */ + com.google.protobuf.ByteString getOutput(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StringArray.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StringArray.java new file mode 100644 index 000000000000..e4a20e287925 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StringArray.java @@ -0,0 +1,718 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A list of string values.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.StringArray} + */ +public final class StringArray extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.StringArray) + StringArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use StringArray.newBuilder() to construct. + private StringArray(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StringArray() { + values_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StringArray(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_StringArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_StringArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.StringArray.class, + com.google.cloud.vertexai.api.StringArray.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * A list of string values.
+   * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_; + } + /** + * + * + *
+   * A list of string values.
+   * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * A list of string values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+   * A list of string values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < values_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, values_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < values_.size(); i++) { + dataSize += computeStringSizeNoTag(values_.getRaw(i)); + } + size += dataSize; + size += 1 * getValuesList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.StringArray)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.StringArray other = + (com.google.cloud.vertexai.api.StringArray) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.StringArray parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StringArray parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StringArray parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StringArray parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StringArray parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.StringArray parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StringArray parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StringArray parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StringArray parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StringArray parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.StringArray parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.StringArray parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.StringArray prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A list of string values.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.StringArray} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.StringArray) + com.google.cloud.vertexai.api.StringArrayOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_StringArray_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_StringArray_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.StringArray.class, + com.google.cloud.vertexai.api.StringArray.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.StringArray.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + values_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_StringArray_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StringArray getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.StringArray.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StringArray build() { + com.google.cloud.vertexai.api.StringArray result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StringArray buildPartial() { + com.google.cloud.vertexai.api.StringArray result = + new com.google.cloud.vertexai.api.StringArray(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.StringArray result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + values_.makeImmutable(); + result.values_ = values_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.StringArray) { + return mergeFrom((com.google.cloud.vertexai.api.StringArray) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.StringArray other) { + if (other == com.google.cloud.vertexai.api.StringArray.getDefaultInstance()) return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ |= 0x00000001; + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureValuesIsMutable(); + values_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureValuesIsMutable() { + if (!values_.isModifiable()) { + values_ = new com.google.protobuf.LazyStringArrayList(values_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+     * A list of string values.
+     * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + values_.makeImmutable(); + return values_; + } + /** + * + * + *
+     * A list of string values.
+     * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * A list of string values.
+     * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+     * A list of string values.
+     * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + /** + * + * + *
+     * A list of string values.
+     * 
+ * + * repeated string values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A list of string values.
+     * 
+ * + * repeated string values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A list of string values.
+     * 
+ * + * repeated string values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A list of string values.
+     * 
+ * + * repeated string values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * A list of string values.
+     * 
+ * + * repeated string values = 1; + * + * @param value The bytes of the values to add. + * @return This builder for chaining. + */ + public Builder addValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureValuesIsMutable(); + values_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.StringArray) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.StringArray) + private static final com.google.cloud.vertexai.api.StringArray DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.StringArray(); + } + + public static com.google.cloud.vertexai.api.StringArray getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringArray parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.StringArray getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StringArrayOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StringArrayOrBuilder.java new file mode 100644 index 000000000000..96ab3c667f31 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/StringArrayOrBuilder.java @@ -0,0 +1,76 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +public interface StringArrayOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.StringArray) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of string values.
+   * 
+ * + * repeated string values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * A list of string values.
+   * 
+ * + * repeated string values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * A list of string values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + java.lang.String getValues(int index); + /** + * + * + *
+   * A list of string values.
+   * 
+ * + * repeated string values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + com.google.protobuf.ByteString getValuesBytes(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TFRecordDestination.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TFRecordDestination.java new file mode 100644 index 000000000000..a03bbf24184f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TFRecordDestination.java @@ -0,0 +1,732 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * The storage details for TFRecord output content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.TFRecordDestination} + */ +public final class TFRecordDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.TFRecordDestination) + TFRecordDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use TFRecordDestination.newBuilder() to construct. + private TFRecordDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TFRecordDestination() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TFRecordDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_TFRecordDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_TFRecordDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.TFRecordDestination.class, + com.google.cloud.vertexai.api.TFRecordDestination.Builder.class); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.GcsDestination gcsDestination_; + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return gcsDestination_ != null; + } + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsDestination getGcsDestination() { + return gcsDestination_ == null + ? com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance() + : gcsDestination_; + } + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + return gcsDestination_ == null + ? com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance() + : gcsDestination_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gcsDestination_ != null) { + output.writeMessage(1, getGcsDestination()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gcsDestination_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcsDestination()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.TFRecordDestination)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.TFRecordDestination other = + (com.google.cloud.vertexai.api.TFRecordDestination) obj; + + if (hasGcsDestination() != other.hasGcsDestination()) return false; + if (hasGcsDestination()) { + if (!getGcsDestination().equals(other.getGcsDestination())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGcsDestination()) { + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.TFRecordDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The storage details for TFRecord output content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.TFRecordDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.TFRecordDestination) + com.google.cloud.vertexai.api.TFRecordDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_TFRecordDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_TFRecordDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.TFRecordDestination.class, + com.google.cloud.vertexai.api.TFRecordDestination.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.TFRecordDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + gcsDestination_ = null; + if (gcsDestinationBuilder_ != null) { + gcsDestinationBuilder_.dispose(); + gcsDestinationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.IoProto + .internal_static_google_cloud_vertexai_v1beta1_TFRecordDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.TFRecordDestination getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.TFRecordDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.TFRecordDestination build() { + com.google.cloud.vertexai.api.TFRecordDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.TFRecordDestination buildPartial() { + com.google.cloud.vertexai.api.TFRecordDestination result = + new com.google.cloud.vertexai.api.TFRecordDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.TFRecordDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.gcsDestination_ = + gcsDestinationBuilder_ == null ? gcsDestination_ : gcsDestinationBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.TFRecordDestination) { + return mergeFrom((com.google.cloud.vertexai.api.TFRecordDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.TFRecordDestination other) { + if (other == com.google.cloud.vertexai.api.TFRecordDestination.getDefaultInstance()) + return this; + if (other.hasGcsDestination()) { + mergeGcsDestination(other.getGcsDestination()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGcsDestinationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.GcsDestination gcsDestination_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsDestination, + com.google.cloud.vertexai.api.GcsDestination.Builder, + com.google.cloud.vertexai.api.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsDestination field is set. + */ + public boolean hasGcsDestination() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsDestination. + */ + public com.google.cloud.vertexai.api.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + return gcsDestination_ == null + ? com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance() + : gcsDestination_; + } else { + return gcsDestinationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsDestination(com.google.cloud.vertexai.api.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcsDestination_ = value; + } else { + gcsDestinationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setGcsDestination( + com.google.cloud.vertexai.api.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + gcsDestination_ = builderForValue.build(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeGcsDestination(com.google.cloud.vertexai.api.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && gcsDestination_ != null + && gcsDestination_ + != com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance()) { + getGcsDestinationBuilder().mergeFrom(value); + } else { + gcsDestination_ = value; + } + } else { + gcsDestinationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearGcsDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + gcsDestination_ = null; + if (gcsDestinationBuilder_ != null) { + gcsDestinationBuilder_.dispose(); + gcsDestinationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.GcsDestination.Builder getGcsDestinationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (gcsDestinationBuilder_ != null) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + return gcsDestination_ == null + ? com.google.cloud.vertexai.api.GcsDestination.getDefaultInstance() + : gcsDestination_; + } + } + /** + * + * + *
+     * Required. Google Cloud Storage location.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsDestination, + com.google.cloud.vertexai.api.GcsDestination.Builder, + com.google.cloud.vertexai.api.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GcsDestination, + com.google.cloud.vertexai.api.GcsDestination.Builder, + com.google.cloud.vertexai.api.GcsDestinationOrBuilder>( + getGcsDestination(), getParentForChildren(), isClean()); + gcsDestination_ = null; + } + return gcsDestinationBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.TFRecordDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.TFRecordDestination) + private static final com.google.cloud.vertexai.api.TFRecordDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.TFRecordDestination(); + } + + public static com.google.cloud.vertexai.api.TFRecordDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TFRecordDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.TFRecordDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TFRecordDestinationOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TFRecordDestinationOrBuilder.java new file mode 100644 index 000000000000..6d9df6939802 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TFRecordDestinationOrBuilder.java @@ -0,0 +1,66 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/io.proto + +package com.google.cloud.vertexai.api; + +public interface TFRecordDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.TFRecordDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the gcsDestination field is set. + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The gcsDestination. + */ + com.google.cloud.vertexai.api.GcsDestination getGcsDestination(); + /** + * + * + *
+   * Required. Google Cloud Storage location.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Tensor.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Tensor.java new file mode 100644 index 000000000000..2bf92b9a6e48 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Tensor.java @@ -0,0 +1,4218 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A tensor value type.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Tensor} + */ +public final class Tensor extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Tensor) + TensorOrBuilder { + private static final long serialVersionUID = 0L; + // Use Tensor.newBuilder() to construct. + private Tensor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Tensor() { + dtype_ = 0; + shape_ = emptyLongList(); + boolVal_ = emptyBooleanList(); + stringVal_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bytesVal_ = java.util.Collections.emptyList(); + floatVal_ = emptyFloatList(); + doubleVal_ = emptyDoubleList(); + intVal_ = emptyIntList(); + int64Val_ = emptyLongList(); + uintVal_ = emptyIntList(); + uint64Val_ = emptyLongList(); + listVal_ = java.util.Collections.emptyList(); + tensorVal_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Tensor(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Tensor_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 12: + return internalGetStructVal(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Tensor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Tensor.class, + com.google.cloud.vertexai.api.Tensor.Builder.class); + } + + /** + * + * + *
+   * Data type of the tensor.
+   * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.Tensor.DataType} + */ + public enum DataType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not a legal value for DataType. Used to indicate a DataType field has not
+     * been set.
+     * 
+ * + * DATA_TYPE_UNSPECIFIED = 0; + */ + DATA_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Data types that all computation devices are expected to be
+     * capable to support.
+     * 
+ * + * BOOL = 1; + */ + BOOL(1), + /** STRING = 2; */ + STRING(2), + /** FLOAT = 3; */ + FLOAT(3), + /** DOUBLE = 4; */ + DOUBLE(4), + /** INT8 = 5; */ + INT8(5), + /** INT16 = 6; */ + INT16(6), + /** INT32 = 7; */ + INT32(7), + /** INT64 = 8; */ + INT64(8), + /** UINT8 = 9; */ + UINT8(9), + /** UINT16 = 10; */ + UINT16(10), + /** UINT32 = 11; */ + UINT32(11), + /** UINT64 = 12; */ + UINT64(12), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not a legal value for DataType. Used to indicate a DataType field has not
+     * been set.
+     * 
+ * + * DATA_TYPE_UNSPECIFIED = 0; + */ + public static final int DATA_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Data types that all computation devices are expected to be
+     * capable to support.
+     * 
+ * + * BOOL = 1; + */ + public static final int BOOL_VALUE = 1; + /** STRING = 2; */ + public static final int STRING_VALUE = 2; + /** FLOAT = 3; */ + public static final int FLOAT_VALUE = 3; + /** DOUBLE = 4; */ + public static final int DOUBLE_VALUE = 4; + /** INT8 = 5; */ + public static final int INT8_VALUE = 5; + /** INT16 = 6; */ + public static final int INT16_VALUE = 6; + /** INT32 = 7; */ + public static final int INT32_VALUE = 7; + /** INT64 = 8; */ + public static final int INT64_VALUE = 8; + /** UINT8 = 9; */ + public static final int UINT8_VALUE = 9; + /** UINT16 = 10; */ + public static final int UINT16_VALUE = 10; + /** UINT32 = 11; */ + public static final int UINT32_VALUE = 11; + /** UINT64 = 12; */ + public static final int UINT64_VALUE = 12; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DataType forNumber(int value) { + switch (value) { + case 0: + return DATA_TYPE_UNSPECIFIED; + case 1: + return BOOL; + case 2: + return STRING; + case 3: + return FLOAT; + case 4: + return DOUBLE; + case 5: + return INT8; + case 6: + return INT16; + case 7: + return INT32; + case 8: + return INT64; + case 9: + return UINT8; + case 10: + return UINT16; + case 11: + return UINT32; + case 12: + return UINT64; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DataType findValueByNumber(int number) { + return DataType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.Tensor.getDescriptor().getEnumTypes().get(0); + } + + private static final DataType[] VALUES = values(); + + public static DataType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DataType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.Tensor.DataType) + } + + public static final int DTYPE_FIELD_NUMBER = 1; + private int dtype_ = 0; + /** + * + * + *
+   * The data type of tensor.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor.DataType dtype = 1; + * + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override + public int getDtypeValue() { + return dtype_; + } + /** + * + * + *
+   * The data type of tensor.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor.DataType dtype = 1; + * + * @return The dtype. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor.DataType getDtype() { + com.google.cloud.vertexai.api.Tensor.DataType result = + com.google.cloud.vertexai.api.Tensor.DataType.forNumber(dtype_); + return result == null ? com.google.cloud.vertexai.api.Tensor.DataType.UNRECOGNIZED : result; + } + + public static final int SHAPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList shape_; + /** + * + * + *
+   * Shape of the tensor.
+   * 
+ * + * repeated int64 shape = 2; + * + * @return A list containing the shape. + */ + @java.lang.Override + public java.util.List getShapeList() { + return shape_; + } + /** + * + * + *
+   * Shape of the tensor.
+   * 
+ * + * repeated int64 shape = 2; + * + * @return The count of shape. + */ + public int getShapeCount() { + return shape_.size(); + } + /** + * + * + *
+   * Shape of the tensor.
+   * 
+ * + * repeated int64 shape = 2; + * + * @param index The index of the element to return. + * @return The shape at the given index. + */ + public long getShape(int index) { + return shape_.getLong(index); + } + + private int shapeMemoizedSerializedSize = -1; + + public static final int BOOL_VAL_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.BooleanList boolVal_; + /** + * + * + *
+   * Type specific representations that make it easy to create tensor protos in
+   * all languages.  Only the representation corresponding to "dtype" can
+   * be set.  The values hold the flattened representation of the tensor in
+   * row major order.
+   *
+   * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+   * 
+ * + * repeated bool bool_val = 3; + * + * @return A list containing the boolVal. + */ + @java.lang.Override + public java.util.List getBoolValList() { + return boolVal_; + } + /** + * + * + *
+   * Type specific representations that make it easy to create tensor protos in
+   * all languages.  Only the representation corresponding to "dtype" can
+   * be set.  The values hold the flattened representation of the tensor in
+   * row major order.
+   *
+   * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+   * 
+ * + * repeated bool bool_val = 3; + * + * @return The count of boolVal. + */ + public int getBoolValCount() { + return boolVal_.size(); + } + /** + * + * + *
+   * Type specific representations that make it easy to create tensor protos in
+   * all languages.  Only the representation corresponding to "dtype" can
+   * be set.  The values hold the flattened representation of the tensor in
+   * row major order.
+   *
+   * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+   * 
+ * + * repeated bool bool_val = 3; + * + * @param index The index of the element to return. + * @return The boolVal at the given index. + */ + public boolean getBoolVal(int index) { + return boolVal_.getBoolean(index); + } + + private int boolValMemoizedSerializedSize = -1; + + public static final int STRING_VAL_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList stringVal_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated string string_val = 14; + * + * @return A list containing the stringVal. + */ + public com.google.protobuf.ProtocolStringList getStringValList() { + return stringVal_; + } + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated string string_val = 14; + * + * @return The count of stringVal. + */ + public int getStringValCount() { + return stringVal_.size(); + } + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated string string_val = 14; + * + * @param index The index of the element to return. + * @return The stringVal at the given index. + */ + public java.lang.String getStringVal(int index) { + return stringVal_.get(index); + } + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated string string_val = 14; + * + * @param index The index of the value to return. + * @return The bytes of the stringVal at the given index. + */ + public com.google.protobuf.ByteString getStringValBytes(int index) { + return stringVal_.getByteString(index); + } + + public static final int BYTES_VAL_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private java.util.List bytesVal_; + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated bytes bytes_val = 15; + * + * @return A list containing the bytesVal. + */ + @java.lang.Override + public java.util.List getBytesValList() { + return bytesVal_; + } + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated bytes bytes_val = 15; + * + * @return The count of bytesVal. + */ + public int getBytesValCount() { + return bytesVal_.size(); + } + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated bytes bytes_val = 15; + * + * @param index The index of the element to return. + * @return The bytesVal at the given index. + */ + public com.google.protobuf.ByteString getBytesVal(int index) { + return bytesVal_.get(index); + } + + public static final int FLOAT_VAL_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList floatVal_; + /** + * + * + *
+   * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+   * 
+ * + * repeated float float_val = 5; + * + * @return A list containing the floatVal. + */ + @java.lang.Override + public java.util.List getFloatValList() { + return floatVal_; + } + /** + * + * + *
+   * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+   * 
+ * + * repeated float float_val = 5; + * + * @return The count of floatVal. + */ + public int getFloatValCount() { + return floatVal_.size(); + } + /** + * + * + *
+   * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+   * 
+ * + * repeated float float_val = 5; + * + * @param index The index of the element to return. + * @return The floatVal at the given index. + */ + public float getFloatVal(int index) { + return floatVal_.getFloat(index); + } + + private int floatValMemoizedSerializedSize = -1; + + public static final int DOUBLE_VAL_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList doubleVal_; + /** + * + * + *
+   * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+   * 
+ * + * repeated double double_val = 6; + * + * @return A list containing the doubleVal. + */ + @java.lang.Override + public java.util.List getDoubleValList() { + return doubleVal_; + } + /** + * + * + *
+   * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+   * 
+ * + * repeated double double_val = 6; + * + * @return The count of doubleVal. + */ + public int getDoubleValCount() { + return doubleVal_.size(); + } + /** + * + * + *
+   * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+   * 
+ * + * repeated double double_val = 6; + * + * @param index The index of the element to return. + * @return The doubleVal at the given index. + */ + public double getDoubleVal(int index) { + return doubleVal_.getDouble(index); + } + + private int doubleValMemoizedSerializedSize = -1; + + public static final int INT_VAL_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList intVal_; + /** + * + * + *
+   * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+   * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+   * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+   * 
+ * + * repeated int32 int_val = 7; + * + * @return A list containing the intVal. + */ + @java.lang.Override + public java.util.List getIntValList() { + return intVal_; + } + /** + * + * + *
+   * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+   * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+   * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+   * 
+ * + * repeated int32 int_val = 7; + * + * @return The count of intVal. + */ + public int getIntValCount() { + return intVal_.size(); + } + /** + * + * + *
+   * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+   * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+   * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+   * 
+ * + * repeated int32 int_val = 7; + * + * @param index The index of the element to return. + * @return The intVal at the given index. + */ + public int getIntVal(int index) { + return intVal_.getInt(index); + } + + private int intValMemoizedSerializedSize = -1; + + public static final int INT64_VAL_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList int64Val_; + /** + * + * + *
+   * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+   * 
+ * + * repeated int64 int64_val = 8; + * + * @return A list containing the int64Val. + */ + @java.lang.Override + public java.util.List getInt64ValList() { + return int64Val_; + } + /** + * + * + *
+   * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+   * 
+ * + * repeated int64 int64_val = 8; + * + * @return The count of int64Val. + */ + public int getInt64ValCount() { + return int64Val_.size(); + } + /** + * + * + *
+   * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+   * 
+ * + * repeated int64 int64_val = 8; + * + * @param index The index of the element to return. + * @return The int64Val at the given index. + */ + public long getInt64Val(int index) { + return int64Val_.getLong(index); + } + + private int int64ValMemoizedSerializedSize = -1; + + public static final int UINT_VAL_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList uintVal_; + /** + * + * + *
+   * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+   * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+   * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+   * 
+ * + * repeated uint32 uint_val = 9; + * + * @return A list containing the uintVal. + */ + @java.lang.Override + public java.util.List getUintValList() { + return uintVal_; + } + /** + * + * + *
+   * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+   * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+   * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+   * 
+ * + * repeated uint32 uint_val = 9; + * + * @return The count of uintVal. + */ + public int getUintValCount() { + return uintVal_.size(); + } + /** + * + * + *
+   * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+   * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+   * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+   * 
+ * + * repeated uint32 uint_val = 9; + * + * @param index The index of the element to return. + * @return The uintVal at the given index. + */ + public int getUintVal(int index) { + return uintVal_.getInt(index); + } + + private int uintValMemoizedSerializedSize = -1; + + public static final int UINT64_VAL_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList uint64Val_; + /** + * + * + *
+   * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+   * 
+ * + * repeated uint64 uint64_val = 10; + * + * @return A list containing the uint64Val. + */ + @java.lang.Override + public java.util.List getUint64ValList() { + return uint64Val_; + } + /** + * + * + *
+   * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+   * 
+ * + * repeated uint64 uint64_val = 10; + * + * @return The count of uint64Val. + */ + public int getUint64ValCount() { + return uint64Val_.size(); + } + /** + * + * + *
+   * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+   * 
+ * + * repeated uint64 uint64_val = 10; + * + * @param index The index of the element to return. + * @return The uint64Val at the given index. + */ + public long getUint64Val(int index) { + return uint64Val_.getLong(index); + } + + private int uint64ValMemoizedSerializedSize = -1; + + public static final int LIST_VAL_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private java.util.List listVal_; + /** + * + * + *
+   * A list of tensor values.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + @java.lang.Override + public java.util.List getListValList() { + return listVal_; + } + /** + * + * + *
+   * A list of tensor values.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + @java.lang.Override + public java.util.List + getListValOrBuilderList() { + return listVal_; + } + /** + * + * + *
+   * A list of tensor values.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + @java.lang.Override + public int getListValCount() { + return listVal_.size(); + } + /** + * + * + *
+   * A list of tensor values.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getListVal(int index) { + return listVal_.get(index); + } + /** + * + * + *
+   * A list of tensor values.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.TensorOrBuilder getListValOrBuilder(int index) { + return listVal_.get(index); + } + + public static final int STRUCT_VAL_FIELD_NUMBER = 12; + + private static final class StructValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.vertexai.api.Tensor> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Tensor_StructValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + structVal_; + + private com.google.protobuf.MapField + internalGetStructVal() { + if (structVal_ == null) { + return com.google.protobuf.MapField.emptyMapField(StructValDefaultEntryHolder.defaultEntry); + } + return structVal_; + } + + public int getStructValCount() { + return internalGetStructVal().getMap().size(); + } + /** + * + * + *
+   * A map of string to tensor.
+   * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + @java.lang.Override + public boolean containsStructVal(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetStructVal().getMap().containsKey(key); + } + /** Use {@link #getStructValMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getStructVal() { + return getStructValMap(); + } + /** + * + * + *
+   * A map of string to tensor.
+   * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + @java.lang.Override + public java.util.Map getStructValMap() { + return internalGetStructVal().getMap(); + } + /** + * + * + *
+   * A map of string to tensor.
+   * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.Tensor getStructValOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.Tensor defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetStructVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map of string to tensor.
+   * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getStructValOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetStructVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TENSOR_VAL_FIELD_NUMBER = 13; + private com.google.protobuf.ByteString tensorVal_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * Serialized raw tensor content.
+   * 
+ * + * bytes tensor_val = 13; + * + * @return The tensorVal. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTensorVal() { + return tensorVal_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (dtype_ != com.google.cloud.vertexai.api.Tensor.DataType.DATA_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, dtype_); + } + if (getShapeList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(shapeMemoizedSerializedSize); + } + for (int i = 0; i < shape_.size(); i++) { + output.writeInt64NoTag(shape_.getLong(i)); + } + if (getBoolValList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(boolValMemoizedSerializedSize); + } + for (int i = 0; i < boolVal_.size(); i++) { + output.writeBoolNoTag(boolVal_.getBoolean(i)); + } + if (getFloatValList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(floatValMemoizedSerializedSize); + } + for (int i = 0; i < floatVal_.size(); i++) { + output.writeFloatNoTag(floatVal_.getFloat(i)); + } + if (getDoubleValList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(doubleValMemoizedSerializedSize); + } + for (int i = 0; i < doubleVal_.size(); i++) { + output.writeDoubleNoTag(doubleVal_.getDouble(i)); + } + if (getIntValList().size() > 0) { + output.writeUInt32NoTag(58); + output.writeUInt32NoTag(intValMemoizedSerializedSize); + } + for (int i = 0; i < intVal_.size(); i++) { + output.writeInt32NoTag(intVal_.getInt(i)); + } + if (getInt64ValList().size() > 0) { + output.writeUInt32NoTag(66); + output.writeUInt32NoTag(int64ValMemoizedSerializedSize); + } + for (int i = 0; i < int64Val_.size(); i++) { + output.writeInt64NoTag(int64Val_.getLong(i)); + } + if (getUintValList().size() > 0) { + output.writeUInt32NoTag(74); + output.writeUInt32NoTag(uintValMemoizedSerializedSize); + } + for (int i = 0; i < uintVal_.size(); i++) { + output.writeUInt32NoTag(uintVal_.getInt(i)); + } + if (getUint64ValList().size() > 0) { + output.writeUInt32NoTag(82); + output.writeUInt32NoTag(uint64ValMemoizedSerializedSize); + } + for (int i = 0; i < uint64Val_.size(); i++) { + output.writeUInt64NoTag(uint64Val_.getLong(i)); + } + for (int i = 0; i < listVal_.size(); i++) { + output.writeMessage(11, listVal_.get(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetStructVal(), StructValDefaultEntryHolder.defaultEntry, 12); + if (!tensorVal_.isEmpty()) { + output.writeBytes(13, tensorVal_); + } + for (int i = 0; i < stringVal_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, stringVal_.getRaw(i)); + } + for (int i = 0; i < bytesVal_.size(); i++) { + output.writeBytes(15, bytesVal_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dtype_ != com.google.cloud.vertexai.api.Tensor.DataType.DATA_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, dtype_); + } + { + int dataSize = 0; + for (int i = 0; i < shape_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(shape_.getLong(i)); + } + size += dataSize; + if (!getShapeList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + shapeMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 1 * getBoolValList().size(); + size += dataSize; + if (!getBoolValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + boolValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 4 * getFloatValList().size(); + size += dataSize; + if (!getFloatValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + floatValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 8 * getDoubleValList().size(); + size += dataSize; + if (!getDoubleValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + doubleValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < intVal_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(intVal_.getInt(i)); + } + size += dataSize; + if (!getIntValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + intValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < int64Val_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(int64Val_.getLong(i)); + } + size += dataSize; + if (!getInt64ValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + int64ValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < uintVal_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(uintVal_.getInt(i)); + } + size += dataSize; + if (!getUintValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + uintValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < uint64Val_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeUInt64SizeNoTag(uint64Val_.getLong(i)); + } + size += dataSize; + if (!getUint64ValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + uint64ValMemoizedSerializedSize = dataSize; + } + for (int i = 0; i < listVal_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, listVal_.get(i)); + } + for (java.util.Map.Entry entry : + internalGetStructVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + structVal__ = + StructValDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, structVal__); + } + if (!tensorVal_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(13, tensorVal_); + } + { + int dataSize = 0; + for (int i = 0; i < stringVal_.size(); i++) { + dataSize += computeStringSizeNoTag(stringVal_.getRaw(i)); + } + size += dataSize; + size += 1 * getStringValList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < bytesVal_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(bytesVal_.get(i)); + } + size += dataSize; + size += 1 * getBytesValList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Tensor)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Tensor other = (com.google.cloud.vertexai.api.Tensor) obj; + + if (dtype_ != other.dtype_) return false; + if (!getShapeList().equals(other.getShapeList())) return false; + if (!getBoolValList().equals(other.getBoolValList())) return false; + if (!getStringValList().equals(other.getStringValList())) return false; + if (!getBytesValList().equals(other.getBytesValList())) return false; + if (!getFloatValList().equals(other.getFloatValList())) return false; + if (!getDoubleValList().equals(other.getDoubleValList())) return false; + if (!getIntValList().equals(other.getIntValList())) return false; + if (!getInt64ValList().equals(other.getInt64ValList())) return false; + if (!getUintValList().equals(other.getUintValList())) return false; + if (!getUint64ValList().equals(other.getUint64ValList())) return false; + if (!getListValList().equals(other.getListValList())) return false; + if (!internalGetStructVal().equals(other.internalGetStructVal())) return false; + if (!getTensorVal().equals(other.getTensorVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (getShapeCount() > 0) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShapeList().hashCode(); + } + if (getBoolValCount() > 0) { + hash = (37 * hash) + BOOL_VAL_FIELD_NUMBER; + hash = (53 * hash) + getBoolValList().hashCode(); + } + if (getStringValCount() > 0) { + hash = (37 * hash) + STRING_VAL_FIELD_NUMBER; + hash = (53 * hash) + getStringValList().hashCode(); + } + if (getBytesValCount() > 0) { + hash = (37 * hash) + BYTES_VAL_FIELD_NUMBER; + hash = (53 * hash) + getBytesValList().hashCode(); + } + if (getFloatValCount() > 0) { + hash = (37 * hash) + FLOAT_VAL_FIELD_NUMBER; + hash = (53 * hash) + getFloatValList().hashCode(); + } + if (getDoubleValCount() > 0) { + hash = (37 * hash) + DOUBLE_VAL_FIELD_NUMBER; + hash = (53 * hash) + getDoubleValList().hashCode(); + } + if (getIntValCount() > 0) { + hash = (37 * hash) + INT_VAL_FIELD_NUMBER; + hash = (53 * hash) + getIntValList().hashCode(); + } + if (getInt64ValCount() > 0) { + hash = (37 * hash) + INT64_VAL_FIELD_NUMBER; + hash = (53 * hash) + getInt64ValList().hashCode(); + } + if (getUintValCount() > 0) { + hash = (37 * hash) + UINT_VAL_FIELD_NUMBER; + hash = (53 * hash) + getUintValList().hashCode(); + } + if (getUint64ValCount() > 0) { + hash = (37 * hash) + UINT64_VAL_FIELD_NUMBER; + hash = (53 * hash) + getUint64ValList().hashCode(); + } + if (getListValCount() > 0) { + hash = (37 * hash) + LIST_VAL_FIELD_NUMBER; + hash = (53 * hash) + getListValList().hashCode(); + } + if (!internalGetStructVal().getMap().isEmpty()) { + hash = (37 * hash) + STRUCT_VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetStructVal().hashCode(); + } + hash = (37 * hash) + TENSOR_VAL_FIELD_NUMBER; + hash = (53 * hash) + getTensorVal().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Tensor parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Tensor parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Tensor parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Tensor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Tensor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Tensor parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Tensor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Tensor parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Tensor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Tensor parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Tensor parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Tensor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Tensor prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A tensor value type.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Tensor} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Tensor) + com.google.cloud.vertexai.api.TensorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Tensor_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 12: + return internalGetStructVal(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 12: + return internalGetMutableStructVal(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Tensor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Tensor.class, + com.google.cloud.vertexai.api.Tensor.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Tensor.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dtype_ = 0; + shape_ = emptyLongList(); + boolVal_ = emptyBooleanList(); + stringVal_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bytesVal_ = java.util.Collections.emptyList(); + floatVal_ = emptyFloatList(); + doubleVal_ = emptyDoubleList(); + intVal_ = emptyIntList(); + int64Val_ = emptyLongList(); + uintVal_ = emptyIntList(); + uint64Val_ = emptyLongList(); + if (listValBuilder_ == null) { + listVal_ = java.util.Collections.emptyList(); + } else { + listVal_ = null; + listValBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + internalGetMutableStructVal().clear(); + tensorVal_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.TypesProto + .internal_static_google_cloud_vertexai_v1beta1_Tensor_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Tensor.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor build() { + com.google.cloud.vertexai.api.Tensor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor buildPartial() { + com.google.cloud.vertexai.api.Tensor result = new com.google.cloud.vertexai.api.Tensor(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.Tensor result) { + if (((bitField0_ & 0x00000002) != 0)) { + shape_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.shape_ = shape_; + if (((bitField0_ & 0x00000004) != 0)) { + boolVal_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.boolVal_ = boolVal_; + if (((bitField0_ & 0x00000010) != 0)) { + bytesVal_ = java.util.Collections.unmodifiableList(bytesVal_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.bytesVal_ = bytesVal_; + if (((bitField0_ & 0x00000020) != 0)) { + floatVal_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.floatVal_ = floatVal_; + if (((bitField0_ & 0x00000040) != 0)) { + doubleVal_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.doubleVal_ = doubleVal_; + if (((bitField0_ & 0x00000080) != 0)) { + intVal_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.intVal_ = intVal_; + if (((bitField0_ & 0x00000100) != 0)) { + int64Val_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.int64Val_ = int64Val_; + if (((bitField0_ & 0x00000200) != 0)) { + uintVal_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.uintVal_ = uintVal_; + if (((bitField0_ & 0x00000400) != 0)) { + uint64Val_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.uint64Val_ = uint64Val_; + if (listValBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + listVal_ = java.util.Collections.unmodifiableList(listVal_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.listVal_ = listVal_; + } else { + result.listVal_ = listValBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.Tensor result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dtype_ = dtype_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + stringVal_.makeImmutable(); + result.stringVal_ = stringVal_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.structVal_ = internalGetStructVal(); + result.structVal_.makeImmutable(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.tensorVal_ = tensorVal_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Tensor) { + return mergeFrom((com.google.cloud.vertexai.api.Tensor) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Tensor other) { + if (other == com.google.cloud.vertexai.api.Tensor.getDefaultInstance()) return this; + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (!other.shape_.isEmpty()) { + if (shape_.isEmpty()) { + shape_ = other.shape_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureShapeIsMutable(); + shape_.addAll(other.shape_); + } + onChanged(); + } + if (!other.boolVal_.isEmpty()) { + if (boolVal_.isEmpty()) { + boolVal_ = other.boolVal_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureBoolValIsMutable(); + boolVal_.addAll(other.boolVal_); + } + onChanged(); + } + if (!other.stringVal_.isEmpty()) { + if (stringVal_.isEmpty()) { + stringVal_ = other.stringVal_; + bitField0_ |= 0x00000008; + } else { + ensureStringValIsMutable(); + stringVal_.addAll(other.stringVal_); + } + onChanged(); + } + if (!other.bytesVal_.isEmpty()) { + if (bytesVal_.isEmpty()) { + bytesVal_ = other.bytesVal_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureBytesValIsMutable(); + bytesVal_.addAll(other.bytesVal_); + } + onChanged(); + } + if (!other.floatVal_.isEmpty()) { + if (floatVal_.isEmpty()) { + floatVal_ = other.floatVal_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureFloatValIsMutable(); + floatVal_.addAll(other.floatVal_); + } + onChanged(); + } + if (!other.doubleVal_.isEmpty()) { + if (doubleVal_.isEmpty()) { + doubleVal_ = other.doubleVal_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureDoubleValIsMutable(); + doubleVal_.addAll(other.doubleVal_); + } + onChanged(); + } + if (!other.intVal_.isEmpty()) { + if (intVal_.isEmpty()) { + intVal_ = other.intVal_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureIntValIsMutable(); + intVal_.addAll(other.intVal_); + } + onChanged(); + } + if (!other.int64Val_.isEmpty()) { + if (int64Val_.isEmpty()) { + int64Val_ = other.int64Val_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureInt64ValIsMutable(); + int64Val_.addAll(other.int64Val_); + } + onChanged(); + } + if (!other.uintVal_.isEmpty()) { + if (uintVal_.isEmpty()) { + uintVal_ = other.uintVal_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureUintValIsMutable(); + uintVal_.addAll(other.uintVal_); + } + onChanged(); + } + if (!other.uint64Val_.isEmpty()) { + if (uint64Val_.isEmpty()) { + uint64Val_ = other.uint64Val_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureUint64ValIsMutable(); + uint64Val_.addAll(other.uint64Val_); + } + onChanged(); + } + if (listValBuilder_ == null) { + if (!other.listVal_.isEmpty()) { + if (listVal_.isEmpty()) { + listVal_ = other.listVal_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureListValIsMutable(); + listVal_.addAll(other.listVal_); + } + onChanged(); + } + } else { + if (!other.listVal_.isEmpty()) { + if (listValBuilder_.isEmpty()) { + listValBuilder_.dispose(); + listValBuilder_ = null; + listVal_ = other.listVal_; + bitField0_ = (bitField0_ & ~0x00000800); + listValBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getListValFieldBuilder() + : null; + } else { + listValBuilder_.addAllMessages(other.listVal_); + } + } + } + internalGetMutableStructVal().mergeFrom(other.internalGetStructVal()); + bitField0_ |= 0x00001000; + if (other.getTensorVal() != com.google.protobuf.ByteString.EMPTY) { + setTensorVal(other.getTensorVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + long v = input.readInt64(); + ensureShapeIsMutable(); + shape_.addLong(v); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureShapeIsMutable(); + while (input.getBytesUntilLimit() > 0) { + shape_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 18 + case 24: + { + boolean v = input.readBool(); + ensureBoolValIsMutable(); + boolVal_.addBoolean(v); + break; + } // case 24 + case 26: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureBoolValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + boolVal_.addBoolean(input.readBool()); + } + input.popLimit(limit); + break; + } // case 26 + case 45: + { + float v = input.readFloat(); + ensureFloatValIsMutable(); + floatVal_.addFloat(v); + break; + } // case 45 + case 42: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureFloatValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + floatVal_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 42 + case 49: + { + double v = input.readDouble(); + ensureDoubleValIsMutable(); + doubleVal_.addDouble(v); + break; + } // case 49 + case 50: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureDoubleValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + doubleVal_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 50 + case 56: + { + int v = input.readInt32(); + ensureIntValIsMutable(); + intVal_.addInt(v); + break; + } // case 56 + case 58: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureIntValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + intVal_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 58 + case 64: + { + long v = input.readInt64(); + ensureInt64ValIsMutable(); + int64Val_.addLong(v); + break; + } // case 64 + case 66: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureInt64ValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + int64Val_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 66 + case 72: + { + int v = input.readUInt32(); + ensureUintValIsMutable(); + uintVal_.addInt(v); + break; + } // case 72 + case 74: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureUintValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + uintVal_.addInt(input.readUInt32()); + } + input.popLimit(limit); + break; + } // case 74 + case 80: + { + long v = input.readUInt64(); + ensureUint64ValIsMutable(); + uint64Val_.addLong(v); + break; + } // case 80 + case 82: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureUint64ValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + uint64Val_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 82 + case 90: + { + com.google.cloud.vertexai.api.Tensor m = + input.readMessage( + com.google.cloud.vertexai.api.Tensor.parser(), extensionRegistry); + if (listValBuilder_ == null) { + ensureListValIsMutable(); + listVal_.add(m); + } else { + listValBuilder_.addMessage(m); + } + break; + } // case 90 + case 98: + { + com.google.protobuf.MapEntry + structVal__ = + input.readMessage( + StructValDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableStructVal() + .getMutableMap() + .put(structVal__.getKey(), structVal__.getValue()); + bitField0_ |= 0x00001000; + break; + } // case 98 + case 106: + { + tensorVal_ = input.readBytes(); + bitField0_ |= 0x00002000; + break; + } // case 106 + case 114: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureStringValIsMutable(); + stringVal_.add(s); + break; + } // case 114 + case 122: + { + com.google.protobuf.ByteString v = input.readBytes(); + ensureBytesValIsMutable(); + bytesVal_.add(v); + break; + } // case 122 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int dtype_ = 0; + /** + * + * + *
+     * The data type of tensor.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor.DataType dtype = 1; + * + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override + public int getDtypeValue() { + return dtype_; + } + /** + * + * + *
+     * The data type of tensor.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor.DataType dtype = 1; + * + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The data type of tensor.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor.DataType dtype = 1; + * + * @return The dtype. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor.DataType getDtype() { + com.google.cloud.vertexai.api.Tensor.DataType result = + com.google.cloud.vertexai.api.Tensor.DataType.forNumber(dtype_); + return result == null ? com.google.cloud.vertexai.api.Tensor.DataType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The data type of tensor.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor.DataType dtype = 1; + * + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(com.google.cloud.vertexai.api.Tensor.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The data type of tensor.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor.DataType dtype = 1; + * + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000001); + dtype_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList shape_ = emptyLongList(); + + private void ensureShapeIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + shape_ = mutableCopy(shape_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Shape of the tensor.
+     * 
+ * + * repeated int64 shape = 2; + * + * @return A list containing the shape. + */ + public java.util.List getShapeList() { + return ((bitField0_ & 0x00000002) != 0) + ? java.util.Collections.unmodifiableList(shape_) + : shape_; + } + /** + * + * + *
+     * Shape of the tensor.
+     * 
+ * + * repeated int64 shape = 2; + * + * @return The count of shape. + */ + public int getShapeCount() { + return shape_.size(); + } + /** + * + * + *
+     * Shape of the tensor.
+     * 
+ * + * repeated int64 shape = 2; + * + * @param index The index of the element to return. + * @return The shape at the given index. + */ + public long getShape(int index) { + return shape_.getLong(index); + } + /** + * + * + *
+     * Shape of the tensor.
+     * 
+ * + * repeated int64 shape = 2; + * + * @param index The index to set the value at. + * @param value The shape to set. + * @return This builder for chaining. + */ + public Builder setShape(int index, long value) { + + ensureShapeIsMutable(); + shape_.setLong(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Shape of the tensor.
+     * 
+ * + * repeated int64 shape = 2; + * + * @param value The shape to add. + * @return This builder for chaining. + */ + public Builder addShape(long value) { + + ensureShapeIsMutable(); + shape_.addLong(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Shape of the tensor.
+     * 
+ * + * repeated int64 shape = 2; + * + * @param values The shape to add. + * @return This builder for chaining. + */ + public Builder addAllShape(java.lang.Iterable values) { + ensureShapeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, shape_); + onChanged(); + return this; + } + /** + * + * + *
+     * Shape of the tensor.
+     * 
+ * + * repeated int64 shape = 2; + * + * @return This builder for chaining. + */ + public Builder clearShape() { + shape_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.BooleanList boolVal_ = emptyBooleanList(); + + private void ensureBoolValIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + boolVal_ = mutableCopy(boolVal_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Type specific representations that make it easy to create tensor protos in
+     * all languages.  Only the representation corresponding to "dtype" can
+     * be set.  The values hold the flattened representation of the tensor in
+     * row major order.
+     *
+     * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+     * 
+ * + * repeated bool bool_val = 3; + * + * @return A list containing the boolVal. + */ + public java.util.List getBoolValList() { + return ((bitField0_ & 0x00000004) != 0) + ? java.util.Collections.unmodifiableList(boolVal_) + : boolVal_; + } + /** + * + * + *
+     * Type specific representations that make it easy to create tensor protos in
+     * all languages.  Only the representation corresponding to "dtype" can
+     * be set.  The values hold the flattened representation of the tensor in
+     * row major order.
+     *
+     * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+     * 
+ * + * repeated bool bool_val = 3; + * + * @return The count of boolVal. + */ + public int getBoolValCount() { + return boolVal_.size(); + } + /** + * + * + *
+     * Type specific representations that make it easy to create tensor protos in
+     * all languages.  Only the representation corresponding to "dtype" can
+     * be set.  The values hold the flattened representation of the tensor in
+     * row major order.
+     *
+     * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+     * 
+ * + * repeated bool bool_val = 3; + * + * @param index The index of the element to return. + * @return The boolVal at the given index. + */ + public boolean getBoolVal(int index) { + return boolVal_.getBoolean(index); + } + /** + * + * + *
+     * Type specific representations that make it easy to create tensor protos in
+     * all languages.  Only the representation corresponding to "dtype" can
+     * be set.  The values hold the flattened representation of the tensor in
+     * row major order.
+     *
+     * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+     * 
+ * + * repeated bool bool_val = 3; + * + * @param index The index to set the value at. + * @param value The boolVal to set. + * @return This builder for chaining. + */ + public Builder setBoolVal(int index, boolean value) { + + ensureBoolValIsMutable(); + boolVal_.setBoolean(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Type specific representations that make it easy to create tensor protos in
+     * all languages.  Only the representation corresponding to "dtype" can
+     * be set.  The values hold the flattened representation of the tensor in
+     * row major order.
+     *
+     * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+     * 
+ * + * repeated bool bool_val = 3; + * + * @param value The boolVal to add. + * @return This builder for chaining. + */ + public Builder addBoolVal(boolean value) { + + ensureBoolValIsMutable(); + boolVal_.addBoolean(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Type specific representations that make it easy to create tensor protos in
+     * all languages.  Only the representation corresponding to "dtype" can
+     * be set.  The values hold the flattened representation of the tensor in
+     * row major order.
+     *
+     * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+     * 
+ * + * repeated bool bool_val = 3; + * + * @param values The boolVal to add. + * @return This builder for chaining. + */ + public Builder addAllBoolVal(java.lang.Iterable values) { + ensureBoolValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, boolVal_); + onChanged(); + return this; + } + /** + * + * + *
+     * Type specific representations that make it easy to create tensor protos in
+     * all languages.  Only the representation corresponding to "dtype" can
+     * be set.  The values hold the flattened representation of the tensor in
+     * row major order.
+     *
+     * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+     * 
+ * + * repeated bool bool_val = 3; + * + * @return This builder for chaining. + */ + public Builder clearBoolVal() { + boolVal_ = emptyBooleanList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList stringVal_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureStringValIsMutable() { + if (!stringVal_.isModifiable()) { + stringVal_ = new com.google.protobuf.LazyStringArrayList(stringVal_); + } + bitField0_ |= 0x00000008; + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated string string_val = 14; + * + * @return A list containing the stringVal. + */ + public com.google.protobuf.ProtocolStringList getStringValList() { + stringVal_.makeImmutable(); + return stringVal_; + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated string string_val = 14; + * + * @return The count of stringVal. + */ + public int getStringValCount() { + return stringVal_.size(); + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated string string_val = 14; + * + * @param index The index of the element to return. + * @return The stringVal at the given index. + */ + public java.lang.String getStringVal(int index) { + return stringVal_.get(index); + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated string string_val = 14; + * + * @param index The index of the value to return. + * @return The bytes of the stringVal at the given index. + */ + public com.google.protobuf.ByteString getStringValBytes(int index) { + return stringVal_.getByteString(index); + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated string string_val = 14; + * + * @param index The index to set the value at. + * @param value The stringVal to set. + * @return This builder for chaining. + */ + public Builder setStringVal(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStringValIsMutable(); + stringVal_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated string string_val = 14; + * + * @param value The stringVal to add. + * @return This builder for chaining. + */ + public Builder addStringVal(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStringValIsMutable(); + stringVal_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated string string_val = 14; + * + * @param values The stringVal to add. + * @return This builder for chaining. + */ + public Builder addAllStringVal(java.lang.Iterable values) { + ensureStringValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stringVal_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated string string_val = 14; + * + * @return This builder for chaining. + */ + public Builder clearStringVal() { + stringVal_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated string string_val = 14; + * + * @param value The bytes of the stringVal to add. + * @return This builder for chaining. + */ + public Builder addStringValBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStringValIsMutable(); + stringVal_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.util.List bytesVal_ = + java.util.Collections.emptyList(); + + private void ensureBytesValIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + bytesVal_ = new java.util.ArrayList(bytesVal_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated bytes bytes_val = 15; + * + * @return A list containing the bytesVal. + */ + public java.util.List getBytesValList() { + return ((bitField0_ & 0x00000010) != 0) + ? java.util.Collections.unmodifiableList(bytesVal_) + : bytesVal_; + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated bytes bytes_val = 15; + * + * @return The count of bytesVal. + */ + public int getBytesValCount() { + return bytesVal_.size(); + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated bytes bytes_val = 15; + * + * @param index The index of the element to return. + * @return The bytesVal at the given index. + */ + public com.google.protobuf.ByteString getBytesVal(int index) { + return bytesVal_.get(index); + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated bytes bytes_val = 15; + * + * @param index The index to set the value at. + * @param value The bytesVal to set. + * @return This builder for chaining. + */ + public Builder setBytesVal(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBytesValIsMutable(); + bytesVal_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated bytes bytes_val = 15; + * + * @param value The bytesVal to add. + * @return This builder for chaining. + */ + public Builder addBytesVal(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBytesValIsMutable(); + bytesVal_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated bytes bytes_val = 15; + * + * @param values The bytesVal to add. + * @return This builder for chaining. + */ + public Builder addAllBytesVal( + java.lang.Iterable values) { + ensureBytesValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, bytesVal_); + onChanged(); + return this; + } + /** + * + * + *
+     * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+     * 
+ * + * repeated bytes bytes_val = 15; + * + * @return This builder for chaining. + */ + public Builder clearBytesVal() { + bytesVal_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.FloatList floatVal_ = emptyFloatList(); + + private void ensureFloatValIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + floatVal_ = mutableCopy(floatVal_); + bitField0_ |= 0x00000020; + } + } + /** + * + * + *
+     * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+     * 
+ * + * repeated float float_val = 5; + * + * @return A list containing the floatVal. + */ + public java.util.List getFloatValList() { + return ((bitField0_ & 0x00000020) != 0) + ? java.util.Collections.unmodifiableList(floatVal_) + : floatVal_; + } + /** + * + * + *
+     * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+     * 
+ * + * repeated float float_val = 5; + * + * @return The count of floatVal. + */ + public int getFloatValCount() { + return floatVal_.size(); + } + /** + * + * + *
+     * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+     * 
+ * + * repeated float float_val = 5; + * + * @param index The index of the element to return. + * @return The floatVal at the given index. + */ + public float getFloatVal(int index) { + return floatVal_.getFloat(index); + } + /** + * + * + *
+     * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+     * 
+ * + * repeated float float_val = 5; + * + * @param index The index to set the value at. + * @param value The floatVal to set. + * @return This builder for chaining. + */ + public Builder setFloatVal(int index, float value) { + + ensureFloatValIsMutable(); + floatVal_.setFloat(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+     * 
+ * + * repeated float float_val = 5; + * + * @param value The floatVal to add. + * @return This builder for chaining. + */ + public Builder addFloatVal(float value) { + + ensureFloatValIsMutable(); + floatVal_.addFloat(value); + onChanged(); + return this; + } + /** + * + * + *
+     * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+     * 
+ * + * repeated float float_val = 5; + * + * @param values The floatVal to add. + * @return This builder for chaining. + */ + public Builder addAllFloatVal(java.lang.Iterable values) { + ensureFloatValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, floatVal_); + onChanged(); + return this; + } + /** + * + * + *
+     * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+     * 
+ * + * repeated float float_val = 5; + * + * @return This builder for chaining. + */ + public Builder clearFloatVal() { + floatVal_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList doubleVal_ = emptyDoubleList(); + + private void ensureDoubleValIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + doubleVal_ = mutableCopy(doubleVal_); + bitField0_ |= 0x00000040; + } + } + /** + * + * + *
+     * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+     * 
+ * + * repeated double double_val = 6; + * + * @return A list containing the doubleVal. + */ + public java.util.List getDoubleValList() { + return ((bitField0_ & 0x00000040) != 0) + ? java.util.Collections.unmodifiableList(doubleVal_) + : doubleVal_; + } + /** + * + * + *
+     * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+     * 
+ * + * repeated double double_val = 6; + * + * @return The count of doubleVal. + */ + public int getDoubleValCount() { + return doubleVal_.size(); + } + /** + * + * + *
+     * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+     * 
+ * + * repeated double double_val = 6; + * + * @param index The index of the element to return. + * @return The doubleVal at the given index. + */ + public double getDoubleVal(int index) { + return doubleVal_.getDouble(index); + } + /** + * + * + *
+     * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+     * 
+ * + * repeated double double_val = 6; + * + * @param index The index to set the value at. + * @param value The doubleVal to set. + * @return This builder for chaining. + */ + public Builder setDoubleVal(int index, double value) { + + ensureDoubleValIsMutable(); + doubleVal_.setDouble(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+     * 
+ * + * repeated double double_val = 6; + * + * @param value The doubleVal to add. + * @return This builder for chaining. + */ + public Builder addDoubleVal(double value) { + + ensureDoubleValIsMutable(); + doubleVal_.addDouble(value); + onChanged(); + return this; + } + /** + * + * + *
+     * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+     * 
+ * + * repeated double double_val = 6; + * + * @param values The doubleVal to add. + * @return This builder for chaining. + */ + public Builder addAllDoubleVal(java.lang.Iterable values) { + ensureDoubleValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, doubleVal_); + onChanged(); + return this; + } + /** + * + * + *
+     * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+     * 
+ * + * repeated double double_val = 6; + * + * @return This builder for chaining. + */ + public Builder clearDoubleVal() { + doubleVal_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList intVal_ = emptyIntList(); + + private void ensureIntValIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + intVal_ = mutableCopy(intVal_); + bitField0_ |= 0x00000080; + } + } + /** + * + * + *
+     * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+     * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+     * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+     * 
+ * + * repeated int32 int_val = 7; + * + * @return A list containing the intVal. + */ + public java.util.List getIntValList() { + return ((bitField0_ & 0x00000080) != 0) + ? java.util.Collections.unmodifiableList(intVal_) + : intVal_; + } + /** + * + * + *
+     * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+     * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+     * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+     * 
+ * + * repeated int32 int_val = 7; + * + * @return The count of intVal. + */ + public int getIntValCount() { + return intVal_.size(); + } + /** + * + * + *
+     * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+     * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+     * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+     * 
+ * + * repeated int32 int_val = 7; + * + * @param index The index of the element to return. + * @return The intVal at the given index. + */ + public int getIntVal(int index) { + return intVal_.getInt(index); + } + /** + * + * + *
+     * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+     * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+     * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+     * 
+ * + * repeated int32 int_val = 7; + * + * @param index The index to set the value at. + * @param value The intVal to set. + * @return This builder for chaining. + */ + public Builder setIntVal(int index, int value) { + + ensureIntValIsMutable(); + intVal_.setInt(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+     * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+     * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+     * 
+ * + * repeated int32 int_val = 7; + * + * @param value The intVal to add. + * @return This builder for chaining. + */ + public Builder addIntVal(int value) { + + ensureIntValIsMutable(); + intVal_.addInt(value); + onChanged(); + return this; + } + /** + * + * + *
+     * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+     * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+     * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+     * 
+ * + * repeated int32 int_val = 7; + * + * @param values The intVal to add. + * @return This builder for chaining. + */ + public Builder addAllIntVal(java.lang.Iterable values) { + ensureIntValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intVal_); + onChanged(); + return this; + } + /** + * + * + *
+     * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+     * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+     * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+     * 
+ * + * repeated int32 int_val = 7; + * + * @return This builder for chaining. + */ + public Builder clearIntVal() { + intVal_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList int64Val_ = emptyLongList(); + + private void ensureInt64ValIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + int64Val_ = mutableCopy(int64Val_); + bitField0_ |= 0x00000100; + } + } + /** + * + * + *
+     * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+     * 
+ * + * repeated int64 int64_val = 8; + * + * @return A list containing the int64Val. + */ + public java.util.List getInt64ValList() { + return ((bitField0_ & 0x00000100) != 0) + ? java.util.Collections.unmodifiableList(int64Val_) + : int64Val_; + } + /** + * + * + *
+     * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+     * 
+ * + * repeated int64 int64_val = 8; + * + * @return The count of int64Val. + */ + public int getInt64ValCount() { + return int64Val_.size(); + } + /** + * + * + *
+     * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+     * 
+ * + * repeated int64 int64_val = 8; + * + * @param index The index of the element to return. + * @return The int64Val at the given index. + */ + public long getInt64Val(int index) { + return int64Val_.getLong(index); + } + /** + * + * + *
+     * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+     * 
+ * + * repeated int64 int64_val = 8; + * + * @param index The index to set the value at. + * @param value The int64Val to set. + * @return This builder for chaining. + */ + public Builder setInt64Val(int index, long value) { + + ensureInt64ValIsMutable(); + int64Val_.setLong(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+     * 
+ * + * repeated int64 int64_val = 8; + * + * @param value The int64Val to add. + * @return This builder for chaining. + */ + public Builder addInt64Val(long value) { + + ensureInt64ValIsMutable(); + int64Val_.addLong(value); + onChanged(); + return this; + } + /** + * + * + *
+     * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+     * 
+ * + * repeated int64 int64_val = 8; + * + * @param values The int64Val to add. + * @return This builder for chaining. + */ + public Builder addAllInt64Val(java.lang.Iterable values) { + ensureInt64ValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, int64Val_); + onChanged(); + return this; + } + /** + * + * + *
+     * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+     * 
+ * + * repeated int64 int64_val = 8; + * + * @return This builder for chaining. + */ + public Builder clearInt64Val() { + int64Val_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList uintVal_ = emptyIntList(); + + private void ensureUintValIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + uintVal_ = mutableCopy(uintVal_); + bitField0_ |= 0x00000200; + } + } + /** + * + * + *
+     * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+     * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+     * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+     * 
+ * + * repeated uint32 uint_val = 9; + * + * @return A list containing the uintVal. + */ + public java.util.List getUintValList() { + return ((bitField0_ & 0x00000200) != 0) + ? java.util.Collections.unmodifiableList(uintVal_) + : uintVal_; + } + /** + * + * + *
+     * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+     * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+     * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+     * 
+ * + * repeated uint32 uint_val = 9; + * + * @return The count of uintVal. + */ + public int getUintValCount() { + return uintVal_.size(); + } + /** + * + * + *
+     * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+     * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+     * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+     * 
+ * + * repeated uint32 uint_val = 9; + * + * @param index The index of the element to return. + * @return The uintVal at the given index. + */ + public int getUintVal(int index) { + return uintVal_.getInt(index); + } + /** + * + * + *
+     * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+     * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+     * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+     * 
+ * + * repeated uint32 uint_val = 9; + * + * @param index The index to set the value at. + * @param value The uintVal to set. + * @return This builder for chaining. + */ + public Builder setUintVal(int index, int value) { + + ensureUintValIsMutable(); + uintVal_.setInt(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+     * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+     * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+     * 
+ * + * repeated uint32 uint_val = 9; + * + * @param value The uintVal to add. + * @return This builder for chaining. + */ + public Builder addUintVal(int value) { + + ensureUintValIsMutable(); + uintVal_.addInt(value); + onChanged(); + return this; + } + /** + * + * + *
+     * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+     * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+     * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+     * 
+ * + * repeated uint32 uint_val = 9; + * + * @param values The uintVal to add. + * @return This builder for chaining. + */ + public Builder addAllUintVal(java.lang.Iterable values) { + ensureUintValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, uintVal_); + onChanged(); + return this; + } + /** + * + * + *
+     * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+     * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+     * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+     * 
+ * + * repeated uint32 uint_val = 9; + * + * @return This builder for chaining. + */ + public Builder clearUintVal() { + uintVal_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList uint64Val_ = emptyLongList(); + + private void ensureUint64ValIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + uint64Val_ = mutableCopy(uint64Val_); + bitField0_ |= 0x00000400; + } + } + /** + * + * + *
+     * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+     * 
+ * + * repeated uint64 uint64_val = 10; + * + * @return A list containing the uint64Val. + */ + public java.util.List getUint64ValList() { + return ((bitField0_ & 0x00000400) != 0) + ? java.util.Collections.unmodifiableList(uint64Val_) + : uint64Val_; + } + /** + * + * + *
+     * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+     * 
+ * + * repeated uint64 uint64_val = 10; + * + * @return The count of uint64Val. + */ + public int getUint64ValCount() { + return uint64Val_.size(); + } + /** + * + * + *
+     * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+     * 
+ * + * repeated uint64 uint64_val = 10; + * + * @param index The index of the element to return. + * @return The uint64Val at the given index. + */ + public long getUint64Val(int index) { + return uint64Val_.getLong(index); + } + /** + * + * + *
+     * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+     * 
+ * + * repeated uint64 uint64_val = 10; + * + * @param index The index to set the value at. + * @param value The uint64Val to set. + * @return This builder for chaining. + */ + public Builder setUint64Val(int index, long value) { + + ensureUint64ValIsMutable(); + uint64Val_.setLong(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+     * 
+ * + * repeated uint64 uint64_val = 10; + * + * @param value The uint64Val to add. + * @return This builder for chaining. + */ + public Builder addUint64Val(long value) { + + ensureUint64ValIsMutable(); + uint64Val_.addLong(value); + onChanged(); + return this; + } + /** + * + * + *
+     * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+     * 
+ * + * repeated uint64 uint64_val = 10; + * + * @param values The uint64Val to add. + * @return This builder for chaining. + */ + public Builder addAllUint64Val(java.lang.Iterable values) { + ensureUint64ValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, uint64Val_); + onChanged(); + return this; + } + /** + * + * + *
+     * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+     * 
+ * + * repeated uint64 uint64_val = 10; + * + * @return This builder for chaining. + */ + public Builder clearUint64Val() { + uint64Val_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + private java.util.List listVal_ = + java.util.Collections.emptyList(); + + private void ensureListValIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + listVal_ = new java.util.ArrayList(listVal_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + listValBuilder_; + + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public java.util.List getListValList() { + if (listValBuilder_ == null) { + return java.util.Collections.unmodifiableList(listVal_); + } else { + return listValBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public int getListValCount() { + if (listValBuilder_ == null) { + return listVal_.size(); + } else { + return listValBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public com.google.cloud.vertexai.api.Tensor getListVal(int index) { + if (listValBuilder_ == null) { + return listVal_.get(index); + } else { + return listValBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public Builder setListVal(int index, com.google.cloud.vertexai.api.Tensor value) { + if (listValBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListValIsMutable(); + listVal_.set(index, value); + onChanged(); + } else { + listValBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public Builder setListVal( + int index, com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (listValBuilder_ == null) { + ensureListValIsMutable(); + listVal_.set(index, builderForValue.build()); + onChanged(); + } else { + listValBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public Builder addListVal(com.google.cloud.vertexai.api.Tensor value) { + if (listValBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListValIsMutable(); + listVal_.add(value); + onChanged(); + } else { + listValBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public Builder addListVal(int index, com.google.cloud.vertexai.api.Tensor value) { + if (listValBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListValIsMutable(); + listVal_.add(index, value); + onChanged(); + } else { + listValBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public Builder addListVal(com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (listValBuilder_ == null) { + ensureListValIsMutable(); + listVal_.add(builderForValue.build()); + onChanged(); + } else { + listValBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public Builder addListVal( + int index, com.google.cloud.vertexai.api.Tensor.Builder builderForValue) { + if (listValBuilder_ == null) { + ensureListValIsMutable(); + listVal_.add(index, builderForValue.build()); + onChanged(); + } else { + listValBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public Builder addAllListVal( + java.lang.Iterable values) { + if (listValBuilder_ == null) { + ensureListValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, listVal_); + onChanged(); + } else { + listValBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public Builder clearListVal() { + if (listValBuilder_ == null) { + listVal_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + listValBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public Builder removeListVal(int index) { + if (listValBuilder_ == null) { + ensureListValIsMutable(); + listVal_.remove(index); + onChanged(); + } else { + listValBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public com.google.cloud.vertexai.api.Tensor.Builder getListValBuilder(int index) { + return getListValFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public com.google.cloud.vertexai.api.TensorOrBuilder getListValOrBuilder(int index) { + if (listValBuilder_ == null) { + return listVal_.get(index); + } else { + return listValBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public java.util.List + getListValOrBuilderList() { + if (listValBuilder_ != null) { + return listValBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(listVal_); + } + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public com.google.cloud.vertexai.api.Tensor.Builder addListValBuilder() { + return getListValFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public com.google.cloud.vertexai.api.Tensor.Builder addListValBuilder(int index) { + return getListValFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Tensor.getDefaultInstance()); + } + /** + * + * + *
+     * A list of tensor values.
+     * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + public java.util.List getListValBuilderList() { + return getListValFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder> + getListValFieldBuilder() { + if (listValBuilder_ == null) { + listValBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tensor, + com.google.cloud.vertexai.api.Tensor.Builder, + com.google.cloud.vertexai.api.TensorOrBuilder>( + listVal_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean()); + listVal_ = null; + } + return listValBuilder_; + } + + private com.google.protobuf.MapField + structVal_; + + private com.google.protobuf.MapField + internalGetStructVal() { + if (structVal_ == null) { + return com.google.protobuf.MapField.emptyMapField(StructValDefaultEntryHolder.defaultEntry); + } + return structVal_; + } + + private com.google.protobuf.MapField + internalGetMutableStructVal() { + if (structVal_ == null) { + structVal_ = + com.google.protobuf.MapField.newMapField(StructValDefaultEntryHolder.defaultEntry); + } + if (!structVal_.isMutable()) { + structVal_ = structVal_.copy(); + } + bitField0_ |= 0x00001000; + onChanged(); + return structVal_; + } + + public int getStructValCount() { + return internalGetStructVal().getMap().size(); + } + /** + * + * + *
+     * A map of string to tensor.
+     * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + @java.lang.Override + public boolean containsStructVal(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetStructVal().getMap().containsKey(key); + } + /** Use {@link #getStructValMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getStructVal() { + return getStructValMap(); + } + /** + * + * + *
+     * A map of string to tensor.
+     * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + @java.lang.Override + public java.util.Map getStructValMap() { + return internalGetStructVal().getMap(); + } + /** + * + * + *
+     * A map of string to tensor.
+     * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + @java.lang.Override + public /* nullable */ com.google.cloud.vertexai.api.Tensor getStructValOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.Tensor defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetStructVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map of string to tensor.
+     * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getStructValOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetStructVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearStructVal() { + bitField0_ = (bitField0_ & ~0x00001000); + internalGetMutableStructVal().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map of string to tensor.
+     * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + public Builder removeStructVal(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableStructVal().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableStructVal() { + bitField0_ |= 0x00001000; + return internalGetMutableStructVal().getMutableMap(); + } + /** + * + * + *
+     * A map of string to tensor.
+     * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + public Builder putStructVal(java.lang.String key, com.google.cloud.vertexai.api.Tensor value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableStructVal().getMutableMap().put(key, value); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * A map of string to tensor.
+     * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + public Builder putAllStructVal( + java.util.Map values) { + internalGetMutableStructVal().getMutableMap().putAll(values); + bitField0_ |= 0x00001000; + return this; + } + + private com.google.protobuf.ByteString tensorVal_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Serialized raw tensor content.
+     * 
+ * + * bytes tensor_val = 13; + * + * @return The tensorVal. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTensorVal() { + return tensorVal_; + } + /** + * + * + *
+     * Serialized raw tensor content.
+     * 
+ * + * bytes tensor_val = 13; + * + * @param value The tensorVal to set. + * @return This builder for chaining. + */ + public Builder setTensorVal(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + tensorVal_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Serialized raw tensor content.
+     * 
+ * + * bytes tensor_val = 13; + * + * @return This builder for chaining. + */ + public Builder clearTensorVal() { + bitField0_ = (bitField0_ & ~0x00002000); + tensorVal_ = getDefaultInstance().getTensorVal(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Tensor) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Tensor) + private static final com.google.cloud.vertexai.api.Tensor DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Tensor(); + } + + public static com.google.cloud.vertexai.api.Tensor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Tensor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Tensor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TensorOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TensorOrBuilder.java new file mode 100644 index 000000000000..0afa391f4f37 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TensorOrBuilder.java @@ -0,0 +1,592 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +public interface TensorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Tensor) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The data type of tensor.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor.DataType dtype = 1; + * + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + * + * + *
+   * The data type of tensor.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.Tensor.DataType dtype = 1; + * + * @return The dtype. + */ + com.google.cloud.vertexai.api.Tensor.DataType getDtype(); + + /** + * + * + *
+   * Shape of the tensor.
+   * 
+ * + * repeated int64 shape = 2; + * + * @return A list containing the shape. + */ + java.util.List getShapeList(); + /** + * + * + *
+   * Shape of the tensor.
+   * 
+ * + * repeated int64 shape = 2; + * + * @return The count of shape. + */ + int getShapeCount(); + /** + * + * + *
+   * Shape of the tensor.
+   * 
+ * + * repeated int64 shape = 2; + * + * @param index The index of the element to return. + * @return The shape at the given index. + */ + long getShape(int index); + + /** + * + * + *
+   * Type specific representations that make it easy to create tensor protos in
+   * all languages.  Only the representation corresponding to "dtype" can
+   * be set.  The values hold the flattened representation of the tensor in
+   * row major order.
+   *
+   * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+   * 
+ * + * repeated bool bool_val = 3; + * + * @return A list containing the boolVal. + */ + java.util.List getBoolValList(); + /** + * + * + *
+   * Type specific representations that make it easy to create tensor protos in
+   * all languages.  Only the representation corresponding to "dtype" can
+   * be set.  The values hold the flattened representation of the tensor in
+   * row major order.
+   *
+   * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+   * 
+ * + * repeated bool bool_val = 3; + * + * @return The count of boolVal. + */ + int getBoolValCount(); + /** + * + * + *
+   * Type specific representations that make it easy to create tensor protos in
+   * all languages.  Only the representation corresponding to "dtype" can
+   * be set.  The values hold the flattened representation of the tensor in
+   * row major order.
+   *
+   * [BOOL][google.vertexai.master.Tensor.DataType.BOOL]
+   * 
+ * + * repeated bool bool_val = 3; + * + * @param index The index of the element to return. + * @return The boolVal at the given index. + */ + boolean getBoolVal(int index); + + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated string string_val = 14; + * + * @return A list containing the stringVal. + */ + java.util.List getStringValList(); + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated string string_val = 14; + * + * @return The count of stringVal. + */ + int getStringValCount(); + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated string string_val = 14; + * + * @param index The index of the element to return. + * @return The stringVal at the given index. + */ + java.lang.String getStringVal(int index); + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated string string_val = 14; + * + * @param index The index of the value to return. + * @return The bytes of the stringVal at the given index. + */ + com.google.protobuf.ByteString getStringValBytes(int index); + + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated bytes bytes_val = 15; + * + * @return A list containing the bytesVal. + */ + java.util.List getBytesValList(); + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated bytes bytes_val = 15; + * + * @return The count of bytesVal. + */ + int getBytesValCount(); + /** + * + * + *
+   * [STRING][google.vertexai.master.Tensor.DataType.STRING]
+   * 
+ * + * repeated bytes bytes_val = 15; + * + * @param index The index of the element to return. + * @return The bytesVal at the given index. + */ + com.google.protobuf.ByteString getBytesVal(int index); + + /** + * + * + *
+   * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+   * 
+ * + * repeated float float_val = 5; + * + * @return A list containing the floatVal. + */ + java.util.List getFloatValList(); + /** + * + * + *
+   * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+   * 
+ * + * repeated float float_val = 5; + * + * @return The count of floatVal. + */ + int getFloatValCount(); + /** + * + * + *
+   * [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT]
+   * 
+ * + * repeated float float_val = 5; + * + * @param index The index of the element to return. + * @return The floatVal at the given index. + */ + float getFloatVal(int index); + + /** + * + * + *
+   * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+   * 
+ * + * repeated double double_val = 6; + * + * @return A list containing the doubleVal. + */ + java.util.List getDoubleValList(); + /** + * + * + *
+   * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+   * 
+ * + * repeated double double_val = 6; + * + * @return The count of doubleVal. + */ + int getDoubleValCount(); + /** + * + * + *
+   * [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE]
+   * 
+ * + * repeated double double_val = 6; + * + * @param index The index of the element to return. + * @return The doubleVal at the given index. + */ + double getDoubleVal(int index); + + /** + * + * + *
+   * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+   * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+   * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+   * 
+ * + * repeated int32 int_val = 7; + * + * @return A list containing the intVal. + */ + java.util.List getIntValList(); + /** + * + * + *
+   * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+   * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+   * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+   * 
+ * + * repeated int32 int_val = 7; + * + * @return The count of intVal. + */ + int getIntValCount(); + /** + * + * + *
+   * [INT_8][google.vertexai.master.Tensor.DataType.INT8]
+   * [INT_16][google.vertexai.master.Tensor.DataType.INT16]
+   * [INT_32][google.vertexai.master.Tensor.DataType.INT32]
+   * 
+ * + * repeated int32 int_val = 7; + * + * @param index The index of the element to return. + * @return The intVal at the given index. + */ + int getIntVal(int index); + + /** + * + * + *
+   * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+   * 
+ * + * repeated int64 int64_val = 8; + * + * @return A list containing the int64Val. + */ + java.util.List getInt64ValList(); + /** + * + * + *
+   * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+   * 
+ * + * repeated int64 int64_val = 8; + * + * @return The count of int64Val. + */ + int getInt64ValCount(); + /** + * + * + *
+   * [INT64][google.vertexai.master.Tensor.DataType.INT64]
+   * 
+ * + * repeated int64 int64_val = 8; + * + * @param index The index of the element to return. + * @return The int64Val at the given index. + */ + long getInt64Val(int index); + + /** + * + * + *
+   * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+   * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+   * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+   * 
+ * + * repeated uint32 uint_val = 9; + * + * @return A list containing the uintVal. + */ + java.util.List getUintValList(); + /** + * + * + *
+   * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+   * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+   * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+   * 
+ * + * repeated uint32 uint_val = 9; + * + * @return The count of uintVal. + */ + int getUintValCount(); + /** + * + * + *
+   * [UINT8][google.vertexai.master.Tensor.DataType.UINT8]
+   * [UINT16][google.vertexai.master.Tensor.DataType.UINT16]
+   * [UINT32][google.vertexai.master.Tensor.DataType.UINT32]
+   * 
+ * + * repeated uint32 uint_val = 9; + * + * @param index The index of the element to return. + * @return The uintVal at the given index. + */ + int getUintVal(int index); + + /** + * + * + *
+   * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+   * 
+ * + * repeated uint64 uint64_val = 10; + * + * @return A list containing the uint64Val. + */ + java.util.List getUint64ValList(); + /** + * + * + *
+   * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+   * 
+ * + * repeated uint64 uint64_val = 10; + * + * @return The count of uint64Val. + */ + int getUint64ValCount(); + /** + * + * + *
+   * [UINT64][google.vertexai.master.Tensor.DataType.UINT64]
+   * 
+ * + * repeated uint64 uint64_val = 10; + * + * @param index The index of the element to return. + * @return The uint64Val at the given index. + */ + long getUint64Val(int index); + + /** + * + * + *
+   * A list of tensor values.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + java.util.List getListValList(); + /** + * + * + *
+   * A list of tensor values.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + com.google.cloud.vertexai.api.Tensor getListVal(int index); + /** + * + * + *
+   * A list of tensor values.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + int getListValCount(); + /** + * + * + *
+   * A list of tensor values.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + java.util.List getListValOrBuilderList(); + /** + * + * + *
+   * A list of tensor values.
+   * 
+ * + * repeated .google.cloud.vertexai.v1beta1.Tensor list_val = 11; + */ + com.google.cloud.vertexai.api.TensorOrBuilder getListValOrBuilder(int index); + + /** + * + * + *
+   * A map of string to tensor.
+   * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + int getStructValCount(); + /** + * + * + *
+   * A map of string to tensor.
+   * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + boolean containsStructVal(java.lang.String key); + /** Use {@link #getStructValMap()} instead. */ + @java.lang.Deprecated + java.util.Map getStructVal(); + /** + * + * + *
+   * A map of string to tensor.
+   * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + java.util.Map getStructValMap(); + /** + * + * + *
+   * A map of string to tensor.
+   * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + /* nullable */ + com.google.cloud.vertexai.api.Tensor getStructValOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.vertexai.api.Tensor defaultValue); + /** + * + * + *
+   * A map of string to tensor.
+   * 
+ * + * map<string, .google.cloud.vertexai.v1beta1.Tensor> struct_val = 12; + */ + com.google.cloud.vertexai.api.Tensor getStructValOrThrow(java.lang.String key); + + /** + * + * + *
+   * Serialized raw tensor content.
+   * 
+ * + * bytes tensor_val = 13; + * + * @return The tensorVal. + */ + com.google.protobuf.ByteString getTensorVal(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Tool.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Tool.java new file mode 100644 index 000000000000..5d862dce8059 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Tool.java @@ -0,0 +1,1164 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/tool.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Tool details that the model may use to generate response.
+ *
+ * A `Tool` is a piece of code that enables the system to interact with
+ * external systems to perform an action, or set of actions, outside of
+ * knowledge and scope of the model.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Tool} + */ +public final class Tool extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.Tool) + ToolOrBuilder { + private static final long serialVersionUID = 0L; + // Use Tool.newBuilder() to construct. + private Tool(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Tool() { + functionDeclarations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Tool(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_Tool_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_Tool_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Tool.class, + com.google.cloud.vertexai.api.Tool.Builder.class); + } + + public static final int FUNCTION_DECLARATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List functionDeclarations_; + /** + * + * + *
+   * Optional. One or more function declarations to be passed to the model along
+   * with the current user query. Model may decide to call a subset of these
+   * functions by populating [FunctionCall][content.part.function_call] in the
+   * response. User should provide a
+   * [FunctionResponse][content.part.function_response] for each function call
+   * in the next turn. Based on the function responses, Model will generate the
+   * final response back to the user. Maximum 64 function declarations can be
+   * provided.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getFunctionDeclarationsList() { + return functionDeclarations_; + } + /** + * + * + *
+   * Optional. One or more function declarations to be passed to the model along
+   * with the current user query. Model may decide to call a subset of these
+   * functions by populating [FunctionCall][content.part.function_call] in the
+   * response. User should provide a
+   * [FunctionResponse][content.part.function_response] for each function call
+   * in the next turn. Based on the function responses, Model will generate the
+   * final response back to the user. Maximum 64 function declarations can be
+   * provided.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getFunctionDeclarationsOrBuilderList() { + return functionDeclarations_; + } + /** + * + * + *
+   * Optional. One or more function declarations to be passed to the model along
+   * with the current user query. Model may decide to call a subset of these
+   * functions by populating [FunctionCall][content.part.function_call] in the
+   * response. User should provide a
+   * [FunctionResponse][content.part.function_response] for each function call
+   * in the next turn. Based on the function responses, Model will generate the
+   * final response back to the user. Maximum 64 function declarations can be
+   * provided.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getFunctionDeclarationsCount() { + return functionDeclarations_.size(); + } + /** + * + * + *
+   * Optional. One or more function declarations to be passed to the model along
+   * with the current user query. Model may decide to call a subset of these
+   * functions by populating [FunctionCall][content.part.function_call] in the
+   * response. User should provide a
+   * [FunctionResponse][content.part.function_response] for each function call
+   * in the next turn. Based on the function responses, Model will generate the
+   * final response back to the user. Maximum 64 function declarations can be
+   * provided.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionDeclaration getFunctionDeclarations(int index) { + return functionDeclarations_.get(index); + } + /** + * + * + *
+   * Optional. One or more function declarations to be passed to the model along
+   * with the current user query. Model may decide to call a subset of these
+   * functions by populating [FunctionCall][content.part.function_call] in the
+   * response. User should provide a
+   * [FunctionResponse][content.part.function_response] for each function call
+   * in the next turn. Based on the function responses, Model will generate the
+   * final response back to the user. Maximum 64 function declarations can be
+   * provided.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.FunctionDeclarationOrBuilder + getFunctionDeclarationsOrBuilder(int index) { + return functionDeclarations_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < functionDeclarations_.size(); i++) { + output.writeMessage(1, functionDeclarations_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < functionDeclarations_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, functionDeclarations_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Tool)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Tool other = (com.google.cloud.vertexai.api.Tool) obj; + + if (!getFunctionDeclarationsList().equals(other.getFunctionDeclarationsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFunctionDeclarationsCount() > 0) { + hash = (37 * hash) + FUNCTION_DECLARATIONS_FIELD_NUMBER; + hash = (53 * hash) + getFunctionDeclarationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Tool parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Tool parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Tool parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Tool parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Tool parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Tool parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Tool parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Tool parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Tool parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Tool parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Tool parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Tool parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Tool prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Tool details that the model may use to generate response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.Tool} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.Tool) + com.google.cloud.vertexai.api.ToolOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_Tool_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_Tool_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Tool.class, + com.google.cloud.vertexai.api.Tool.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Tool.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (functionDeclarationsBuilder_ == null) { + functionDeclarations_ = java.util.Collections.emptyList(); + } else { + functionDeclarations_ = null; + functionDeclarationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ToolProto + .internal_static_google_cloud_vertexai_v1beta1_Tool_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Tool getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Tool.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Tool build() { + com.google.cloud.vertexai.api.Tool result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Tool buildPartial() { + com.google.cloud.vertexai.api.Tool result = new com.google.cloud.vertexai.api.Tool(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.Tool result) { + if (functionDeclarationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + functionDeclarations_ = java.util.Collections.unmodifiableList(functionDeclarations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.functionDeclarations_ = functionDeclarations_; + } else { + result.functionDeclarations_ = functionDeclarationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.vertexai.api.Tool result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Tool) { + return mergeFrom((com.google.cloud.vertexai.api.Tool) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Tool other) { + if (other == com.google.cloud.vertexai.api.Tool.getDefaultInstance()) return this; + if (functionDeclarationsBuilder_ == null) { + if (!other.functionDeclarations_.isEmpty()) { + if (functionDeclarations_.isEmpty()) { + functionDeclarations_ = other.functionDeclarations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFunctionDeclarationsIsMutable(); + functionDeclarations_.addAll(other.functionDeclarations_); + } + onChanged(); + } + } else { + if (!other.functionDeclarations_.isEmpty()) { + if (functionDeclarationsBuilder_.isEmpty()) { + functionDeclarationsBuilder_.dispose(); + functionDeclarationsBuilder_ = null; + functionDeclarations_ = other.functionDeclarations_; + bitField0_ = (bitField0_ & ~0x00000001); + functionDeclarationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFunctionDeclarationsFieldBuilder() + : null; + } else { + functionDeclarationsBuilder_.addAllMessages(other.functionDeclarations_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.vertexai.api.FunctionDeclaration m = + input.readMessage( + com.google.cloud.vertexai.api.FunctionDeclaration.parser(), + extensionRegistry); + if (functionDeclarationsBuilder_ == null) { + ensureFunctionDeclarationsIsMutable(); + functionDeclarations_.add(m); + } else { + functionDeclarationsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + functionDeclarations_ = java.util.Collections.emptyList(); + + private void ensureFunctionDeclarationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + functionDeclarations_ = + new java.util.ArrayList( + functionDeclarations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.FunctionDeclaration, + com.google.cloud.vertexai.api.FunctionDeclaration.Builder, + com.google.cloud.vertexai.api.FunctionDeclarationOrBuilder> + functionDeclarationsBuilder_; + + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getFunctionDeclarationsList() { + if (functionDeclarationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(functionDeclarations_); + } else { + return functionDeclarationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getFunctionDeclarationsCount() { + if (functionDeclarationsBuilder_ == null) { + return functionDeclarations_.size(); + } else { + return functionDeclarationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.FunctionDeclaration getFunctionDeclarations(int index) { + if (functionDeclarationsBuilder_ == null) { + return functionDeclarations_.get(index); + } else { + return functionDeclarationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFunctionDeclarations( + int index, com.google.cloud.vertexai.api.FunctionDeclaration value) { + if (functionDeclarationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionDeclarationsIsMutable(); + functionDeclarations_.set(index, value); + onChanged(); + } else { + functionDeclarationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFunctionDeclarations( + int index, com.google.cloud.vertexai.api.FunctionDeclaration.Builder builderForValue) { + if (functionDeclarationsBuilder_ == null) { + ensureFunctionDeclarationsIsMutable(); + functionDeclarations_.set(index, builderForValue.build()); + onChanged(); + } else { + functionDeclarationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFunctionDeclarations( + com.google.cloud.vertexai.api.FunctionDeclaration value) { + if (functionDeclarationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionDeclarationsIsMutable(); + functionDeclarations_.add(value); + onChanged(); + } else { + functionDeclarationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFunctionDeclarations( + int index, com.google.cloud.vertexai.api.FunctionDeclaration value) { + if (functionDeclarationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionDeclarationsIsMutable(); + functionDeclarations_.add(index, value); + onChanged(); + } else { + functionDeclarationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFunctionDeclarations( + com.google.cloud.vertexai.api.FunctionDeclaration.Builder builderForValue) { + if (functionDeclarationsBuilder_ == null) { + ensureFunctionDeclarationsIsMutable(); + functionDeclarations_.add(builderForValue.build()); + onChanged(); + } else { + functionDeclarationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addFunctionDeclarations( + int index, com.google.cloud.vertexai.api.FunctionDeclaration.Builder builderForValue) { + if (functionDeclarationsBuilder_ == null) { + ensureFunctionDeclarationsIsMutable(); + functionDeclarations_.add(index, builderForValue.build()); + onChanged(); + } else { + functionDeclarationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllFunctionDeclarations( + java.lang.Iterable values) { + if (functionDeclarationsBuilder_ == null) { + ensureFunctionDeclarationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, functionDeclarations_); + onChanged(); + } else { + functionDeclarationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFunctionDeclarations() { + if (functionDeclarationsBuilder_ == null) { + functionDeclarations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + functionDeclarationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeFunctionDeclarations(int index) { + if (functionDeclarationsBuilder_ == null) { + ensureFunctionDeclarationsIsMutable(); + functionDeclarations_.remove(index); + onChanged(); + } else { + functionDeclarationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.FunctionDeclaration.Builder getFunctionDeclarationsBuilder( + int index) { + return getFunctionDeclarationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.FunctionDeclarationOrBuilder + getFunctionDeclarationsOrBuilder(int index) { + if (functionDeclarationsBuilder_ == null) { + return functionDeclarations_.get(index); + } else { + return functionDeclarationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getFunctionDeclarationsOrBuilderList() { + if (functionDeclarationsBuilder_ != null) { + return functionDeclarationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(functionDeclarations_); + } + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.FunctionDeclaration.Builder + addFunctionDeclarationsBuilder() { + return getFunctionDeclarationsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.FunctionDeclaration.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.FunctionDeclaration.Builder addFunctionDeclarationsBuilder( + int index) { + return getFunctionDeclarationsFieldBuilder() + .addBuilder( + index, com.google.cloud.vertexai.api.FunctionDeclaration.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. One or more function declarations to be passed to the model along
+     * with the current user query. Model may decide to call a subset of these
+     * functions by populating [FunctionCall][content.part.function_call] in the
+     * response. User should provide a
+     * [FunctionResponse][content.part.function_response] for each function call
+     * in the next turn. Based on the function responses, Model will generate the
+     * final response back to the user. Maximum 64 function declarations can be
+     * provided.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getFunctionDeclarationsBuilderList() { + return getFunctionDeclarationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.FunctionDeclaration, + com.google.cloud.vertexai.api.FunctionDeclaration.Builder, + com.google.cloud.vertexai.api.FunctionDeclarationOrBuilder> + getFunctionDeclarationsFieldBuilder() { + if (functionDeclarationsBuilder_ == null) { + functionDeclarationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.FunctionDeclaration, + com.google.cloud.vertexai.api.FunctionDeclaration.Builder, + com.google.cloud.vertexai.api.FunctionDeclarationOrBuilder>( + functionDeclarations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + functionDeclarations_ = null; + } + return functionDeclarationsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.Tool) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.Tool) + private static final com.google.cloud.vertexai.api.Tool DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Tool(); + } + + public static com.google.cloud.vertexai.api.Tool getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Tool parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Tool getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ToolOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ToolOrBuilder.java new file mode 100644 index 000000000000..7fb070860a98 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ToolOrBuilder.java @@ -0,0 +1,123 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/tool.proto + +package com.google.cloud.vertexai.api; + +public interface ToolOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.Tool) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. One or more function declarations to be passed to the model along
+   * with the current user query. Model may decide to call a subset of these
+   * functions by populating [FunctionCall][content.part.function_call] in the
+   * response. User should provide a
+   * [FunctionResponse][content.part.function_response] for each function call
+   * in the next turn. Based on the function responses, Model will generate the
+   * final response back to the user. Maximum 64 function declarations can be
+   * provided.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getFunctionDeclarationsList(); + /** + * + * + *
+   * Optional. One or more function declarations to be passed to the model along
+   * with the current user query. Model may decide to call a subset of these
+   * functions by populating [FunctionCall][content.part.function_call] in the
+   * response. User should provide a
+   * [FunctionResponse][content.part.function_response] for each function call
+   * in the next turn. Based on the function responses, Model will generate the
+   * final response back to the user. Maximum 64 function declarations can be
+   * provided.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.FunctionDeclaration getFunctionDeclarations(int index); + /** + * + * + *
+   * Optional. One or more function declarations to be passed to the model along
+   * with the current user query. Model may decide to call a subset of these
+   * functions by populating [FunctionCall][content.part.function_call] in the
+   * response. User should provide a
+   * [FunctionResponse][content.part.function_response] for each function call
+   * in the next turn. Based on the function responses, Model will generate the
+   * final response back to the user. Maximum 64 function declarations can be
+   * provided.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getFunctionDeclarationsCount(); + /** + * + * + *
+   * Optional. One or more function declarations to be passed to the model along
+   * with the current user query. Model may decide to call a subset of these
+   * functions by populating [FunctionCall][content.part.function_call] in the
+   * response. User should provide a
+   * [FunctionResponse][content.part.function_response] for each function call
+   * in the next turn. Based on the function responses, Model will generate the
+   * final response back to the user. Maximum 64 function declarations can be
+   * provided.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getFunctionDeclarationsOrBuilderList(); + /** + * + * + *
+   * Optional. One or more function declarations to be passed to the model along
+   * with the current user query. Model may decide to call a subset of these
+   * functions by populating [FunctionCall][content.part.function_call] in the
+   * response. User should provide a
+   * [FunctionResponse][content.part.function_response] for each function call
+   * in the next turn. Based on the function responses, Model will generate the
+   * final response back to the user. Maximum 64 function declarations can be
+   * provided.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.FunctionDeclarationOrBuilder getFunctionDeclarationsOrBuilder( + int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ToolProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ToolProto.java new file mode 100644 index 000000000000..b601410c8a99 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/ToolProto.java @@ -0,0 +1,128 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/tool.proto + +package com.google.cloud.vertexai.api; + +public final class ToolProto { + private ToolProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Tool_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Tool_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_FunctionDeclaration_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_FunctionDeclaration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_FunctionCall_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_FunctionCall_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_FunctionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_FunctionResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n(google/cloud/vertexai/v1beta1/tool.pro" + + "to\022\035google.cloud.vertexai.v1beta1\032\037googl" + + "e/api/field_behavior.proto\032+google/cloud" + + "/vertexai/v1beta1/openapi.proto\032\034google/" + + "protobuf/struct.proto\"_\n\004Tool\022W\n\025functio" + + "n_declarations\030\001 \003(\01322.google.cloud.vert" + + "exai.v1beta1.FunctionDeclarationB\004\342A\001\001\"\205" + + "\001\n\023FunctionDeclaration\022\022\n\004name\030\001 \001(\tB\004\342A" + + "\001\002\022\031\n\013description\030\002 \001(\tB\004\342A\001\001\022?\n\nparamet" + + "ers\030\003 \001(\0132%.google.cloud.vertexai.v1beta" + + "1.SchemaB\004\342A\001\001\"O\n\014FunctionCall\022\022\n\004name\030\001" + + " \001(\tB\004\342A\001\002\022+\n\004args\030\002 \001(\0132\027.google.protob" + + "uf.StructB\004\342A\001\001\"W\n\020FunctionResponse\022\022\n\004n" + + "ame\030\001 \001(\tB\004\342A\001\002\022/\n\010response\030\002 \001(\0132\027.goog" + + "le.protobuf.StructB\004\342A\001\002B\316\001\n\035com.google." + + "cloud.vertexai.apiB\tToolProtoP\001Z=cloud.g" + + "oogle.com/go/vertexai/apiv1beta1/vertexa" + + "ipb;vertexaipb\252\002\035Google.Cloud.VertexAI.V" + + "1Beta1\312\002\035Google\\Cloud\\VertexAI\\V1beta1\352\002" + + " Google::Cloud::VertexAI::V1beta1b\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.vertexai.api.OpenApiProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1beta1_Tool_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_Tool_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Tool_descriptor, + new java.lang.String[] { + "FunctionDeclarations", + }); + internal_static_google_cloud_vertexai_v1beta1_FunctionDeclaration_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vertexai_v1beta1_FunctionDeclaration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_FunctionDeclaration_descriptor, + new java.lang.String[] { + "Name", "Description", "Parameters", + }); + internal_static_google_cloud_vertexai_v1beta1_FunctionCall_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vertexai_v1beta1_FunctionCall_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_FunctionCall_descriptor, + new java.lang.String[] { + "Name", "Args", + }); + internal_static_google_cloud_vertexai_v1beta1_FunctionResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vertexai_v1beta1_FunctionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_FunctionResponse_descriptor, + new java.lang.String[] { + "Name", "Response", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.vertexai.api.OpenApiProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Type.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Type.java new file mode 100644 index 000000000000..01fe6985ba39 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/Type.java @@ -0,0 +1,265 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/openapi.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Type contains the list of OpenAPI data types as defined by
+ * https://swagger.io/docs/specification/data-models/data-types/
+ * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1beta1.Type} + */ +public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not specified, should not be used.
+   * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * OpenAPI string type
+   * 
+ * + * STRING = 1; + */ + STRING(1), + /** + * + * + *
+   * OpenAPI number type
+   * 
+ * + * NUMBER = 2; + */ + NUMBER(2), + /** + * + * + *
+   * OpenAPI integer type
+   * 
+ * + * INTEGER = 3; + */ + INTEGER(3), + /** + * + * + *
+   * OpenAPI boolean type
+   * 
+ * + * BOOLEAN = 4; + */ + BOOLEAN(4), + /** + * + * + *
+   * OpenAPI array type
+   * 
+ * + * ARRAY = 5; + */ + ARRAY(5), + /** + * + * + *
+   * OpenAPI object type
+   * 
+ * + * OBJECT = 6; + */ + OBJECT(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not specified, should not be used.
+   * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * OpenAPI string type
+   * 
+ * + * STRING = 1; + */ + public static final int STRING_VALUE = 1; + /** + * + * + *
+   * OpenAPI number type
+   * 
+ * + * NUMBER = 2; + */ + public static final int NUMBER_VALUE = 2; + /** + * + * + *
+   * OpenAPI integer type
+   * 
+ * + * INTEGER = 3; + */ + public static final int INTEGER_VALUE = 3; + /** + * + * + *
+   * OpenAPI boolean type
+   * 
+ * + * BOOLEAN = 4; + */ + public static final int BOOLEAN_VALUE = 4; + /** + * + * + *
+   * OpenAPI array type
+   * 
+ * + * ARRAY = 5; + */ + public static final int ARRAY_VALUE = 5; + /** + * + * + *
+   * OpenAPI object type
+   * 
+ * + * OBJECT = 6; + */ + public static final int OBJECT_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return STRING; + case 2: + return NUMBER; + case 3: + return INTEGER; + case 4: + return BOOLEAN; + case 5: + return ARRAY; + case 6: + return OBJECT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.OpenApiProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1beta1.Type) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TypesProto.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TypesProto.java new file mode 100644 index 000000000000..87db212cad5d --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/TypesProto.java @@ -0,0 +1,159 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/types.proto + +package com.google.cloud.vertexai.api; + +public final class TypesProto { + private TypesProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_BoolArray_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_BoolArray_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_DoubleArray_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_DoubleArray_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Int64Array_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Int64Array_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_StringArray_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_StringArray_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Tensor_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Tensor_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1beta1_Tensor_StructValEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1beta1_Tensor_StructValEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n)google/cloud/vertexai/v1beta1/types.pr" + + "oto\022\035google.cloud.vertexai.v1beta1\"\033\n\tBo" + + "olArray\022\016\n\006values\030\001 \003(\010\"\035\n\013DoubleArray\022\016" + + "\n\006values\030\001 \003(\001\"\034\n\nInt64Array\022\016\n\006values\030\001" + + " \003(\003\"\035\n\013StringArray\022\016\n\006values\030\001 \003(\t\"\237\005\n\006" + + "Tensor\022=\n\005dtype\030\001 \001(\0162..google.cloud.ver" + + "texai.v1beta1.Tensor.DataType\022\r\n\005shape\030\002" + + " \003(\003\022\020\n\010bool_val\030\003 \003(\010\022\022\n\nstring_val\030\016 \003" + + "(\t\022\021\n\tbytes_val\030\017 \003(\014\022\021\n\tfloat_val\030\005 \003(\002" + + "\022\022\n\ndouble_val\030\006 \003(\001\022\017\n\007int_val\030\007 \003(\005\022\021\n" + + "\tint64_val\030\010 \003(\003\022\020\n\010uint_val\030\t \003(\r\022\022\n\nui" + + "nt64_val\030\n \003(\004\0227\n\010list_val\030\013 \003(\0132%.googl" + + "e.cloud.vertexai.v1beta1.Tensor\022H\n\nstruc" + + "t_val\030\014 \003(\01324.google.cloud.vertexai.v1be" + + "ta1.Tensor.StructValEntry\022\022\n\ntensor_val\030" + + "\r \001(\014\032W\n\016StructValEntry\022\013\n\003key\030\001 \001(\t\0224\n\005" + + "value\030\002 \001(\0132%.google.cloud.vertexai.v1be" + + "ta1.Tensor:\0028\001\"\254\001\n\010DataType\022\031\n\025DATA_TYPE" + + "_UNSPECIFIED\020\000\022\010\n\004BOOL\020\001\022\n\n\006STRING\020\002\022\t\n\005" + + "FLOAT\020\003\022\n\n\006DOUBLE\020\004\022\010\n\004INT8\020\005\022\t\n\005INT16\020\006" + + "\022\t\n\005INT32\020\007\022\t\n\005INT64\020\010\022\t\n\005UINT8\020\t\022\n\n\006UIN" + + "T16\020\n\022\n\n\006UINT32\020\013\022\n\n\006UINT64\020\014B\317\001\n\035com.go" + + "ogle.cloud.vertexai.apiB\nTypesProtoP\001Z=c" + + "loud.google.com/go/vertexai/apiv1beta1/v" + + "ertexaipb;vertexaipb\252\002\035Google.Cloud.Vert" + + "exAI.V1Beta1\312\002\035Google\\Cloud\\VertexAI\\V1b" + + "eta1\352\002 Google::Cloud::VertexAI::V1beta1b" + + "\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_vertexai_v1beta1_BoolArray_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_BoolArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_BoolArray_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_vertexai_v1beta1_DoubleArray_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_vertexai_v1beta1_DoubleArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_DoubleArray_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_vertexai_v1beta1_Int64Array_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_vertexai_v1beta1_Int64Array_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Int64Array_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_vertexai_v1beta1_StringArray_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_vertexai_v1beta1_StringArray_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_StringArray_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_cloud_vertexai_v1beta1_Tensor_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_vertexai_v1beta1_Tensor_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Tensor_descriptor, + new java.lang.String[] { + "Dtype", + "Shape", + "BoolVal", + "StringVal", + "BytesVal", + "FloatVal", + "DoubleVal", + "IntVal", + "Int64Val", + "UintVal", + "Uint64Val", + "ListVal", + "StructVal", + "TensorVal", + }); + internal_static_google_cloud_vertexai_v1beta1_Tensor_StructValEntry_descriptor = + internal_static_google_cloud_vertexai_v1beta1_Tensor_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_vertexai_v1beta1_Tensor_StructValEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1beta1_Tensor_StructValEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelOperationMetadata.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelOperationMetadata.java new file mode 100644 index 000000000000..d8c468e5b731 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelOperationMetadata.java @@ -0,0 +1,721 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Runtime operation information for
+ * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.UndeployModelOperationMetadata} + */ +public final class UndeployModelOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.UndeployModelOperationMetadata) + UndeployModelOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployModelOperationMetadata.newBuilder() to construct. + private UndeployModelOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployModelOperationMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeployModelOperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.UndeployModelOperationMetadata.class, + com.google.cloud.vertexai.api.UndeployModelOperationMetadata.Builder.class); + } + + public static final int GENERIC_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.GenericOperationMetadata genericMetadata_; + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + @java.lang.Override + public boolean hasGenericMetadata() { + return genericMetadata_ != null; + } + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata() { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (genericMetadata_ != null) { + output.writeMessage(1, getGenericMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (genericMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGenericMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.UndeployModelOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.UndeployModelOperationMetadata other = + (com.google.cloud.vertexai.api.UndeployModelOperationMetadata) obj; + + if (hasGenericMetadata() != other.hasGenericMetadata()) return false; + if (hasGenericMetadata()) { + if (!getGenericMetadata().equals(other.getGenericMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGenericMetadata()) { + hash = (37 * hash) + GENERIC_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getGenericMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.UndeployModelOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.UndeployModelOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.UndeployModelOperationMetadata) + com.google.cloud.vertexai.api.UndeployModelOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.UndeployModelOperationMetadata.class, + com.google.cloud.vertexai.api.UndeployModelOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.UndeployModelOperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelOperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.UndeployModelOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelOperationMetadata build() { + com.google.cloud.vertexai.api.UndeployModelOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelOperationMetadata buildPartial() { + com.google.cloud.vertexai.api.UndeployModelOperationMetadata result = + new com.google.cloud.vertexai.api.UndeployModelOperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.UndeployModelOperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.genericMetadata_ = + genericMetadataBuilder_ == null ? genericMetadata_ : genericMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.UndeployModelOperationMetadata) { + return mergeFrom((com.google.cloud.vertexai.api.UndeployModelOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.UndeployModelOperationMetadata other) { + if (other + == com.google.cloud.vertexai.api.UndeployModelOperationMetadata.getDefaultInstance()) + return this; + if (other.hasGenericMetadata()) { + mergeGenericMetadata(other.getGenericMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGenericMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.GenericOperationMetadata genericMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder> + genericMetadataBuilder_; + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + public boolean hasGenericMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + public com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata() { + if (genericMetadataBuilder_ == null) { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } else { + return genericMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + genericMetadata_ = value; + } else { + genericMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder builderForValue) { + if (genericMetadataBuilder_ == null) { + genericMetadata_ = builderForValue.build(); + } else { + genericMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder mergeGenericMetadata( + com.google.cloud.vertexai.api.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && genericMetadata_ != null + && genericMetadata_ + != com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance()) { + getGenericMetadataBuilder().mergeFrom(value); + } else { + genericMetadata_ = value; + } + } else { + genericMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder clearGenericMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.vertexai.api.GenericOperationMetadata.Builder + getGenericMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGenericMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + if (genericMetadataBuilder_ != null) { + return genericMetadataBuilder_.getMessageOrBuilder(); + } else { + return genericMetadata_ == null + ? com.google.cloud.vertexai.api.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + } + /** + * + * + *
+     * The operation generic information.
+     * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder> + getGenericMetadataFieldBuilder() { + if (genericMetadataBuilder_ == null) { + genericMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenericOperationMetadata, + com.google.cloud.vertexai.api.GenericOperationMetadata.Builder, + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder>( + getGenericMetadata(), getParentForChildren(), isClean()); + genericMetadata_ = null; + } + return genericMetadataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.UndeployModelOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.UndeployModelOperationMetadata) + private static final com.google.cloud.vertexai.api.UndeployModelOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.UndeployModelOperationMetadata(); + } + + public static com.google.cloud.vertexai.api.UndeployModelOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployModelOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelOperationMetadataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..25d852371816 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelOperationMetadataOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface UndeployModelOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.UndeployModelOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + boolean hasGenericMetadata(); + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + com.google.cloud.vertexai.api.GenericOperationMetadata getGenericMetadata(); + /** + * + * + *
+   * The operation generic information.
+   * 
+ * + * .google.cloud.vertexai.v1beta1.GenericOperationMetadata generic_metadata = 1; + */ + com.google.cloud.vertexai.api.GenericOperationMetadataOrBuilder getGenericMetadataOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelRequest.java new file mode 100644 index 000000000000..603755d94a76 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelRequest.java @@ -0,0 +1,1231 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.UndeployModelRequest} + */ +public final class UndeployModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.UndeployModelRequest) + UndeployModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployModelRequest.newBuilder() to construct. + private UndeployModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployModelRequest() { + endpoint_ = ""; + deployedModelId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeployModelRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetTrafficSplit(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.UndeployModelRequest.class, + com.google.cloud.vertexai.api.UndeployModelRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object endpoint_ = ""; + /** + * + * + *
+   * Required. The name of the Endpoint resource from which to undeploy a Model.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + @java.lang.Override + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Endpoint resource from which to undeploy a Model.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPLOYED_MODEL_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object deployedModelId_ = ""; + /** + * + * + *
+   * Required. The ID of the DeployedModel to be undeployed from the Endpoint.
+   * 
+ * + * string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The deployedModelId. + */ + @java.lang.Override + public java.lang.String getDeployedModelId() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedModelId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the DeployedModel to be undeployed from the Endpoint.
+   * 
+ * + * string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for deployedModelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeployedModelIdBytes() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRAFFIC_SPLIT_FIELD_NUMBER = 3; + + private static final class TrafficSplitDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_TrafficSplitEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField trafficSplit_; + + private com.google.protobuf.MapField + internalGetTrafficSplit() { + if (trafficSplit_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TrafficSplitDefaultEntryHolder.defaultEntry); + } + return trafficSplit_; + } + + public int getTrafficSplitCount() { + return internalGetTrafficSplit().getMap().size(); + } + /** + * + * + *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public boolean containsTrafficSplit(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTrafficSplit().getMap().containsKey(key); + } + /** Use {@link #getTrafficSplitMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTrafficSplit() { + return getTrafficSplitMap(); + } + /** + * + * + *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public java.util.Map getTrafficSplitMap() { + return internalGetTrafficSplit().getMap(); + } + /** + * + * + *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public int getTrafficSplitOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public int getTrafficSplitOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedModelId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deployedModelId_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetTrafficSplit(), TrafficSplitDefaultEntryHolder.defaultEntry, 3); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedModelId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deployedModelId_); + } + for (java.util.Map.Entry entry : + internalGetTrafficSplit().getMap().entrySet()) { + com.google.protobuf.MapEntry trafficSplit__ = + TrafficSplitDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, trafficSplit__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.UndeployModelRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.UndeployModelRequest other = + (com.google.cloud.vertexai.api.UndeployModelRequest) obj; + + if (!getEndpoint().equals(other.getEndpoint())) return false; + if (!getDeployedModelId().equals(other.getDeployedModelId())) return false; + if (!internalGetTrafficSplit().equals(other.internalGetTrafficSplit())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + hash = (37 * hash) + DEPLOYED_MODEL_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeployedModelId().hashCode(); + if (!internalGetTrafficSplit().getMap().isEmpty()) { + hash = (37 * hash) + TRAFFIC_SPLIT_FIELD_NUMBER; + hash = (53 * hash) + internalGetTrafficSplit().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.UndeployModelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.UndeployModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.UndeployModelRequest) + com.google.cloud.vertexai.api.UndeployModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetTrafficSplit(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 3: + return internalGetMutableTrafficSplit(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.UndeployModelRequest.class, + com.google.cloud.vertexai.api.UndeployModelRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.UndeployModelRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = ""; + deployedModelId_ = ""; + internalGetMutableTrafficSplit().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.UndeployModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelRequest build() { + com.google.cloud.vertexai.api.UndeployModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelRequest buildPartial() { + com.google.cloud.vertexai.api.UndeployModelRequest result = + new com.google.cloud.vertexai.api.UndeployModelRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.UndeployModelRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deployedModelId_ = deployedModelId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.trafficSplit_ = internalGetTrafficSplit(); + result.trafficSplit_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.UndeployModelRequest) { + return mergeFrom((com.google.cloud.vertexai.api.UndeployModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.UndeployModelRequest other) { + if (other == com.google.cloud.vertexai.api.UndeployModelRequest.getDefaultInstance()) + return this; + if (!other.getEndpoint().isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDeployedModelId().isEmpty()) { + deployedModelId_ = other.deployedModelId_; + bitField0_ |= 0x00000002; + onChanged(); + } + internalGetMutableTrafficSplit().mergeFrom(other.internalGetTrafficSplit()); + bitField0_ |= 0x00000004; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + endpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + deployedModelId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry trafficSplit__ = + input.readMessage( + TrafficSplitDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableTrafficSplit() + .getMutableMap() + .put(trafficSplit__.getKey(), trafficSplit__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object endpoint_ = ""; + /** + * + * + *
+     * Required. The name of the Endpoint resource from which to undeploy a Model.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + public java.lang.String getEndpoint() { + java.lang.Object ref = endpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint resource from which to undeploy a Model.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + public com.google.protobuf.ByteString getEndpointBytes() { + java.lang.Object ref = endpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Endpoint resource from which to undeploy a Model.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint resource from which to undeploy a Model.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEndpoint() { + endpoint_ = getDefaultInstance().getEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Endpoint resource from which to undeploy a Model.
+     * Format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+     * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for endpoint to set. + * @return This builder for chaining. + */ + public Builder setEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object deployedModelId_ = ""; + /** + * + * + *
+     * Required. The ID of the DeployedModel to be undeployed from the Endpoint.
+     * 
+ * + * string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The deployedModelId. + */ + public java.lang.String getDeployedModelId() { + java.lang.Object ref = deployedModelId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedModelId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the DeployedModel to be undeployed from the Endpoint.
+     * 
+ * + * string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for deployedModelId. + */ + public com.google.protobuf.ByteString getDeployedModelIdBytes() { + java.lang.Object ref = deployedModelId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedModelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the DeployedModel to be undeployed from the Endpoint.
+     * 
+ * + * string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The deployedModelId to set. + * @return This builder for chaining. + */ + public Builder setDeployedModelId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + deployedModelId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the DeployedModel to be undeployed from the Endpoint.
+     * 
+ * + * string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDeployedModelId() { + deployedModelId_ = getDefaultInstance().getDeployedModelId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the DeployedModel to be undeployed from the Endpoint.
+     * 
+ * + * string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for deployedModelId to set. + * @return This builder for chaining. + */ + public Builder setDeployedModelIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + deployedModelId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.MapField trafficSplit_; + + private com.google.protobuf.MapField + internalGetTrafficSplit() { + if (trafficSplit_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TrafficSplitDefaultEntryHolder.defaultEntry); + } + return trafficSplit_; + } + + private com.google.protobuf.MapField + internalGetMutableTrafficSplit() { + if (trafficSplit_ == null) { + trafficSplit_ = + com.google.protobuf.MapField.newMapField(TrafficSplitDefaultEntryHolder.defaultEntry); + } + if (!trafficSplit_.isMutable()) { + trafficSplit_ = trafficSplit_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return trafficSplit_; + } + + public int getTrafficSplitCount() { + return internalGetTrafficSplit().getMap().size(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public boolean containsTrafficSplit(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTrafficSplit().getMap().containsKey(key); + } + /** Use {@link #getTrafficSplitMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTrafficSplit() { + return getTrafficSplitMap(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public java.util.Map getTrafficSplitMap() { + return internalGetTrafficSplit().getMap(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public int getTrafficSplitOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + @java.lang.Override + public int getTrafficSplitOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTrafficSplit().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTrafficSplit() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableTrafficSplit().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + public Builder removeTrafficSplit(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTrafficSplit().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableTrafficSplit() { + bitField0_ |= 0x00000004; + return internalGetMutableTrafficSplit().getMutableMap(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + public Builder putTrafficSplit(java.lang.String key, int value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableTrafficSplit().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * map<string, int32> traffic_split = 3; + */ + public Builder putAllTrafficSplit(java.util.Map values) { + internalGetMutableTrafficSplit().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.UndeployModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.UndeployModelRequest) + private static final com.google.cloud.vertexai.api.UndeployModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.UndeployModelRequest(); + } + + public static com.google.cloud.vertexai.api.UndeployModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelRequestOrBuilder.java new file mode 100644 index 000000000000..3c307fceb7d0 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelRequestOrBuilder.java @@ -0,0 +1,167 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface UndeployModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.UndeployModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Endpoint resource from which to undeploy a Model.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The endpoint. + */ + java.lang.String getEndpoint(); + /** + * + * + *
+   * Required. The name of the Endpoint resource from which to undeploy a Model.
+   * Format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
+   * 
+ * + * + * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for endpoint. + */ + com.google.protobuf.ByteString getEndpointBytes(); + + /** + * + * + *
+   * Required. The ID of the DeployedModel to be undeployed from the Endpoint.
+   * 
+ * + * string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The deployedModelId. + */ + java.lang.String getDeployedModelId(); + /** + * + * + *
+   * Required. The ID of the DeployedModel to be undeployed from the Endpoint.
+   * 
+ * + * string deployed_model_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for deployedModelId. + */ + com.google.protobuf.ByteString getDeployedModelIdBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + int getTrafficSplitCount(); + /** + * + * + *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + boolean containsTrafficSplit(java.lang.String key); + /** Use {@link #getTrafficSplitMap()} instead. */ + @java.lang.Deprecated + java.util.Map getTrafficSplit(); + /** + * + * + *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + java.util.Map getTrafficSplitMap(); + /** + * + * + *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + int getTrafficSplitOrDefault(java.lang.String key, int defaultValue); + /** + * + * + *
+   * 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.
+   * 
+ * + * map<string, int32> traffic_split = 3; + */ + int getTrafficSplitOrThrow(java.lang.String key); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelResponse.java new file mode 100644 index 000000000000..9f39d8d5470a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelResponse.java @@ -0,0 +1,433 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Response message for
+ * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.UndeployModelResponse} + */ +public final class UndeployModelResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.UndeployModelResponse) + UndeployModelResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeployModelResponse.newBuilder() to construct. + private UndeployModelResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeployModelResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeployModelResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.UndeployModelResponse.class, + com.google.cloud.vertexai.api.UndeployModelResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.UndeployModelResponse)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.UndeployModelResponse other = + (com.google.cloud.vertexai.api.UndeployModelResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.UndeployModelResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.UndeployModelResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.UndeployModelResponse) + com.google.cloud.vertexai.api.UndeployModelResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.UndeployModelResponse.class, + com.google.cloud.vertexai.api.UndeployModelResponse.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.UndeployModelResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UndeployModelResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelResponse getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.UndeployModelResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelResponse build() { + com.google.cloud.vertexai.api.UndeployModelResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelResponse buildPartial() { + com.google.cloud.vertexai.api.UndeployModelResponse result = + new com.google.cloud.vertexai.api.UndeployModelResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.UndeployModelResponse) { + return mergeFrom((com.google.cloud.vertexai.api.UndeployModelResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.UndeployModelResponse other) { + if (other == com.google.cloud.vertexai.api.UndeployModelResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.UndeployModelResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.UndeployModelResponse) + private static final com.google.cloud.vertexai.api.UndeployModelResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.UndeployModelResponse(); + } + + public static com.google.cloud.vertexai.api.UndeployModelResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeployModelResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UndeployModelResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelResponseOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelResponseOrBuilder.java new file mode 100644 index 000000000000..2eaf88b183a0 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UndeployModelResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface UndeployModelResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.UndeployModelResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UpdateEndpointRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UpdateEndpointRequest.java new file mode 100644 index 000000000000..22a74421218b --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UpdateEndpointRequest.java @@ -0,0 +1,1015 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Request message for
+ * [EndpointService.UpdateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.UpdateEndpoint].
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.UpdateEndpointRequest} + */ +public final class UpdateEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.UpdateEndpointRequest) + UpdateEndpointRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateEndpointRequest.newBuilder() to construct. + private UpdateEndpointRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateEndpointRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateEndpointRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UpdateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UpdateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.UpdateEndpointRequest.class, + com.google.cloud.vertexai.api.UpdateEndpointRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.Endpoint endpoint_; + /** + * + * + *
+   * Required. The Endpoint which replaces the resource on the server.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + @java.lang.Override + public boolean hasEndpoint() { + return endpoint_ != null; + } + /** + * + * + *
+   * Required. The Endpoint which replaces the resource on the server.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Endpoint getEndpoint() { + return endpoint_ == null + ? com.google.cloud.vertexai.api.Endpoint.getDefaultInstance() + : endpoint_; + } + /** + * + * + *
+   * Required. The Endpoint which replaces the resource on the server.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.EndpointOrBuilder getEndpointOrBuilder() { + return endpoint_ == null + ? com.google.cloud.vertexai.api.Endpoint.getDefaultInstance() + : endpoint_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (endpoint_ != null) { + output.writeMessage(1, getEndpoint()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (endpoint_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEndpoint()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.UpdateEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.UpdateEndpointRequest other = + (com.google.cloud.vertexai.api.UpdateEndpointRequest) obj; + + if (hasEndpoint() != other.hasEndpoint()) return false; + if (hasEndpoint()) { + if (!getEndpoint().equals(other.getEndpoint())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEndpoint()) { + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.UpdateEndpointRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EndpointService.UpdateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.UpdateEndpoint].
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.UpdateEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.UpdateEndpointRequest) + com.google.cloud.vertexai.api.UpdateEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UpdateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UpdateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.UpdateEndpointRequest.class, + com.google.cloud.vertexai.api.UpdateEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.UpdateEndpointRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpoint_ = null; + if (endpointBuilder_ != null) { + endpointBuilder_.dispose(); + endpointBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.EndpointServiceProto + .internal_static_google_cloud_vertexai_v1beta1_UpdateEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UpdateEndpointRequest getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.UpdateEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UpdateEndpointRequest build() { + com.google.cloud.vertexai.api.UpdateEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UpdateEndpointRequest buildPartial() { + com.google.cloud.vertexai.api.UpdateEndpointRequest result = + new com.google.cloud.vertexai.api.UpdateEndpointRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.UpdateEndpointRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endpoint_ = endpointBuilder_ == null ? endpoint_ : endpointBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.UpdateEndpointRequest) { + return mergeFrom((com.google.cloud.vertexai.api.UpdateEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.UpdateEndpointRequest other) { + if (other == com.google.cloud.vertexai.api.UpdateEndpointRequest.getDefaultInstance()) + return this; + if (other.hasEndpoint()) { + mergeEndpoint(other.getEndpoint()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getEndpointFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.Endpoint endpoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Endpoint, + com.google.cloud.vertexai.api.Endpoint.Builder, + com.google.cloud.vertexai.api.EndpointOrBuilder> + endpointBuilder_; + /** + * + * + *
+     * Required. The Endpoint which replaces the resource on the server.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + public boolean hasEndpoint() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The Endpoint which replaces the resource on the server.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + public com.google.cloud.vertexai.api.Endpoint getEndpoint() { + if (endpointBuilder_ == null) { + return endpoint_ == null + ? com.google.cloud.vertexai.api.Endpoint.getDefaultInstance() + : endpoint_; + } else { + return endpointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Endpoint which replaces the resource on the server.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint(com.google.cloud.vertexai.api.Endpoint value) { + if (endpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + } else { + endpointBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Endpoint which replaces the resource on the server.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint(com.google.cloud.vertexai.api.Endpoint.Builder builderForValue) { + if (endpointBuilder_ == null) { + endpoint_ = builderForValue.build(); + } else { + endpointBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Endpoint which replaces the resource on the server.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEndpoint(com.google.cloud.vertexai.api.Endpoint value) { + if (endpointBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && endpoint_ != null + && endpoint_ != com.google.cloud.vertexai.api.Endpoint.getDefaultInstance()) { + getEndpointBuilder().mergeFrom(value); + } else { + endpoint_ = value; + } + } else { + endpointBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Endpoint which replaces the resource on the server.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEndpoint() { + bitField0_ = (bitField0_ & ~0x00000001); + endpoint_ = null; + if (endpointBuilder_ != null) { + endpointBuilder_.dispose(); + endpointBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Endpoint which replaces the resource on the server.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.Endpoint.Builder getEndpointBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getEndpointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Endpoint which replaces the resource on the server.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.vertexai.api.EndpointOrBuilder getEndpointOrBuilder() { + if (endpointBuilder_ != null) { + return endpointBuilder_.getMessageOrBuilder(); + } else { + return endpoint_ == null + ? com.google.cloud.vertexai.api.Endpoint.getDefaultInstance() + : endpoint_; + } + } + /** + * + * + *
+     * Required. The Endpoint which replaces the resource on the server.
+     * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Endpoint, + com.google.cloud.vertexai.api.Endpoint.Builder, + com.google.cloud.vertexai.api.EndpointOrBuilder> + getEndpointFieldBuilder() { + if (endpointBuilder_ == null) { + endpointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Endpoint, + com.google.cloud.vertexai.api.Endpoint.Builder, + com.google.cloud.vertexai.api.EndpointOrBuilder>( + getEndpoint(), getParentForChildren(), isClean()); + endpoint_ = null; + } + return endpointBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource. See
+     * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.UpdateEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.UpdateEndpointRequest) + private static final com.google.cloud.vertexai.api.UpdateEndpointRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.UpdateEndpointRequest(); + } + + public static com.google.cloud.vertexai.api.UpdateEndpointRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateEndpointRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.UpdateEndpointRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UpdateEndpointRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UpdateEndpointRequestOrBuilder.java new file mode 100644 index 000000000000..03124734b098 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/UpdateEndpointRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/endpoint_service.proto + +package com.google.cloud.vertexai.api; + +public interface UpdateEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.UpdateEndpointRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Endpoint which replaces the resource on the server.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + boolean hasEndpoint(); + /** + * + * + *
+   * Required. The Endpoint which replaces the resource on the server.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + com.google.cloud.vertexai.api.Endpoint getEndpoint(); + /** + * + * + *
+   * Required. The Endpoint which replaces the resource on the server.
+   * 
+ * + * + * .google.cloud.vertexai.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.vertexai.api.EndpointOrBuilder getEndpointOrBuilder(); + + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource. See
+   * [google.protobuf.FieldMask][google.protobuf.FieldMask].
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/VideoMetadata.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/VideoMetadata.java new file mode 100644 index 000000000000..ab97476b5789 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/VideoMetadata.java @@ -0,0 +1,981 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Metadata describes the input video content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.VideoMetadata} + */ +public final class VideoMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.VideoMetadata) + VideoMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use VideoMetadata.newBuilder() to construct. + private VideoMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VideoMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VideoMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_VideoMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_VideoMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.VideoMetadata.class, + com.google.cloud.vertexai.api.VideoMetadata.Builder.class); + } + + public static final int START_OFFSET_FIELD_NUMBER = 1; + private com.google.protobuf.Duration startOffset_; + /** + * + * + *
+   * Optional. The start offset of the video.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the startOffset field is set. + */ + @java.lang.Override + public boolean hasStartOffset() { + return startOffset_ != null; + } + /** + * + * + *
+   * Optional. The start offset of the video.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The startOffset. + */ + @java.lang.Override + public com.google.protobuf.Duration getStartOffset() { + return startOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startOffset_; + } + /** + * + * + *
+   * Optional. The start offset of the video.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStartOffsetOrBuilder() { + return startOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startOffset_; + } + + public static final int END_OFFSET_FIELD_NUMBER = 2; + private com.google.protobuf.Duration endOffset_; + /** + * + * + *
+   * Optional. The end offset of the video.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the endOffset field is set. + */ + @java.lang.Override + public boolean hasEndOffset() { + return endOffset_ != null; + } + /** + * + * + *
+   * Optional. The end offset of the video.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The endOffset. + */ + @java.lang.Override + public com.google.protobuf.Duration getEndOffset() { + return endOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endOffset_; + } + /** + * + * + *
+   * Optional. The end offset of the video.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getEndOffsetOrBuilder() { + return endOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endOffset_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (startOffset_ != null) { + output.writeMessage(1, getStartOffset()); + } + if (endOffset_ != null) { + output.writeMessage(2, getEndOffset()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startOffset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartOffset()); + } + if (endOffset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndOffset()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.VideoMetadata)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.VideoMetadata other = + (com.google.cloud.vertexai.api.VideoMetadata) obj; + + if (hasStartOffset() != other.hasStartOffset()) return false; + if (hasStartOffset()) { + if (!getStartOffset().equals(other.getStartOffset())) return false; + } + if (hasEndOffset() != other.hasEndOffset()) return false; + if (hasEndOffset()) { + if (!getEndOffset().equals(other.getEndOffset())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStartOffset()) { + hash = (37 * hash) + START_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getStartOffset().hashCode(); + } + if (hasEndOffset()) { + hash = (37 * hash) + END_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getEndOffset().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.VideoMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.VideoMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata describes the input video content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.VideoMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.VideoMetadata) + com.google.cloud.vertexai.api.VideoMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_VideoMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_VideoMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.VideoMetadata.class, + com.google.cloud.vertexai.api.VideoMetadata.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.VideoMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startOffset_ = null; + if (startOffsetBuilder_ != null) { + startOffsetBuilder_.dispose(); + startOffsetBuilder_ = null; + } + endOffset_ = null; + if (endOffsetBuilder_ != null) { + endOffsetBuilder_.dispose(); + endOffsetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1beta1_VideoMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.VideoMetadata getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.VideoMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.VideoMetadata build() { + com.google.cloud.vertexai.api.VideoMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.VideoMetadata buildPartial() { + com.google.cloud.vertexai.api.VideoMetadata result = + new com.google.cloud.vertexai.api.VideoMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.VideoMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startOffset_ = + startOffsetBuilder_ == null ? startOffset_ : startOffsetBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endOffset_ = endOffsetBuilder_ == null ? endOffset_ : endOffsetBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.VideoMetadata) { + return mergeFrom((com.google.cloud.vertexai.api.VideoMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.VideoMetadata other) { + if (other == com.google.cloud.vertexai.api.VideoMetadata.getDefaultInstance()) return this; + if (other.hasStartOffset()) { + mergeStartOffset(other.getStartOffset()); + } + if (other.hasEndOffset()) { + mergeEndOffset(other.getEndOffset()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStartOffsetFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndOffsetFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration startOffset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + startOffsetBuilder_; + /** + * + * + *
+     * Optional. The start offset of the video.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the startOffset field is set. + */ + public boolean hasStartOffset() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. The start offset of the video.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The startOffset. + */ + public com.google.protobuf.Duration getStartOffset() { + if (startOffsetBuilder_ == null) { + return startOffset_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : startOffset_; + } else { + return startOffsetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The start offset of the video.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setStartOffset(com.google.protobuf.Duration value) { + if (startOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startOffset_ = value; + } else { + startOffsetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The start offset of the video.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setStartOffset(com.google.protobuf.Duration.Builder builderForValue) { + if (startOffsetBuilder_ == null) { + startOffset_ = builderForValue.build(); + } else { + startOffsetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The start offset of the video.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeStartOffset(com.google.protobuf.Duration value) { + if (startOffsetBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && startOffset_ != null + && startOffset_ != com.google.protobuf.Duration.getDefaultInstance()) { + getStartOffsetBuilder().mergeFrom(value); + } else { + startOffset_ = value; + } + } else { + startOffsetBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The start offset of the video.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearStartOffset() { + bitField0_ = (bitField0_ & ~0x00000001); + startOffset_ = null; + if (startOffsetBuilder_ != null) { + startOffsetBuilder_.dispose(); + startOffsetBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The start offset of the video.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getStartOffsetBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStartOffsetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The start offset of the video.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getStartOffsetOrBuilder() { + if (startOffsetBuilder_ != null) { + return startOffsetBuilder_.getMessageOrBuilder(); + } else { + return startOffset_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : startOffset_; + } + } + /** + * + * + *
+     * Optional. The start offset of the video.
+     * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getStartOffsetFieldBuilder() { + if (startOffsetBuilder_ == null) { + startOffsetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getStartOffset(), getParentForChildren(), isClean()); + startOffset_ = null; + } + return startOffsetBuilder_; + } + + private com.google.protobuf.Duration endOffset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + endOffsetBuilder_; + /** + * + * + *
+     * Optional. The end offset of the video.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the endOffset field is set. + */ + public boolean hasEndOffset() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. The end offset of the video.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The endOffset. + */ + public com.google.protobuf.Duration getEndOffset() { + if (endOffsetBuilder_ == null) { + return endOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endOffset_; + } else { + return endOffsetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The end offset of the video.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEndOffset(com.google.protobuf.Duration value) { + if (endOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endOffset_ = value; + } else { + endOffsetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The end offset of the video.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEndOffset(com.google.protobuf.Duration.Builder builderForValue) { + if (endOffsetBuilder_ == null) { + endOffset_ = builderForValue.build(); + } else { + endOffsetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The end offset of the video.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEndOffset(com.google.protobuf.Duration value) { + if (endOffsetBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endOffset_ != null + && endOffset_ != com.google.protobuf.Duration.getDefaultInstance()) { + getEndOffsetBuilder().mergeFrom(value); + } else { + endOffset_ = value; + } + } else { + endOffsetBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The end offset of the video.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEndOffset() { + bitField0_ = (bitField0_ & ~0x00000002); + endOffset_ = null; + if (endOffsetBuilder_ != null) { + endOffsetBuilder_.dispose(); + endOffsetBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The end offset of the video.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getEndOffsetBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndOffsetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The end offset of the video.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getEndOffsetOrBuilder() { + if (endOffsetBuilder_ != null) { + return endOffsetBuilder_.getMessageOrBuilder(); + } else { + return endOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endOffset_; + } + } + /** + * + * + *
+     * Optional. The end offset of the video.
+     * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getEndOffsetFieldBuilder() { + if (endOffsetBuilder_ == null) { + endOffsetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getEndOffset(), getParentForChildren(), isClean()); + endOffset_ = null; + } + return endOffsetBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.VideoMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.VideoMetadata) + private static final com.google.cloud.vertexai.api.VideoMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.VideoMetadata(); + } + + public static com.google.cloud.vertexai.api.VideoMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VideoMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.VideoMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/VideoMetadataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/VideoMetadataOrBuilder.java new file mode 100644 index 000000000000..b432e730d388 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/VideoMetadataOrBuilder.java @@ -0,0 +1,101 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/content.proto + +package com.google.cloud.vertexai.api; + +public interface VideoMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.VideoMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The start offset of the video.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the startOffset field is set. + */ + boolean hasStartOffset(); + /** + * + * + *
+   * Optional. The start offset of the video.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The startOffset. + */ + com.google.protobuf.Duration getStartOffset(); + /** + * + * + *
+   * Optional. The start offset of the video.
+   * 
+ * + * .google.protobuf.Duration start_offset = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getStartOffsetOrBuilder(); + + /** + * + * + *
+   * Optional. The end offset of the video.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the endOffset field is set. + */ + boolean hasEndOffset(); + /** + * + * + *
+   * Optional. The end offset of the video.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The endOffset. + */ + com.google.protobuf.Duration getEndOffset(); + /** + * + * + *
+   * Optional. The end offset of the video.
+   * 
+ * + * .google.protobuf.Duration end_offset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getEndOffsetOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/XraiAttribution.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/XraiAttribution.java new file mode 100644 index 000000000000..6bbb1259498f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/XraiAttribution.java @@ -0,0 +1,1219 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * An explanation method that redistributes Integrated Gradients
+ * attributions to segmented regions, taking advantage of the model's fully
+ * differentiable structure. Refer to this paper for more details:
+ * https://arxiv.org/abs/1906.02825
+ *
+ * Supported only by image Models.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.XraiAttribution} + */ +public final class XraiAttribution extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1beta1.XraiAttribution) + XraiAttributionOrBuilder { + private static final long serialVersionUID = 0L; + // Use XraiAttribution.newBuilder() to construct. + private XraiAttribution(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private XraiAttribution() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new XraiAttribution(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_XraiAttribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_XraiAttribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.XraiAttribution.class, + com.google.cloud.vertexai.api.XraiAttribution.Builder.class); + } + + public static final int STEP_COUNT_FIELD_NUMBER = 1; + private int stepCount_ = 0; + /** + * + * + *
+   * Required. The number of steps for approximating the path integral.
+   * A good value to start is 50 and gradually increase until the
+   * sum to diff property is met within the desired error range.
+   *
+   * Valid range of its value is [1, 100], inclusively.
+   * 
+ * + * int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The stepCount. + */ + @java.lang.Override + public int getStepCount() { + return stepCount_; + } + + public static final int SMOOTH_GRAD_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.vertexai.api.SmoothGradConfig smoothGradConfig_; + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return Whether the smoothGradConfig field is set. + */ + @java.lang.Override + public boolean hasSmoothGradConfig() { + return smoothGradConfig_ != null; + } + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return The smoothGradConfig. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SmoothGradConfig getSmoothGradConfig() { + return smoothGradConfig_ == null + ? com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance() + : smoothGradConfig_; + } + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder getSmoothGradConfigOrBuilder() { + return smoothGradConfig_ == null + ? com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance() + : smoothGradConfig_; + } + + public static final int BLUR_BASELINE_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.vertexai.api.BlurBaselineConfig blurBaselineConfig_; + /** + * + * + *
+   * Config for XRAI with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return Whether the blurBaselineConfig field is set. + */ + @java.lang.Override + public boolean hasBlurBaselineConfig() { + return blurBaselineConfig_ != null; + } + /** + * + * + *
+   * Config for XRAI with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return The blurBaselineConfig. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.BlurBaselineConfig getBlurBaselineConfig() { + return blurBaselineConfig_ == null + ? com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance() + : blurBaselineConfig_; + } + /** + * + * + *
+   * Config for XRAI with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder + getBlurBaselineConfigOrBuilder() { + return blurBaselineConfig_ == null + ? com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance() + : blurBaselineConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (stepCount_ != 0) { + output.writeInt32(1, stepCount_); + } + if (smoothGradConfig_ != null) { + output.writeMessage(2, getSmoothGradConfig()); + } + if (blurBaselineConfig_ != null) { + output.writeMessage(3, getBlurBaselineConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (stepCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, stepCount_); + } + if (smoothGradConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSmoothGradConfig()); + } + if (blurBaselineConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBlurBaselineConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.XraiAttribution)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.XraiAttribution other = + (com.google.cloud.vertexai.api.XraiAttribution) obj; + + if (getStepCount() != other.getStepCount()) return false; + if (hasSmoothGradConfig() != other.hasSmoothGradConfig()) return false; + if (hasSmoothGradConfig()) { + if (!getSmoothGradConfig().equals(other.getSmoothGradConfig())) return false; + } + if (hasBlurBaselineConfig() != other.hasBlurBaselineConfig()) return false; + if (hasBlurBaselineConfig()) { + if (!getBlurBaselineConfig().equals(other.getBlurBaselineConfig())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STEP_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getStepCount(); + if (hasSmoothGradConfig()) { + hash = (37 * hash) + SMOOTH_GRAD_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSmoothGradConfig().hashCode(); + } + if (hasBlurBaselineConfig()) { + hash = (37 * hash) + BLUR_BASELINE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getBlurBaselineConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.XraiAttribution parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.XraiAttribution prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An explanation method that redistributes Integrated Gradients
+   * attributions to segmented regions, taking advantage of the model's fully
+   * differentiable structure. Refer to this paper for more details:
+   * https://arxiv.org/abs/1906.02825
+   *
+   * Supported only by image Models.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1beta1.XraiAttribution} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1beta1.XraiAttribution) + com.google.cloud.vertexai.api.XraiAttributionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_XraiAttribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_XraiAttribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.XraiAttribution.class, + com.google.cloud.vertexai.api.XraiAttribution.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.XraiAttribution.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + stepCount_ = 0; + smoothGradConfig_ = null; + if (smoothGradConfigBuilder_ != null) { + smoothGradConfigBuilder_.dispose(); + smoothGradConfigBuilder_ = null; + } + blurBaselineConfig_ = null; + if (blurBaselineConfigBuilder_ != null) { + blurBaselineConfigBuilder_.dispose(); + blurBaselineConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ExplanationProto + .internal_static_google_cloud_vertexai_v1beta1_XraiAttribution_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.XraiAttribution getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.XraiAttribution.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.XraiAttribution build() { + com.google.cloud.vertexai.api.XraiAttribution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.XraiAttribution buildPartial() { + com.google.cloud.vertexai.api.XraiAttribution result = + new com.google.cloud.vertexai.api.XraiAttribution(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.XraiAttribution result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.stepCount_ = stepCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.smoothGradConfig_ = + smoothGradConfigBuilder_ == null ? smoothGradConfig_ : smoothGradConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.blurBaselineConfig_ = + blurBaselineConfigBuilder_ == null + ? blurBaselineConfig_ + : blurBaselineConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.XraiAttribution) { + return mergeFrom((com.google.cloud.vertexai.api.XraiAttribution) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.XraiAttribution other) { + if (other == com.google.cloud.vertexai.api.XraiAttribution.getDefaultInstance()) return this; + if (other.getStepCount() != 0) { + setStepCount(other.getStepCount()); + } + if (other.hasSmoothGradConfig()) { + mergeSmoothGradConfig(other.getSmoothGradConfig()); + } + if (other.hasBlurBaselineConfig()) { + mergeBlurBaselineConfig(other.getBlurBaselineConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + stepCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + getSmoothGradConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getBlurBaselineConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int stepCount_; + /** + * + * + *
+     * Required. The number of steps for approximating the path integral.
+     * A good value to start is 50 and gradually increase until the
+     * sum to diff property is met within the desired error range.
+     *
+     * Valid range of its value is [1, 100], inclusively.
+     * 
+ * + * int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The stepCount. + */ + @java.lang.Override + public int getStepCount() { + return stepCount_; + } + /** + * + * + *
+     * Required. The number of steps for approximating the path integral.
+     * A good value to start is 50 and gradually increase until the
+     * sum to diff property is met within the desired error range.
+     *
+     * Valid range of its value is [1, 100], inclusively.
+     * 
+ * + * int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The stepCount to set. + * @return This builder for chaining. + */ + public Builder setStepCount(int value) { + + stepCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The number of steps for approximating the path integral.
+     * A good value to start is 50 and gradually increase until the
+     * sum to diff property is met within the desired error range.
+     *
+     * Valid range of its value is [1, 100], inclusively.
+     * 
+ * + * int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearStepCount() { + bitField0_ = (bitField0_ & ~0x00000001); + stepCount_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.vertexai.api.SmoothGradConfig smoothGradConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.SmoothGradConfig, + com.google.cloud.vertexai.api.SmoothGradConfig.Builder, + com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder> + smoothGradConfigBuilder_; + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return Whether the smoothGradConfig field is set. + */ + public boolean hasSmoothGradConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return The smoothGradConfig. + */ + public com.google.cloud.vertexai.api.SmoothGradConfig getSmoothGradConfig() { + if (smoothGradConfigBuilder_ == null) { + return smoothGradConfig_ == null + ? com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance() + : smoothGradConfig_; + } else { + return smoothGradConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public Builder setSmoothGradConfig(com.google.cloud.vertexai.api.SmoothGradConfig value) { + if (smoothGradConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + smoothGradConfig_ = value; + } else { + smoothGradConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public Builder setSmoothGradConfig( + com.google.cloud.vertexai.api.SmoothGradConfig.Builder builderForValue) { + if (smoothGradConfigBuilder_ == null) { + smoothGradConfig_ = builderForValue.build(); + } else { + smoothGradConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public Builder mergeSmoothGradConfig(com.google.cloud.vertexai.api.SmoothGradConfig value) { + if (smoothGradConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && smoothGradConfig_ != null + && smoothGradConfig_ + != com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance()) { + getSmoothGradConfigBuilder().mergeFrom(value); + } else { + smoothGradConfig_ = value; + } + } else { + smoothGradConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public Builder clearSmoothGradConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + smoothGradConfig_ = null; + if (smoothGradConfigBuilder_ != null) { + smoothGradConfigBuilder_.dispose(); + smoothGradConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public com.google.cloud.vertexai.api.SmoothGradConfig.Builder getSmoothGradConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSmoothGradConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + public com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder getSmoothGradConfigOrBuilder() { + if (smoothGradConfigBuilder_ != null) { + return smoothGradConfigBuilder_.getMessageOrBuilder(); + } else { + return smoothGradConfig_ == null + ? com.google.cloud.vertexai.api.SmoothGradConfig.getDefaultInstance() + : smoothGradConfig_; + } + } + /** + * + * + *
+     * Config for SmoothGrad approximation of gradients.
+     *
+     * When enabled, the gradients are approximated by averaging the gradients
+     * from noisy samples in the vicinity of the inputs. Adding
+     * noise can help improve the computed gradients. Refer to this paper for more
+     * details: https://arxiv.org/pdf/1706.03825.pdf
+     * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.SmoothGradConfig, + com.google.cloud.vertexai.api.SmoothGradConfig.Builder, + com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder> + getSmoothGradConfigFieldBuilder() { + if (smoothGradConfigBuilder_ == null) { + smoothGradConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.SmoothGradConfig, + com.google.cloud.vertexai.api.SmoothGradConfig.Builder, + com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder>( + getSmoothGradConfig(), getParentForChildren(), isClean()); + smoothGradConfig_ = null; + } + return smoothGradConfigBuilder_; + } + + private com.google.cloud.vertexai.api.BlurBaselineConfig blurBaselineConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.BlurBaselineConfig, + com.google.cloud.vertexai.api.BlurBaselineConfig.Builder, + com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder> + blurBaselineConfigBuilder_; + /** + * + * + *
+     * Config for XRAI with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return Whether the blurBaselineConfig field is set. + */ + public boolean hasBlurBaselineConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Config for XRAI with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return The blurBaselineConfig. + */ + public com.google.cloud.vertexai.api.BlurBaselineConfig getBlurBaselineConfig() { + if (blurBaselineConfigBuilder_ == null) { + return blurBaselineConfig_ == null + ? com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance() + : blurBaselineConfig_; + } else { + return blurBaselineConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Config for XRAI with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public Builder setBlurBaselineConfig(com.google.cloud.vertexai.api.BlurBaselineConfig value) { + if (blurBaselineConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurBaselineConfig_ = value; + } else { + blurBaselineConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for XRAI with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public Builder setBlurBaselineConfig( + com.google.cloud.vertexai.api.BlurBaselineConfig.Builder builderForValue) { + if (blurBaselineConfigBuilder_ == null) { + blurBaselineConfig_ = builderForValue.build(); + } else { + blurBaselineConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for XRAI with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public Builder mergeBlurBaselineConfig(com.google.cloud.vertexai.api.BlurBaselineConfig value) { + if (blurBaselineConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && blurBaselineConfig_ != null + && blurBaselineConfig_ + != com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance()) { + getBlurBaselineConfigBuilder().mergeFrom(value); + } else { + blurBaselineConfig_ = value; + } + } else { + blurBaselineConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Config for XRAI with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public Builder clearBlurBaselineConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + blurBaselineConfig_ = null; + if (blurBaselineConfigBuilder_ != null) { + blurBaselineConfigBuilder_.dispose(); + blurBaselineConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Config for XRAI with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public com.google.cloud.vertexai.api.BlurBaselineConfig.Builder getBlurBaselineConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBlurBaselineConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Config for XRAI with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + public com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder + getBlurBaselineConfigOrBuilder() { + if (blurBaselineConfigBuilder_ != null) { + return blurBaselineConfigBuilder_.getMessageOrBuilder(); + } else { + return blurBaselineConfig_ == null + ? com.google.cloud.vertexai.api.BlurBaselineConfig.getDefaultInstance() + : blurBaselineConfig_; + } + } + /** + * + * + *
+     * Config for XRAI with blur baseline.
+     *
+     * When enabled, a linear path from the maximally blurred image to the input
+     * image is created. Using a blurred baseline instead of zero (black image) is
+     * motivated by the BlurIG approach explained here:
+     * https://arxiv.org/abs/2004.03383
+     * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.BlurBaselineConfig, + com.google.cloud.vertexai.api.BlurBaselineConfig.Builder, + com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder> + getBlurBaselineConfigFieldBuilder() { + if (blurBaselineConfigBuilder_ == null) { + blurBaselineConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.BlurBaselineConfig, + com.google.cloud.vertexai.api.BlurBaselineConfig.Builder, + com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder>( + getBlurBaselineConfig(), getParentForChildren(), isClean()); + blurBaselineConfig_ = null; + } + return blurBaselineConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1beta1.XraiAttribution) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1beta1.XraiAttribution) + private static final com.google.cloud.vertexai.api.XraiAttribution DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.XraiAttribution(); + } + + public static com.google.cloud.vertexai.api.XraiAttribution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public XraiAttribution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.XraiAttribution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/XraiAttributionOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/XraiAttributionOrBuilder.java new file mode 100644 index 000000000000..e79a46c0dfa6 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/java/com/google/cloud/vertexai/api/XraiAttributionOrBuilder.java @@ -0,0 +1,142 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1beta1/explanation.proto + +package com.google.cloud.vertexai.api; + +public interface XraiAttributionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1beta1.XraiAttribution) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The number of steps for approximating the path integral.
+   * A good value to start is 50 and gradually increase until the
+   * sum to diff property is met within the desired error range.
+   *
+   * Valid range of its value is [1, 100], inclusively.
+   * 
+ * + * int32 step_count = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The stepCount. + */ + int getStepCount(); + + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return Whether the smoothGradConfig field is set. + */ + boolean hasSmoothGradConfig(); + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + * + * @return The smoothGradConfig. + */ + com.google.cloud.vertexai.api.SmoothGradConfig getSmoothGradConfig(); + /** + * + * + *
+   * Config for SmoothGrad approximation of gradients.
+   *
+   * When enabled, the gradients are approximated by averaging the gradients
+   * from noisy samples in the vicinity of the inputs. Adding
+   * noise can help improve the computed gradients. Refer to this paper for more
+   * details: https://arxiv.org/pdf/1706.03825.pdf
+   * 
+ * + * .google.cloud.vertexai.v1beta1.SmoothGradConfig smooth_grad_config = 2; + */ + com.google.cloud.vertexai.api.SmoothGradConfigOrBuilder getSmoothGradConfigOrBuilder(); + + /** + * + * + *
+   * Config for XRAI with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return Whether the blurBaselineConfig field is set. + */ + boolean hasBlurBaselineConfig(); + /** + * + * + *
+   * Config for XRAI with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + * + * @return The blurBaselineConfig. + */ + com.google.cloud.vertexai.api.BlurBaselineConfig getBlurBaselineConfig(); + /** + * + * + *
+   * Config for XRAI with blur baseline.
+   *
+   * When enabled, a linear path from the maximally blurred image to the input
+   * image is created. Using a blurred baseline instead of zero (black image) is
+   * motivated by the BlurIG approach explained here:
+   * https://arxiv.org/abs/2004.03383
+   * 
+ * + * .google.cloud.vertexai.v1beta1.BlurBaselineConfig blur_baseline_config = 3; + */ + com.google.cloud.vertexai.api.BlurBaselineConfigOrBuilder getBlurBaselineConfigOrBuilder(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/accelerator_type.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/accelerator_type.proto new file mode 100644 index 000000000000..2670c057ea71 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/accelerator_type.proto @@ -0,0 +1,70 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "AcceleratorTypeProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// Represents a hardware accelerator type. +enum AcceleratorType { + // Unspecified accelerator type, which means no accelerator. + ACCELERATOR_TYPE_UNSPECIFIED = 0; + + // Nvidia Tesla K80 GPU. + NVIDIA_TESLA_K80 = 1; + + // Nvidia Tesla P100 GPU. + NVIDIA_TESLA_P100 = 2; + + // Nvidia Tesla V100 GPU. + NVIDIA_TESLA_V100 = 3; + + // Nvidia Tesla P4 GPU. + NVIDIA_TESLA_P4 = 4; + + // Nvidia Tesla T4 GPU. + NVIDIA_TESLA_T4 = 5; + + // Nvidia Tesla A100 GPU. + NVIDIA_TESLA_A100 = 8; + + // Nvidia A100 80GB GPU. + NVIDIA_A100_80GB = 9; + + // Nvidia L4 GPU. + NVIDIA_L4 = 11; + + // Nvidia H100 80Gb GPU. + NVIDIA_H100_80GB = 13; + + // TPU v2. + TPU_V2 = 6; + + // TPU v3. + TPU_V3 = 7; + + // TPU v4. + TPU_V4_POD = 10; + + // TPU v5. + TPU_V5_LITEPOD = 12; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/content.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/content.proto new file mode 100644 index 000000000000..3d8800f26332 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/content.proto @@ -0,0 +1,309 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/vertexai/v1beta1/tool.proto"; +import "google/protobuf/duration.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "ContentProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// Harm categories that will block the content. +enum HarmCategory { + // The harm category is unspecified. + HARM_CATEGORY_UNSPECIFIED = 0; + + // The harm category is hate speech. + HARM_CATEGORY_HATE_SPEECH = 1; + + // The harm category is dangerous content. + HARM_CATEGORY_DANGEROUS_CONTENT = 2; + + // The harm category is harassment. + HARM_CATEGORY_HARASSMENT = 3; + + // The harm category is sexually explicit content. + HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; +} + +// The base structured datatype containing multi-part content of a message. +// +// A `Content` includes a `role` field designating the producer of the `Content` +// and a `parts` field containing multi-part data that contains the content of +// the message turn. +message Content { + // Optional. The producer of the content. Must be either 'user' or 'model'. + // + // Useful to set for multi-turn conversations, otherwise can be left blank + // or unset. + string role = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Ordered `Parts` that constitute a single message. Parts may have + // different IANA MIME types. + repeated Part parts = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A datatype containing media that is part of a multi-part `Content` message. +// +// A `Part` consists of data which has an associated datatype. A `Part` can only +// contain one of the accepted types in `Part.data`. +// +// A `Part` must have a fixed IANA MIME type identifying the type and subtype +// of the media if `inline_data` or `file_data` field is filled with raw bytes. +message Part { + oneof data { + // Optional. Text part (can be code). + string text = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Inlined bytes data. + Blob inline_data = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. URI based data. + FileData file_data = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A predicted [FunctionCall] returned from the model that + // contains a string representing the [FunctionDeclaration.name] with the + // parameters and their values. + FunctionCall function_call = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The result output of a [FunctionCall] that contains a string + // representing the [FunctionDeclaration.name] and a structured JSON object + // containing any output from the function call. It is used as context to + // the model. + FunctionResponse function_response = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + oneof metadata { + // Optional. Video metadata. The metadata should only be specified while the + // video data is presented in inline_data or file_data. + VideoMetadata video_metadata = 4 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// Raw media bytes. +// +// Text should not be sent as raw bytes, use the 'text' field. +message Blob { + // Required. The IANA standard MIME type of the source data. + string mime_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Raw bytes for media formats. + bytes data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// URI based data. +message FileData { + // Required. The IANA standard MIME type of the source data. + string mime_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URI. + string file_uri = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata describes the input video content. +message VideoMetadata { + // Optional. The start offset of the video. + google.protobuf.Duration start_offset = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end offset of the video. + google.protobuf.Duration end_offset = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Generation config. +message GenerationConfig { + // Optional. Controls the randomness of predictions. + float temperature = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If specified, nucleus sampling will be used. + float top_p = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If specified, top-k sampling will be used. + float top_k = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of candidates to generate. + int32 candidate_count = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of output tokens to generate per message. + int32 max_output_tokens = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Stop sequences. + repeated string stop_sequences = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Logit probabilities. + int32 logprobs = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Positive penalties. + float presence_penalty = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Frequency penalties. + float frequency_penalty = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Logit bias. + map logit_bias = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Echo. + bool echo = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Safety settings. +message SafetySetting { + // Probability based thresholds levels for blocking. + enum HarmBlockThreshold { + // Unspecified harm block threshold. + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + + // Block low threshold and above (i.e. block more). + BLOCK_LOW_AND_ABOVE = 1; + + // Block medium threshold and above. + BLOCK_MEDIUM_AND_ABOVE = 2; + + // Block only high threshold (i.e. block less). + BLOCK_ONLY_HIGH = 3; + + // Block none. + BLOCK_NONE = 4; + } + + // Required. Harm category. + HarmCategory category = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The harm block threshold. + HarmBlockThreshold threshold = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Safety rating corresponding to the generated content. +message SafetyRating { + // Harm probability levels in the content. + enum HarmProbability { + // Harm probability unspecified. + HARM_PROBABILITY_UNSPECIFIED = 0; + + // Negligible level of harm. + NEGLIGIBLE = 1; + + // Low level of harm. + LOW = 2; + + // Medium level of harm. + MEDIUM = 3; + + // High level of harm. + HIGH = 4; + } + + // Output only. Harm category. + HarmCategory category = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Harm probability levels in the content. + HarmProbability probability = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether the content was filtered out because of this + // rating. + bool blocked = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A collection of source attributions for a piece of content. +message CitationMetadata { + // Output only. List of citations. + repeated Citation citations = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Source attributions for content. +message Citation { + // Output only. Start index into the content. + int32 start_index = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. End index into the content. + int32 end_index = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Url reference of the attribution. + string uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Title of the attribution. + string title = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. License of the attribution. + string license = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Publication date of the attribution. + google.type.Date publication_date = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A response candidate generated from the model. +message Candidate { + // The reason why the model stopped generating tokens. + // If empty, the model has not stopped generating the tokens. + enum FinishReason { + // The finish reason is unspecified. + FINISH_REASON_UNSPECIFIED = 0; + + // Natural stop point of the model or provided stop sequence. + STOP = 1; + + // The maximum number of tokens as specified in the request was reached. + MAX_TOKENS = 2; + + // The token generation was stopped as the response was flagged for safety + // reasons. NOTE: When streaming the Candidate.content will be empty if + // content filters blocked the output. + SAFETY = 3; + + // The token generation was stopped as the response was flagged for + // unauthorized citations. + RECITATION = 4; + + // All other reasons that stopped the token generation + OTHER = 5; + } + + // Output only. Index of the candidate. + int32 index = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Content parts of the candidate. + Content content = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reason why the model stopped generating tokens. + // If empty, the model has not stopped generating the tokens. + FinishReason finish_reason = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of ratings for the safety of a response candidate. + // + // There is at most one rating per category. + repeated SafetyRating safety_ratings = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Describes the reason the mode stopped generating tokens in + // more detail. This is only filled when `finish_reason` is set. + optional string finish_message = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Source attribution of the generated content. + CitationMetadata citation_metadata = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/encryption_spec.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/encryption_spec.proto new file mode 100644 index 000000000000..60eb8e0b7376 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/encryption_spec.proto @@ -0,0 +1,38 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "EncryptionSpecProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// Represents a customer-managed encryption key spec that can be applied to +// a top-level resource. +message EncryptionSpec { + // Required. The Cloud KMS resource identifier of the customer managed + // encryption key used to protect a resource. Has the form: + // `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. + // The key needs to be in the same region as where the compute resource is + // created. + string kms_key_name = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/endpoint.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/endpoint.proto new file mode 100644 index 000000000000..8c65c378d043 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/endpoint.proto @@ -0,0 +1,300 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/vertexai/v1beta1/encryption_spec.proto"; +import "google/cloud/vertexai/v1beta1/explanation.proto"; +import "google/cloud/vertexai/v1beta1/io.proto"; +import "google/cloud/vertexai/v1beta1/machine_resources.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "EndpointProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// Models are deployed into it, and afterwards Endpoint is called to obtain +// predictions and explanations. +message Endpoint { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Endpoint" + pattern: "projects/{project}/locations/{location}/endpoints/{endpoint}" + pattern: "projects/{project}/locations/{location}/publishers/{publisher}/models/{model}" + }; + + // Output only. The resource name of the Endpoint. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the Endpoint. + // The name can be up to 128 characters long and can consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the Endpoint. + string description = 3; + + // Output only. The models deployed in this Endpoint. + // To add or remove DeployedModels use + // [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel] + // and + // [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel] + // respectively. + repeated DeployedModel deployed_models = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A map from a DeployedModel's ID to the percentage of this Endpoint's + // traffic that should be forwarded to that DeployedModel. + // + // If a DeployedModel's ID is not listed in this map, then it receives no + // traffic. + // + // The traffic percentage values must add up to 100, or map must be empty if + // the Endpoint is to not accept any traffic at a moment. + map traffic_split = 5; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 6; + + // The labels with user-defined metadata to organize your Endpoints. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 7; + + // Output only. Timestamp when this Endpoint was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Endpoint was last updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Customer-managed encryption key spec for an Endpoint. If set, this + // Endpoint and all sub-resources of this Endpoint will be secured by + // this key. + EncryptionSpec encryption_spec = 10; + + // Optional. The full name of the Google Compute Engine + // [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) + // to which the Endpoint should be peered. + // + // Private services access must already be configured for the network. If left + // unspecified, the Endpoint is not peered with any network. + // + // Only one of the fields, + // [network][google.cloud.vertexai.v1beta1.Endpoint.network] or + // [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect], + // can be set. + // + // [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): + // `projects/{project}/global/networks/{network}`. + // Where `{project}` is a project number, as in `12345`, and `{network}` is + // network name. + string network = 13 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Deprecated: If true, expose the Endpoint via private service connect. + // + // Only one of the fields, + // [network][google.cloud.vertexai.v1beta1.Endpoint.network] or + // [enable_private_service_connect][google.cloud.vertexai.v1beta1.Endpoint.enable_private_service_connect], + // can be set. + bool enable_private_service_connect = 17 [deprecated = true]; + + // Output only. Resource name of the Model Monitoring job associated with this + // Endpoint if monitoring is enabled by + // [JobService.CreateModelDeploymentMonitoringJob][google.cloud.vertexai.v1beta1.JobService.CreateModelDeploymentMonitoringJob]. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string model_deployment_monitoring_job = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; + + // Configures the request-response logging for online prediction. + PredictRequestResponseLoggingConfig predict_request_response_logging_config = + 18; +} + +// A deployment of a Model. Endpoints contain one or more DeployedModels. +message DeployedModel { + // The prediction (for example, the machine) resources that the DeployedModel + // uses. The user is billed for the resources (at least their minimal amount) + // even if the DeployedModel receives no traffic. + // Not all Models support all resources types. See + // [Model.supported_deployment_resources_types][google.cloud.vertexai.v1beta1.Model.supported_deployment_resources_types]. + // Required except for Large Model Deploy use cases. + oneof prediction_resources { + // A description of resources that are dedicated to the DeployedModel, and + // that need a higher degree of manual configuration. + DedicatedResources dedicated_resources = 7; + + // A description of resources that to large degree are decided by Vertex + // AI, and require only a modest additional configuration. + AutomaticResources automatic_resources = 8; + + // The resource name of the shared DeploymentResourcePool to deploy on. + // Format: + // `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + string shared_resources = 17 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DeploymentResourcePool" + }]; + } + + // Immutable. The ID of the DeployedModel. If not provided upon deployment, + // Vertex AI will generate a value for this ID. + // + // This value should be 1-10 characters, and valid characters are `/[0-9]/`. + string id = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The resource name of the Model that this is the deployment of. + // Note that the Model may be in a different location than the DeployedModel's + // Endpoint. + // + // The resource name may contain version id or version alias to specify the + // version. + // Example: `projects/{project}/locations/{location}/models/{model}@2` + // or + // `projects/{project}/locations/{location}/models/{model}@golden` + // if no version is specified, the default version will be deployed. + string model = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Output only. The version ID of the model that is deployed. + string model_version_id = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The display name of the DeployedModel. If not provided upon creation, + // the Model's display_name is used. + string display_name = 3; + + // Output only. Timestamp when the DeployedModel was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Explanation configuration for this DeployedModel. + // + // When deploying a Model using + // [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel], + // this value overrides the value of + // [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec]. + // All fields of + // [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] + // are optional in the request. If a field of + // [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] + // is not populated, the value of the same field of + // [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec] + // is inherited. If the corresponding + // [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec] + // is not populated, all fields of the + // [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] + // will be used for the explanation configuration. + ExplanationSpec explanation_spec = 9; + + // If true, deploy the model without explainable feature, regardless the + // existence of + // [Model.explanation_spec][google.cloud.vertexai.v1beta1.Model.explanation_spec] + // or + // [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec]. + bool disable_explanations = 19; + + // The service account that the DeployedModel's container runs as. Specify the + // email address of the service account. If this service account is not + // specified, the container runs as a service account that doesn't have access + // to the resource project. + // + // Users deploying the Model must have the `iam.serviceAccounts.actAs` + // permission on this service account. + string service_account = 11; + + // If true, the container of the DeployedModel instances will send `stderr` + // and `stdout` streams to Cloud Logging. + // + // Only supported for custom-trained Models and AutoML Tabular Models. + bool enable_container_logging = 12; + + // If true, online prediction access logs are sent to Cloud + // Logging. + // These logs are like standard server access logs, containing + // information like timestamp and latency for each prediction request. + // + // Note that logs may incur a cost, especially if your project + // receives prediction requests at a high queries per second rate (QPS). + // Estimate your costs before enabling this option. + bool enable_access_logging = 13; + + // Output only. Provide paths for users to send predict/explain/health + // requests directly to the deployed model services running on Cloud via + // private services access. This field is populated if + // [network][google.cloud.vertexai.v1beta1.Endpoint.network] is configured. + PrivateEndpoints private_endpoints = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// PrivateEndpoints proto is used to provide paths for users to send +// requests privately. +// To send request via private service access, use predict_http_uri, +// explain_http_uri or health_http_uri. To send request via private service +// connect, use service_attachment. +message PrivateEndpoints { + // Output only. Http(s) path to send prediction requests. + string predict_http_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Http(s) path to send explain requests. + string explain_http_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Http(s) path to send health check requests. + string health_http_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the service attachment resource. Populated if + // private service connect is enabled. + string service_attachment = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for logging request-response to a BigQuery table. +message PredictRequestResponseLoggingConfig { + // If logging is enabled or not. + bool enabled = 1; + + // Percentage of requests to be logged, expressed as a fraction in + // range(0,1]. + double sampling_rate = 2; + + // BigQuery table for logging. + // If only given a project, a new dataset will be created with name + // `logging__` where + // will be made BigQuery-dataset-name compatible (e.g. + // most special characters will become underscores). If no table name is + // given, a new table will be created with name `request_response_logging` + BigQueryDestination bigquery_destination = 3; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/endpoint_service.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/endpoint_service.proto new file mode 100644 index 000000000000..1b27002f32a5 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/endpoint_service.proto @@ -0,0 +1,415 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/vertexai/v1beta1/endpoint.proto"; +import "google/cloud/vertexai/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "EndpointServiceProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// A service for managing Vertex AI's Endpoints. +service EndpointService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates an Endpoint. + rpc CreateEndpoint(CreateEndpointRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/endpoints" + body: "endpoint" + }; + option (google.api.method_signature) = "parent,endpoint"; + option (google.api.method_signature) = "parent,endpoint,endpoint_id"; + option (google.longrunning.operation_info) = { + response_type: "Endpoint" + metadata_type: "CreateEndpointOperationMetadata" + }; + } + + // Gets an Endpoint. + rpc GetEndpoint(GetEndpointRequest) returns (Endpoint) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/endpoints/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Endpoints in a Location. + rpc ListEndpoints(ListEndpointsRequest) returns (ListEndpointsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/endpoints" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an Endpoint. + rpc UpdateEndpoint(UpdateEndpointRequest) returns (Endpoint) { + option (google.api.http) = { + patch: "/v1beta1/{endpoint.name=projects/*/locations/*/endpoints/*}" + body: "endpoint" + }; + option (google.api.method_signature) = "endpoint,update_mask"; + } + + // Deletes an Endpoint. + rpc DeleteEndpoint(DeleteEndpointRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/endpoints/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Deploys a Model into this Endpoint, creating a DeployedModel within it. + rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:deployModel" + body: "*" + }; + option (google.api.method_signature) = + "endpoint,deployed_model,traffic_split"; + option (google.longrunning.operation_info) = { + response_type: "DeployModelResponse" + metadata_type: "DeployModelOperationMetadata" + }; + } + + // Undeploys a Model from an Endpoint, removing a DeployedModel from it, and + // freeing all resources it's using. + rpc UndeployModel(UndeployModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:undeployModel" + body: "*" + }; + option (google.api.method_signature) = + "endpoint,deployed_model_id,traffic_split"; + option (google.longrunning.operation_info) = { + response_type: "UndeployModelResponse" + metadata_type: "UndeployModelOperationMetadata" + }; + } + + // 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). + rpc MutateDeployedModel(MutateDeployedModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel" + body: "*" + }; + option (google.api.method_signature) = + "endpoint,deployed_model,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MutateDeployedModelResponse" + metadata_type: "MutateDeployedModelOperationMetadata" + }; + } +} + +// Request message for +// [EndpointService.CreateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.CreateEndpoint]. +message CreateEndpointRequest { + // Required. The resource name of the Location to create the Endpoint in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The Endpoint to create. + Endpoint endpoint = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string endpoint_id = 4 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Runtime operation information for +// [EndpointService.CreateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.CreateEndpoint]. +message CreateEndpointOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for +// [EndpointService.GetEndpoint][google.cloud.vertexai.v1beta1.EndpointService.GetEndpoint] +message GetEndpointRequest { + // Required. The name of the Endpoint resource. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; +} + +// Request message for +// [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]. +message ListEndpointsRequest { + // Required. The resource name of the Location from which to list the + // Endpoints. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. An expression for filtering the results of the request. For field + // names both snake_case and camelCase are supported. + // + // * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, + // i.e. the last segment of the Endpoint's [resource + // name][google.cloud.vertexai.v1beta1.Endpoint.name]. + // * `display_name` supports = and, != + // * `labels` supports general map functions that is: + // * `labels.key=value` - key:value equality + // * `labels.key:* or labels:key - key existence + // * A key including a space must be quoted. `labels."a key"`. + // + // Some examples: + // * `endpoint=1` + // * `displayName="myDisplayName"` + // * `labels.myKey="myValue"` + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [ListEndpointsResponse.next_page_token][google.cloud.vertexai.v1beta1.ListEndpointsResponse.next_page_token] + // of the previous + // [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints] + // call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [EndpointService.ListEndpoints][google.cloud.vertexai.v1beta1.EndpointService.ListEndpoints]. +message ListEndpointsResponse { + // List of Endpoints in the requested page. + repeated Endpoint endpoints = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListEndpointsRequest.page_token][google.cloud.vertexai.v1beta1.ListEndpointsRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// Request message for +// [EndpointService.UpdateEndpoint][google.cloud.vertexai.v1beta1.EndpointService.UpdateEndpoint]. +message UpdateEndpointRequest { + // Required. The Endpoint which replaces the resource on the server. + Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. See + // [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [EndpointService.DeleteEndpoint][google.cloud.vertexai.v1beta1.EndpointService.DeleteEndpoint]. +message DeleteEndpointRequest { + // Required. The name of the Endpoint resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; +} + +// Request message for +// [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]. +message DeployModelRequest { + // Required. The name of the Endpoint resource into which to deploy a Model. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // 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]. + DeployedModel deployed_model = 2 [(google.api.field_behavior) = REQUIRED]; + + // A map from a DeployedModel's ID to the percentage of this Endpoint's + // traffic that should be forwarded to that DeployedModel. + // + // 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. + map traffic_split = 3; +} + +// Response message for +// [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]. +message DeployModelResponse { + // The DeployedModel that had been deployed in the Endpoint. + DeployedModel deployed_model = 1; +} + +// Runtime operation information for +// [EndpointService.DeployModel][google.cloud.vertexai.v1beta1.EndpointService.DeployModel]. +message DeployModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for +// [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]. +message UndeployModelRequest { + // Required. The name of the Endpoint resource from which to undeploy a Model. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The ID of the DeployedModel to be undeployed from the Endpoint. + string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + map traffic_split = 3; +} + +// Response message for +// [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]. +message UndeployModelResponse {} + +// Runtime operation information for +// [EndpointService.UndeployModel][google.cloud.vertexai.v1beta1.EndpointService.UndeployModel]. +message UndeployModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for +// [EndpointService.MutateDeployedModel][google.cloud.vertexai.v1beta1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelRequest { + // Required. The name of the Endpoint resource into which to mutate a + // DeployedModel. Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The DeployedModel to be mutated within the Endpoint. Only the + // following fields can be mutated: + // + // * `min_replica_count` in either + // [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or + // [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources] + // * `max_replica_count` in either + // [DedicatedResources][google.cloud.vertexai.v1beta1.DedicatedResources] or + // [AutomaticResources][google.cloud.vertexai.v1beta1.AutomaticResources] + // * [autoscaling_metric_specs][google.cloud.vertexai.v1beta1.DedicatedResources.autoscaling_metric_specs] + // * `disable_container_logging` (v1 only) + // * `enable_container_logging` (v1beta1 only) + DeployedModel deployed_model = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. See + // [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [EndpointService.MutateDeployedModel][google.cloud.vertexai.v1beta1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelResponse { + // The DeployedModel that's being mutated. + DeployedModel deployed_model = 1; +} + +// Runtime operation information for +// [EndpointService.MutateDeployedModel][google.cloud.vertexai.v1beta1.EndpointService.MutateDeployedModel]. +message MutateDeployedModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/explanation.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/explanation.proto new file mode 100644 index 000000000000..2eec393f9d83 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/explanation.proto @@ -0,0 +1,593 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/vertexai/v1beta1/explanation_metadata.proto"; +import "google/cloud/vertexai/v1beta1/io.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "ExplanationProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// Explanation of a prediction (provided in +// [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions]) +// produced by the Model on a given +// [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]. +message Explanation { + // Output only. Feature attributions grouped by predicted outputs. + // + // For Models that predict only one output, such as regression Models that + // predict only one score, there is only one attibution that explains the + // predicted output. For Models that predict multiple outputs, such as + // multiclass Models that predict multiple classes, each element explains one + // specific item. + // [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index] + // can be used to identify which output this attribution is explaining. + // + // If users set + // [ExplanationParameters.top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k], + // the attributions are sorted by + // [instance_output_value][Attributions.instance_output_value] in descending + // order. If + // [ExplanationParameters.output_indices][google.cloud.vertexai.v1beta1.ExplanationParameters.output_indices] + // is specified, the attributions are stored by + // [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index] + // in the same order as they appear in the output_indices. + repeated Attribution attributions = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of the nearest neighbors for example-based explanations. + // + // For models deployed with the examples explanations feature enabled, the + // attributions field is empty and instead the neighbors field is populated. + repeated Neighbor neighbors = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Aggregated explanation metrics for a Model over a set of instances. +message ModelExplanation { + // Output only. Aggregated attributions explaining the Model's prediction + // outputs over the set of instances. The attributions are grouped by outputs. + // + // For Models that predict only one output, such as regression Models that + // predict only one score, there is only one attibution that explains the + // predicted output. For Models that predict multiple outputs, such as + // multiclass Models that predict multiple classes, each element explains one + // specific item. + // [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index] + // can be used to identify which output this attribution is explaining. + // + // The + // [baselineOutputValue][google.cloud.vertexai.v1beta1.Attribution.baseline_output_value], + // [instanceOutputValue][google.cloud.vertexai.v1beta1.Attribution.instance_output_value] + // and + // [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions] + // fields are averaged over the test data. + // + // NOTE: Currently AutoML tabular classification Models produce only one + // attribution, which averages attributions over all the classes it predicts. + // [Attribution.approximation_error][google.cloud.vertexai.v1beta1.Attribution.approximation_error] + // is not populated. + repeated Attribution mean_attributions = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Attribution that explains a particular prediction output. +message Attribution { + // Output only. Model predicted output if the input instance is constructed + // from the baselines of all the features defined in + // [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs]. + // The field name of the output is determined by the key in + // [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs]. + // + // If the Model's predicted output has multiple dimensions (rank > 1), this is + // the value in the output located by + // [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]. + // + // If there are multiple baselines, their output values are averaged. + double baseline_output_value = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Model predicted output on the corresponding [explanation + // instance][ExplainRequest.instances]. The field name of the output is + // determined by the key in + // [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs]. + // + // If the Model predicted output has multiple dimensions, this is the value in + // the output located by + // [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]. + double instance_output_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Attributions of each explained feature. Features are extracted + // from the [prediction + // instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] + // according to [explanation metadata for + // inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs]. + // + // The value is a struct, whose keys are the name of the feature. The values + // are how much the feature in the + // [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances] + // contributed to the predicted result. + // + // The format of the value is determined by the feature's input format: + // + // * If the feature is a scalar value, the attribution value is a + // [floating number][google.protobuf.Value.number_value]. + // + // * If the feature is an array of scalar values, the attribution value is + // an [array][google.protobuf.Value.list_value]. + // + // * If the feature is a struct, the attribution value is a + // [struct][google.protobuf.Value.struct_value]. The keys in the + // attribution value struct are the same as the keys in the feature + // struct. The formats of the values in the attribution struct are + // determined by the formats of the values in the feature struct. + // + // The + // [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.vertexai.v1beta1.ExplanationMetadata.feature_attributions_schema_uri] + // field, pointed to by the + // [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] field of + // the + // [Endpoint.deployed_models][google.cloud.vertexai.v1beta1.Endpoint.deployed_models] + // object, points to the schema file that describes the features and their + // attribution values (if it is populated). + google.protobuf.Value feature_attributions = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The index that locates the explained prediction output. + // + // If the prediction output is a scalar value, output_index is not populated. + // If the prediction output has multiple dimensions, the length of the + // output_index list is the same as the number of dimensions of the output. + // The i-th element in output_index is the element index of the i-th dimension + // of the output vector. Indices start from 0. + repeated int32 output_index = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The display name of the output identified by + // [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]. + // For example, the predicted class name by a multi-classification Model. + // + // This field is only populated iff the Model predicts display names as a + // separate field along with the explained output. The predicted display name + // must has the same shape of the explained output, and can be located using + // output_index. + string output_display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error of + // [feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions] + // caused by approximation used in the explanation method. Lower value means + // more precise attributions. + // + // * For Sampled Shapley + // [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.sampled_shapley_attribution], + // increasing + // [path_count][google.cloud.vertexai.v1beta1.SampledShapleyAttribution.path_count] + // might reduce the error. + // * For Integrated Gradients + // [attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution], + // increasing + // [step_count][google.cloud.vertexai.v1beta1.IntegratedGradientsAttribution.step_count] + // might reduce the error. + // * For [XRAI + // attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution], + // increasing + // [step_count][google.cloud.vertexai.v1beta1.XraiAttribution.step_count] + // might reduce the error. + // + // See [this introduction](/vertex-ai/docs/explainable-ai/overview) + // for more information. + double approximation_error = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the explain output. Specified as the key in + // [ExplanationMetadata.outputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.outputs]. + string output_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Neighbors for example-based explanations. +message Neighbor { + // Output only. The neighbor id. + string neighbor_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The neighbor distance. + double neighbor_distance = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specification of Model explanation. +message ExplanationSpec { + // Required. Parameters that configure explaining of the Model's predictions. + ExplanationParameters parameters = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Metadata describing the Model's input and output for explanation. + ExplanationMetadata metadata = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Parameters to configure explaining for Model's predictions. +message ExplanationParameters { + oneof method { + // An attribution method that approximates Shapley values for features that + // contribute to the label being predicted. A sampling strategy is used to + // approximate the value rather than considering all subsets of features. + // Refer to this paper for model details: https://arxiv.org/abs/1306.4265. + SampledShapleyAttribution sampled_shapley_attribution = 1; + + // An attribution method that computes Aumann-Shapley values taking + // advantage of the model's fully differentiable structure. Refer to this + // paper for more details: https://arxiv.org/abs/1703.01365 + IntegratedGradientsAttribution integrated_gradients_attribution = 2; + + // An attribution method that redistributes Integrated Gradients + // attribution to segmented regions, taking advantage of the model's fully + // differentiable structure. Refer to this paper for + // more details: https://arxiv.org/abs/1906.02825 + // + // XRAI currently performs better on natural images, like a picture of a + // house or an animal. If the images are taken in artificial environments, + // like a lab or manufacturing line, or from diagnostic equipment, like + // x-rays or quality-control cameras, use Integrated Gradients instead. + XraiAttribution xrai_attribution = 3; + + // Example-based explanations that returns the nearest neighbors from the + // provided dataset. + Examples examples = 7; + } + + // If populated, returns attributions for top K indices of outputs + // (defaults to 1). Only applies to Models that predicts more than one outputs + // (e,g, multi-class Models). When set to -1, returns explanations for all + // outputs. + int32 top_k = 4; + + // If populated, only returns attributions that have + // [output_index][google.cloud.vertexai.v1beta1.Attribution.output_index] + // contained in output_indices. It must be an ndarray of integers, with the + // same shape of the output it's explaining. + // + // If not populated, returns attributions for + // [top_k][google.cloud.vertexai.v1beta1.ExplanationParameters.top_k] + // indices of outputs. If neither top_k nor output_indices is populated, + // returns the argmax index of the outputs. + // + // Only applicable to Models that predict multiple outputs (e,g, multi-class + // Models that predict multiple classes). + google.protobuf.ListValue output_indices = 5; +} + +// An attribution method that approximates Shapley values for features that +// contribute to the label being predicted. A sampling strategy is used to +// approximate the value rather than considering all subsets of features. +message SampledShapleyAttribution { + // Required. The number of feature permutations to consider when approximating + // the Shapley values. + // + // Valid range of its value is [1, 50], inclusively. + int32 path_count = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// An attribution method that computes the Aumann-Shapley value taking advantage +// of the model's fully differentiable structure. Refer to this paper for +// more details: https://arxiv.org/abs/1703.01365 +message IntegratedGradientsAttribution { + // Required. The number of steps for approximating the path integral. + // A good value to start is 50 and gradually increase until the + // sum to diff property is within the desired error range. + // + // Valid range of its value is [1, 100], inclusively. + int32 step_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Config for SmoothGrad approximation of gradients. + // + // When enabled, the gradients are approximated by averaging the gradients + // from noisy samples in the vicinity of the inputs. Adding + // noise can help improve the computed gradients. Refer to this paper for more + // details: https://arxiv.org/pdf/1706.03825.pdf + SmoothGradConfig smooth_grad_config = 2; + + // Config for IG with blur baseline. + // + // When enabled, a linear path from the maximally blurred image to the input + // image is created. Using a blurred baseline instead of zero (black image) is + // motivated by the BlurIG approach explained here: + // https://arxiv.org/abs/2004.03383 + BlurBaselineConfig blur_baseline_config = 3; +} + +// An explanation method that redistributes Integrated Gradients +// attributions to segmented regions, taking advantage of the model's fully +// differentiable structure. Refer to this paper for more details: +// https://arxiv.org/abs/1906.02825 +// +// Supported only by image Models. +message XraiAttribution { + // Required. The number of steps for approximating the path integral. + // A good value to start is 50 and gradually increase until the + // sum to diff property is met within the desired error range. + // + // Valid range of its value is [1, 100], inclusively. + int32 step_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Config for SmoothGrad approximation of gradients. + // + // When enabled, the gradients are approximated by averaging the gradients + // from noisy samples in the vicinity of the inputs. Adding + // noise can help improve the computed gradients. Refer to this paper for more + // details: https://arxiv.org/pdf/1706.03825.pdf + SmoothGradConfig smooth_grad_config = 2; + + // Config for XRAI with blur baseline. + // + // When enabled, a linear path from the maximally blurred image to the input + // image is created. Using a blurred baseline instead of zero (black image) is + // motivated by the BlurIG approach explained here: + // https://arxiv.org/abs/2004.03383 + BlurBaselineConfig blur_baseline_config = 3; +} + +// Config for SmoothGrad approximation of gradients. +// +// When enabled, the gradients are approximated by averaging the gradients from +// noisy samples in the vicinity of the inputs. Adding noise can help improve +// the computed gradients. Refer to this paper for more details: +// https://arxiv.org/pdf/1706.03825.pdf +message SmoothGradConfig { + // Represents the standard deviation of the gaussian kernel + // that will be used to add noise to the interpolated inputs + // prior to computing gradients. + oneof GradientNoiseSigma { + // This is a single float value and will be used to add noise to all the + // features. Use this field when all features are normalized to have the + // same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where + // features are normalized to have 0-mean and 1-variance. Learn more about + // [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization). + // + // For best results the recommended value is about 10% - 20% of the standard + // deviation of the input feature. Refer to section 3.2 of the SmoothGrad + // paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1. + // + // If the distribution is different per feature, set + // [feature_noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.feature_noise_sigma] + // instead for each feature. + float noise_sigma = 1; + + // This is similar to + // [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma], + // but provides additional flexibility. A separate noise sigma can be + // provided for each feature, which is useful if their distributions are + // different. No noise is added to features that are not set. If this field + // is unset, + // [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma] + // will be used for all features. + FeatureNoiseSigma feature_noise_sigma = 2; + } + + // The number of gradient samples to use for + // approximation. The higher this number, the more accurate the gradient + // is, but the runtime complexity increases by this factor as well. + // Valid range of its value is [1, 50]. Defaults to 3. + int32 noisy_sample_count = 3; +} + +// Noise sigma by features. Noise sigma represents the standard deviation of the +// gaussian kernel that will be used to add noise to interpolated inputs prior +// to computing gradients. +message FeatureNoiseSigma { + // Noise sigma for a single feature. + message NoiseSigmaForFeature { + // The name of the input feature for which noise sigma is provided. The + // features are defined in + // [explanation metadata + // inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs]. + string name = 1; + + // This represents the standard deviation of the Gaussian kernel that will + // be used to add noise to the feature prior to computing gradients. Similar + // to + // [noise_sigma][google.cloud.vertexai.v1beta1.SmoothGradConfig.noise_sigma] + // but represents the noise added to the current feature. Defaults to 0.1. + float sigma = 2; + } + + // Noise sigma per feature. No noise is added to features that are not set. + repeated NoiseSigmaForFeature noise_sigma = 1; +} + +// Config for blur baseline. +// +// When enabled, a linear path from the maximally blurred image to the input +// image is created. Using a blurred baseline instead of zero (black image) is +// motivated by the BlurIG approach explained here: +// https://arxiv.org/abs/2004.03383 +message BlurBaselineConfig { + // The standard deviation of the blur kernel for the blurred baseline. The + // same blurring parameter is used for both the height and the width + // dimension. If not set, the method defaults to the zero (i.e. black for + // images) baseline. + float max_blur_sigma = 1; +} + +// Example-based explainability that returns the nearest neighbors from the +// provided dataset. +message Examples { + // The Cloud Storage input instances. + message ExampleGcsSource { + // The format of the input example instances. + enum DataFormat { + // Format unspecified, used when unset. + DATA_FORMAT_UNSPECIFIED = 0; + + // Examples are stored in JSONL files. + JSONL = 1; + } + + // The format in which instances are given, if not specified, assume it's + // JSONL format. Currently only JSONL format is supported. + DataFormat data_format = 1; + + // The Cloud Storage location for the input instances. + GcsSource gcs_source = 2; + } + + oneof source { + // The Cloud Storage input instances. + ExampleGcsSource example_gcs_source = 5; + } + + oneof config { + // The full configuration for the generated index, the semantics are the + // same as [metadata][google.cloud.vertexai.v1beta1.Index.metadata] and + // should match + // [NearestNeighborSearchConfig](https://cloud.google.com/vertex-ai/docs/explainable-ai/configuring-explanations-example-based#nearest-neighbor-search-config). + google.protobuf.Value nearest_neighbor_search_config = 2; + + // Simplified preset configuration, which automatically sets configuration + // values based on the desired query speed-precision trade-off and modality. + Presets presets = 4; + } + + // The Cloud Storage locations that contain the instances to be + // indexed for approximate nearest neighbor search. + GcsSource gcs_source = 1; + + // The number of neighbors to return when querying for examples. + int32 neighbor_count = 3; +} + +// Preset configuration for example-based explanations +message Presets { + // Preset option controlling parameters for query speed-precision trade-off + enum Query { + // More precise neighbors as a trade-off against slower response. + PRECISE = 0; + + // Faster response as a trade-off against less precise neighbors. + FAST = 1; + } + + // Preset option controlling parameters for different modalities + enum Modality { + // Should not be set. Added as a recommended best practice for enums + MODALITY_UNSPECIFIED = 0; + + // IMAGE modality + IMAGE = 1; + + // TEXT modality + TEXT = 2; + + // TABULAR modality + TABULAR = 3; + } + + // Preset option controlling parameters for speed-precision trade-off when + // querying for examples. If omitted, defaults to `PRECISE`. + optional Query query = 1; + + // The modality of the uploaded model, which automatically configures the + // distance measurement and feature normalization for the underlying example + // index and queries. If your model does not precisely fit one of these types, + // it is okay to choose the closest type. + Modality modality = 2; +} + +// The [ExplanationSpec][google.cloud.vertexai.v1beta1.ExplanationSpec] +// entries that can be overridden at [online +// explanation][google.cloud.vertexai.v1beta1.PredictionService.Explain] time. +message ExplanationSpecOverride { + // The parameters to be overridden. Note that the + // attribution method cannot be changed. If not specified, + // no parameter is overridden. + ExplanationParameters parameters = 1; + + // The metadata to be overridden. If not specified, no metadata is overridden. + ExplanationMetadataOverride metadata = 2; + + // The example-based explanations parameter overrides. + ExamplesOverride examples_override = 3; +} + +// The +// [ExplanationMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata] +// entries that can be overridden at [online +// explanation][google.cloud.vertexai.v1beta1.PredictionService.Explain] time. +message ExplanationMetadataOverride { + // The [input + // metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata] + // entries to be overridden. + message InputMetadataOverride { + // Baseline inputs for this feature. + // + // This overrides the `input_baseline` field of the + // [ExplanationMetadata.InputMetadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata] + // object of the corresponding feature's input metadata. If it's not + // specified, the original baselines are not overridden. + repeated google.protobuf.Value input_baselines = 1; + } + + // Required. Overrides the [input + // metadata][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs] of + // the features. The key is the name of the feature to be overridden. The keys + // specified here must exist in the input metadata to be overridden. If a + // feature is not specified here, the corresponding feature's input metadata + // is not overridden. + map inputs = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Overrides for example-based explanations. +message ExamplesOverride { + // Data format enum. + enum DataFormat { + // Unspecified format. Must not be used. + DATA_FORMAT_UNSPECIFIED = 0; + + // Provided data is a set of model inputs. + INSTANCES = 1; + + // Provided data is a set of embeddings. + EMBEDDINGS = 2; + } + + // The number of neighbors to return. + int32 neighbor_count = 1; + + // The number of neighbors to return that have the same crowding tag. + int32 crowding_count = 2; + + // Restrict the resulting nearest neighbors to respect these constraints. + repeated ExamplesRestrictionsNamespace restrictions = 3; + + // If true, return the embeddings instead of neighbors. + bool return_embeddings = 4; + + // The format of the data being provided with each call. + DataFormat data_format = 5; +} + +// Restrictions namespace for example-based explanations overrides. +message ExamplesRestrictionsNamespace { + // The namespace name. + string namespace_name = 1; + + // The list of allowed tags. + repeated string allow = 2; + + // The list of deny tags. + repeated string deny = 3; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/explanation_metadata.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/explanation_metadata.proto new file mode 100644 index 000000000000..a6d8d9d12b93 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/explanation_metadata.proto @@ -0,0 +1,424 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "ExplanationMetadataProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// Metadata describing the Model's input and output for explanation. +message ExplanationMetadata { + // Metadata of the input of a feature. + // + // Fields other than + // [InputMetadata.input_baselines][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.input_baselines] + // are applicable only for Models that are using Vertex AI-provided images for + // Tensorflow. + message InputMetadata { + // Domain details of the input feature value. Provides numeric information + // about the feature, such as its range (min, max). If the feature has been + // pre-processed, for example with z-scoring, then it provides information + // about how to recover the original feature. For example, if the input + // feature is an image and it has been pre-processed to obtain 0-mean and + // stddev = 1 values, then original_mean, and original_stddev refer to the + // mean and stddev of the original feature (e.g. image tensor) from which + // input feature (with mean = 0 and stddev = 1) was obtained. + message FeatureValueDomain { + // The minimum permissible value for this feature. + float min_value = 1; + + // The maximum permissible value for this feature. + float max_value = 2; + + // If this input feature has been normalized to a mean value of 0, + // the original_mean specifies the mean value of the domain prior to + // normalization. + float original_mean = 3; + + // If this input feature has been normalized to a standard deviation of + // 1.0, the original_stddev specifies the standard deviation of the domain + // prior to normalization. + float original_stddev = 4; + } + + // Visualization configurations for image explanation. + message Visualization { + // Type of the image visualization. Only applicable to + // [Integrated Gradients + // attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]. + enum Type { + // Should not be used. + TYPE_UNSPECIFIED = 0; + + // Shows which pixel contributed to the image prediction. + PIXELS = 1; + + // Shows which region contributed to the image prediction by outlining + // the region. + OUTLINES = 2; + } + + // Whether to only highlight pixels with positive contributions, negative + // or both. Defaults to POSITIVE. + enum Polarity { + // Default value. This is the same as POSITIVE. + POLARITY_UNSPECIFIED = 0; + + // Highlights the pixels/outlines that were most influential to the + // model's prediction. + POSITIVE = 1; + + // Setting polarity to negative highlights areas that does not lead to + // the models's current prediction. + NEGATIVE = 2; + + // Shows both positive and negative attributions. + BOTH = 3; + } + + // The color scheme used for highlighting areas. + enum ColorMap { + // Should not be used. + COLOR_MAP_UNSPECIFIED = 0; + + // Positive: green. Negative: pink. + PINK_GREEN = 1; + + // Viridis color map: A perceptually uniform color mapping which is + // easier to see by those with colorblindness and progresses from yellow + // to green to blue. Positive: yellow. Negative: blue. + VIRIDIS = 2; + + // Positive: red. Negative: red. + RED = 3; + + // Positive: green. Negative: green. + GREEN = 4; + + // Positive: green. Negative: red. + RED_GREEN = 6; + + // PiYG palette. + PINK_WHITE_GREEN = 5; + } + + // How the original image is displayed in the visualization. + enum OverlayType { + // Default value. This is the same as NONE. + OVERLAY_TYPE_UNSPECIFIED = 0; + + // No overlay. + NONE = 1; + + // The attributions are shown on top of the original image. + ORIGINAL = 2; + + // The attributions are shown on top of grayscaled version of the + // original image. + GRAYSCALE = 3; + + // The attributions are used as a mask to reveal predictive parts of + // the image and hide the un-predictive parts. + MASK_BLACK = 4; + } + + // Type of the image visualization. Only applicable to + // [Integrated Gradients + // attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution]. + // OUTLINES shows regions of attribution, while PIXELS shows per-pixel + // attribution. Defaults to OUTLINES. + Type type = 1; + + // Whether to only highlight pixels with positive contributions, negative + // or both. Defaults to POSITIVE. + Polarity polarity = 2; + + // The color scheme used for the highlighted areas. + // + // Defaults to PINK_GREEN for + // [Integrated Gradients + // attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution], + // which shows positive attributions in green and negative in pink. + // + // Defaults to VIRIDIS for + // [XRAI + // attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution], + // which highlights the most influential regions in yellow and the least + // influential in blue. + ColorMap color_map = 3; + + // Excludes attributions above the specified percentile from the + // highlighted areas. Using the clip_percent_upperbound and + // clip_percent_lowerbound together can be useful for filtering out noise + // and making it easier to see areas of strong attribution. Defaults to + // 99.9. + float clip_percent_upperbound = 4; + + // Excludes attributions below the specified percentile, from the + // highlighted areas. Defaults to 62. + float clip_percent_lowerbound = 5; + + // How the original image is displayed in the visualization. + // Adjusting the overlay can help increase visual clarity if the original + // image makes it difficult to view the visualization. Defaults to NONE. + OverlayType overlay_type = 6; + } + + // Defines how a feature is encoded. Defaults to IDENTITY. + enum Encoding { + // Default value. This is the same as IDENTITY. + ENCODING_UNSPECIFIED = 0; + + // The tensor represents one feature. + IDENTITY = 1; + + // The tensor represents a bag of features where each index maps to + // a feature. + // [InputMetadata.index_feature_mapping][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping] + // must be provided for this encoding. For example: + // ``` + // input = [27, 6.0, 150] + // index_feature_mapping = ["age", "height", "weight"] + // ``` + BAG_OF_FEATURES = 2; + + // The tensor represents a bag of features where each index maps to a + // feature. Zero values in the tensor indicates feature being + // non-existent. + // [InputMetadata.index_feature_mapping][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping] + // must be provided for this encoding. For example: + // ``` + // input = [2, 0, 5, 0, 1] + // index_feature_mapping = ["a", "b", "c", "d", "e"] + // ``` + BAG_OF_FEATURES_SPARSE = 3; + + // The tensor is a list of binaries representing whether a feature exists + // or not (1 indicates existence). + // [InputMetadata.index_feature_mapping][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping] + // must be provided for this encoding. For example: + // ``` + // input = [1, 0, 1, 0, 1] + // index_feature_mapping = ["a", "b", "c", "d", "e"] + // ``` + INDICATOR = 4; + + // The tensor is encoded into a 1-dimensional array represented by an + // encoded tensor. + // [InputMetadata.encoded_tensor_name][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoded_tensor_name] + // must be provided for this encoding. For example: + // ``` + // input = ["This", "is", "a", "test", "."] + // encoded = [0.1, 0.2, 0.3, 0.4, 0.5] + // ``` + COMBINED_EMBEDDING = 5; + + // Select this encoding when the input tensor is encoded into a + // 2-dimensional array represented by an encoded tensor. + // [InputMetadata.encoded_tensor_name][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoded_tensor_name] + // must be provided for this encoding. The first dimension of the encoded + // tensor's shape is the same as the input tensor's shape. For example: + // ``` + // input = ["This", "is", "a", "test", "."] + // encoded = [[0.1, 0.2, 0.3, 0.4, 0.5], + // [0.2, 0.1, 0.4, 0.3, 0.5], + // [0.5, 0.1, 0.3, 0.5, 0.4], + // [0.5, 0.3, 0.1, 0.2, 0.4], + // [0.4, 0.3, 0.2, 0.5, 0.1]] + // ``` + CONCAT_EMBEDDING = 6; + } + + // Baseline inputs for this feature. + // + // If no baseline is specified, Vertex AI chooses the baseline for this + // feature. If multiple baselines are specified, Vertex AI returns the + // average attributions across them in + // [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]. + // + // For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape + // of each baseline must match the shape of the input tensor. If a scalar is + // provided, we broadcast to the same shape as the input tensor. + // + // For custom images, the element of the baselines must be in the same + // format as the feature's input in the + // [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances][]. + // 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]. + repeated google.protobuf.Value input_baselines = 1; + + // Name of the input tensor for this feature. Required and is only + // applicable to Vertex AI-provided images for Tensorflow. + string input_tensor_name = 2; + + // Defines how the feature is encoded into the input tensor. Defaults to + // IDENTITY. + Encoding encoding = 3; + + // Modality of the feature. Valid values are: numeric, image. Defaults to + // numeric. + string modality = 4; + + // The domain details of the input feature value. Like min/max, original + // mean or standard deviation if normalized. + FeatureValueDomain feature_value_domain = 5; + + // Specifies the index of the values of the input tensor. + // Required when the input tensor is a sparse representation. Refer to + // Tensorflow documentation for more details: + // https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. + string indices_tensor_name = 6; + + // Specifies the shape of the values of the input if the input is a sparse + // representation. Refer to Tensorflow documentation for more details: + // https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. + string dense_shape_tensor_name = 7; + + // A list of feature names for each index in the input tensor. + // Required when the input + // [InputMetadata.encoding][google.cloud.vertexai.v1beta1.ExplanationMetadata.InputMetadata.encoding] + // is BAG_OF_FEATURES, BAG_OF_FEATURES_SPARSE, INDICATOR. + repeated string index_feature_mapping = 8; + + // Encoded tensor is a transformation of the input tensor. Must be provided + // if choosing + // [Integrated Gradients + // attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.integrated_gradients_attribution] + // or [XRAI + // attribution][google.cloud.vertexai.v1beta1.ExplanationParameters.xrai_attribution] + // and the input tensor is not differentiable. + // + // An encoded tensor is generated if the input tensor is encoded by a lookup + // table. + string encoded_tensor_name = 9; + + // A list of baselines for the encoded tensor. + // + // The shape of each baseline should match the shape of the encoded tensor. + // If a scalar is provided, Vertex AI broadcasts to the same shape as the + // encoded tensor. + repeated google.protobuf.Value encoded_baselines = 10; + + // Visualization configurations for image explanation. + Visualization visualization = 11; + + // Name of the group that the input belongs to. Features with the same group + // name will be treated as one feature when computing attributions. Features + // grouped together can have different shapes in value. If provided, there + // will be one single attribution generated in + // [Attribution.feature_attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions], + // keyed by the group name. + string group_name = 12; + } + + // Metadata of the prediction output to be explained. + message OutputMetadata { + // Defines how to map + // [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index] + // to + // [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name]. + // + // If neither of the fields are specified, + // [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name] + // will not be populated. + oneof display_name_mapping { + // Static mapping between the index and display name. + // + // Use this if the outputs are a deterministic n-dimensional array, e.g. a + // list of scores of all the classes in a pre-defined order for a + // multi-classification Model. It's not feasible if the outputs are + // non-deterministic, e.g. the Model produces top-k classes or sort the + // outputs by their values. + // + // The shape of the value must be an n-dimensional array of strings. The + // number of dimensions must match that of the outputs to be explained. + // The + // [Attribution.output_display_name][google.cloud.vertexai.v1beta1.Attribution.output_display_name] + // is populated by locating in the mapping with + // [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index]. + google.protobuf.Value index_display_name_mapping = 1; + + // Specify a field name in the prediction to look for the display name. + // + // Use this if the prediction contains the display names for the outputs. + // + // The display names in the prediction must have the same shape of the + // outputs, so that it can be located by + // [Attribution.output_index][google.cloud.vertexai.v1beta1.Attribution.output_index] + // for a specific output. + string display_name_mapping_key = 2; + } + + // Name of the output tensor. Required and is only applicable to Vertex + // AI provided images for Tensorflow. + string output_tensor_name = 3; + } + + // Required. Map from feature names to feature input metadata. Keys are the + // name of the features. Values are the specification of the feature. + // + // An empty InputMetadata is valid. It describes a text feature which has the + // name specified as the key in + // [ExplanationMetadata.inputs][google.cloud.vertexai.v1beta1.ExplanationMetadata.inputs]. + // The baseline of the empty feature is chosen by Vertex AI. + // + // For Vertex AI-provided Tensorflow images, the key can be any friendly + // name of the feature. Once specified, + // [featureAttributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions] + // are keyed by this key (if not grouped with another feature). + // + // For custom images, the key must match with the key in + // [instance][google.cloud.vertexai.v1beta1.ExplainRequest.instances]. + map inputs = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Map from output names to output metadata. + // + // For Vertex AI-provided Tensorflow images, keys can be any user defined + // string that consists of any UTF-8 characters. + // + // For custom images, keys are the name of the output field in the prediction + // to be explained. + // + // Currently only one key is allowed. + map outputs = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Points to a YAML file stored on Google Cloud Storage describing the format + // of the [feature + // attributions][google.cloud.vertexai.v1beta1.Attribution.feature_attributions]. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML tabular Models always have this field populated by Vertex AI. + // Note: The URI given on output may be different, including the URI scheme, + // than the one given on input. The output URI will point to a location where + // the user only has a read access. + string feature_attributions_schema_uri = 3; + + // Name of the source to generate embeddings for example based explanations. + string latent_space_source = 5; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/io.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/io.proto new file mode 100644 index 000000000000..9c9348fe3a4a --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/io.proto @@ -0,0 +1,109 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "IoProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// The storage details for Avro input content. +message AvroSource { + // Required. Google Cloud Storage location. + GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The storage details for CSV input content. +message CsvSource { + // Required. Google Cloud Storage location. + GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location for the input content. +message GcsSource { + // Required. Google Cloud Storage URI(-s) to the input file(s). May contain + // wildcards. For more information on wildcards, see + // https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames. + repeated string uris = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location where the output is to be written to. +message GcsDestination { + // Required. Google Cloud Storage URI to output directory. If the uri doesn't + // end with + // '/', a '/' will be automatically appended. The directory is created if it + // doesn't exist. + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The BigQuery location for the input content. +message BigQuerySource { + // Required. BigQuery URI to a table, up to 2000 characters long. + // Accepted forms: + // + // * BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`. + string input_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The BigQuery location for the output content. +message BigQueryDestination { + // Required. BigQuery URI to a project or table, up to 2000 characters long. + // + // When only the project is specified, the Dataset and Table is created. + // When the full table reference is specified, the Dataset must exist and + // table must not exist. + // + // Accepted forms: + // + // * BigQuery path. For example: + // `bq://projectId` or `bq://projectId.bqDatasetId` or + // `bq://projectId.bqDatasetId.bqTableId`. + string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The storage details for CSV output content. +message CsvDestination { + // Required. Google Cloud Storage location. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The storage details for TFRecord output content. +message TFRecordDestination { + // Required. Google Cloud Storage location. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Container Registry location for the container image. +message ContainerRegistryDestination { + // Required. Container Registry URI of a container image. + // Only Google Container Registry and Artifact Registry are supported now. + // Accepted forms: + // + // * Google Container Registry path. For example: + // `gcr.io/projectId/imageName:tag`. + // + // * Artifact Registry path. For example: + // `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`. + // + // If a tag is not specified, "latest" will be used as the default tag. + string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/machine_resources.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/machine_resources.proto new file mode 100644 index 000000000000..1ba3a5b8865f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/machine_resources.proto @@ -0,0 +1,234 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/vertexai/v1beta1/accelerator_type.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "MachineResourcesProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// Specification of a single machine. +message MachineSpec { + // Immutable. The type of the machine. + // + // See the [list of machine types supported for + // prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) + // + // See the [list of machine types supported for custom + // training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). + // + // For [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] this + // field is optional, and the default value is `n1-standard-2`. For + // [BatchPredictionJob][google.cloud.vertexai.v1beta1.BatchPredictionJob] or + // as part of [WorkerPoolSpec][google.cloud.vertexai.v1beta1.WorkerPoolSpec] + // this field is required. + string machine_type = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The type of accelerator(s) that may be attached to the machine + // as per + // [accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count]. + AcceleratorType accelerator_type = 2 + [(google.api.field_behavior) = IMMUTABLE]; + + // The number of accelerators to attach to the machine. + int32 accelerator_count = 3; + + // Immutable. The topology of the TPUs. Corresponds to the TPU topologies + // available from GKE. (Example: tpu_topology: "2x2x1"). + string tpu_topology = 4 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A description of resources that are dedicated to a DeployedModel, and +// that need a higher degree of manual configuration. +message DedicatedResources { + // Required. Immutable. The specification of a single machine used by the + // prediction. + MachineSpec machine_spec = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The minimum number of machine replicas this + // DeployedModel will be always deployed on. This value must be greater than + // or equal to 1. + // + // If traffic against the DeployedModel increases, it may dynamically be + // deployed onto more replicas, and as traffic decreases, some of these extra + // replicas may be freed. + int32 min_replica_count = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. The maximum number of replicas this DeployedModel may be + // deployed on when the traffic against it increases. If the requested value + // is too large, the deployment will error, but if deployment succeeds then + // the ability to scale the model to that many replicas is guaranteed (barring + // service outages). If traffic against the DeployedModel increases beyond + // what its replicas at maximum may handle, a portion of the traffic will be + // dropped. If this value is not provided, will use + // [min_replica_count][google.cloud.vertexai.v1beta1.DedicatedResources.min_replica_count] + // as the default value. + // + // The value of this field impacts the charge against Vertex CPU and GPU + // quotas. Specifically, you will be charged for (max_replica_count * + // number of cores in the selected machine type) and (max_replica_count * + // number of GPUs per replica in the selected machine type). + int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The metric specifications that overrides a resource + // utilization metric (CPU utilization, accelerator's duty cycle, and so on) + // target value (default to 60 if not set). At most one entry is allowed per + // metric. + // + // If + // [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count] + // is above 0, the autoscaling will be based on both CPU utilization and + // accelerator's duty cycle metrics and scale up when either metrics exceeds + // its target value while scale down if both metrics are under their target + // value. The default target value is 60 for both metrics. + // + // If + // [machine_spec.accelerator_count][google.cloud.vertexai.v1beta1.MachineSpec.accelerator_count] + // is 0, the autoscaling will be based on CPU utilization metric only with + // default target value 60 if not explicitly set. + // + // For example, in the case of Online Prediction, if you want to override + // target CPU utilization to 80, you should set + // [autoscaling_metric_specs.metric_name][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.metric_name] + // to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and + // [autoscaling_metric_specs.target][google.cloud.vertexai.v1beta1.AutoscalingMetricSpec.target] + // to `80`. + repeated AutoscalingMetricSpec autoscaling_metric_specs = 4 + [(google.api.field_behavior) = IMMUTABLE]; +} + +// A description of resources that to large degree are decided by Vertex AI, +// and require only a modest additional configuration. +// Each Model supporting these resources documents its specific guidelines. +message AutomaticResources { + // Immutable. The minimum number of replicas this DeployedModel will be always + // deployed on. If traffic against it increases, it may dynamically be + // deployed onto more replicas up to + // [max_replica_count][google.cloud.vertexai.v1beta1.AutomaticResources.max_replica_count], + // and as traffic decreases, some of these extra replicas may be freed. If the + // requested value is too large, the deployment will error. + int32 min_replica_count = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The maximum number of replicas this DeployedModel may be + // deployed on when the traffic against it increases. If the requested value + // is too large, the deployment will error, but if deployment succeeds then + // the ability to scale the model to that many replicas is guaranteed (barring + // service outages). If traffic against the DeployedModel increases beyond + // what its replicas at maximum may handle, a portion of the traffic will be + // dropped. If this value is not provided, a no upper bound for scaling under + // heavy traffic will be assume, though Vertex AI may be unable to scale + // beyond certain replica number. + int32 max_replica_count = 2 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A description of resources that are used for performing batch operations, are +// dedicated to a Model, and need manual configuration. +message BatchDedicatedResources { + // Required. Immutable. The specification of a single machine. + MachineSpec machine_spec = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. The number of machine replicas used at the start of the batch + // operation. If not set, Vertex AI decides starting number, not greater than + // [max_replica_count][google.cloud.vertexai.v1beta1.BatchDedicatedResources.max_replica_count] + int32 starting_replica_count = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The maximum number of machine replicas the batch operation may + // be scaled to. The default value is 10. + int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Statistics information about resource consumption. +message ResourcesConsumed { + // Output only. The number of replica hours used. Note that many replicas may + // run in parallel, and additionally any given work may be queued for some + // time. Therefore this value is not strictly related to wall time. + double replica_hours = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents the spec of disk options. +message DiskSpec { + // Type of the boot disk (default is "pd-ssd"). + // Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or + // "pd-standard" (Persistent Disk Hard Disk Drive). + string boot_disk_type = 1; + + // Size in GB of the boot disk (default is 100GB). + int32 boot_disk_size_gb = 2; +} + +// Represents the spec of [persistent +// disk][https://cloud.google.com/compute/docs/disks/persistent-disks] options. +message PersistentDiskSpec { + // Type of the disk (default is "pd-standard"). + // Valid values: "pd-ssd" (Persistent Disk Solid State Drive) + // "pd-standard" (Persistent Disk Hard Disk Drive) + // "pd-balanced" (Balanced Persistent Disk) + // "pd-extreme" (Extreme Persistent Disk) + string disk_type = 1; + + // Size in GB of the disk (default is 100GB). + int64 disk_size_gb = 2; +} + +// Represents a mount configuration for Network File System (NFS) to mount. +message NfsMount { + // Required. IP address of the NFS server. + string server = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Source path exported from NFS server. + // Has to start with '/', and combined with the ip address, it indicates + // the source mount path in the form of `server:path` + string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Destination mount path. The NFS will be mounted for the user + // under /mnt/nfs/ + string mount_point = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The metric specification that defines the target resource utilization +// (CPU utilization, accelerator's duty cycle, and so on) for calculating the +// desired replica count. +message AutoscalingMetricSpec { + // Required. The resource metric name. + // Supported metrics: + // + // * For Online Prediction: + // * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` + // * `aiplatform.googleapis.com/prediction/online/cpu/utilization` + string metric_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The target resource utilization in percentage (1% - 100%) for the given + // metric; once the real usage deviates from the target by a certain + // percentage, the machine replicas change. The default value is 60 + // (representing 60%) if not provided. + int32 target = 2; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/openapi.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/openapi.proto new file mode 100644 index 000000000000..ea8788dffebf --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/openapi.proto @@ -0,0 +1,92 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "OpenApiProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// Type contains the list of OpenAPI data types as defined by +// https://swagger.io/docs/specification/data-models/data-types/ +enum Type { + // Not specified, should not be used. + TYPE_UNSPECIFIED = 0; + + // OpenAPI string type + STRING = 1; + + // OpenAPI number type + NUMBER = 2; + + // OpenAPI integer type + INTEGER = 3; + + // OpenAPI boolean type + BOOLEAN = 4; + + // OpenAPI array type + ARRAY = 5; + + // OpenAPI object type + OBJECT = 6; +} + +// Schema is used to define the format of input/output data. Represents a select +// subset of an [OpenAPI 3.0 schema +// object](https://spec.openapis.org/oas/v3.0.3#schema). More fields may be +// added in the future as needed. +message Schema { + // Optional. The type of the data. + Type type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The format of the data. + // Supported formats: + // for NUMBER type: float, double + // for INTEGER type: int32, int64 + string format = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the data. + string description = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates if the value may be null. + bool nullable = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Schema of the elements of Type.ARRAY. + Schema items = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Possible values of the element of Type.STRING with enum format. + // For example we can define an Enum Direction as : + // {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} + repeated string enum = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Properties of Type.OBJECT. + map properties = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Required properties of Type.OBJECT. + repeated string required = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Example of the object. Will only populated when the object is the + // root. + google.protobuf.Value example = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/operation.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/operation.proto new file mode 100644 index 000000000000..9601d5cb453e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/operation.proto @@ -0,0 +1,55 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "OperationProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// Generic Metadata shared by all operations. +message GenericOperationMetadata { + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // This field should never exceed 20 entries. + // Status details field will contain standard Google Cloud error details. + repeated google.rpc.Status partial_failures = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the operation was updated for the last time. + // If the operation has finished (successfully or not), this is the finish + // time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details of operations that perform deletes of any entities. +message DeleteOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/prediction_service.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/prediction_service.proto new file mode 100644 index 000000000000..101ca01ffebf --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/prediction_service.proto @@ -0,0 +1,638 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; +import "google/api/resource.proto"; +import "google/cloud/vertexai/v1beta1/content.proto"; +import "google/cloud/vertexai/v1beta1/explanation.proto"; +import "google/cloud/vertexai/v1beta1/tool.proto"; +import "google/cloud/vertexai/v1beta1/types.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// A service for online predictions and explanations. +service PredictionService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Perform an online prediction. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:predict" + body: "*" + additional_bindings { + post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict" + body: "*" + } + }; + option (google.api.method_signature) = "endpoint,instances,parameters"; + } + + // Perform an online prediction with an arbitrary HTTP payload. + // + // The response includes the following HTTP headers: + // + // * `X-Vertex-AI-Endpoint-Id`: ID of the + // [Endpoint][google.cloud.vertexai.v1beta1.Endpoint] that served this + // prediction. + // + // * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's + // [DeployedModel][google.cloud.vertexai.v1beta1.DeployedModel] that served + // this prediction. + rpc RawPredict(RawPredictRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict" + body: "*" + additional_bindings { + post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict" + body: "*" + } + }; + option (google.api.method_signature) = "endpoint,http_body"; + } + + // Perform an unary online prediction request for Vertex first-party products + // and frameworks. + rpc DirectPredict(DirectPredictRequest) returns (DirectPredictResponse) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:directPredict" + body: "*" + }; + } + + // Perform an online prediction request through gRPC. + rpc DirectRawPredict(DirectRawPredictRequest) + returns (DirectRawPredictResponse) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:directRawPredict" + body: "*" + }; + } + + // Perform a streaming online prediction request for Vertex first-party + // products and frameworks. + rpc StreamingPredict(stream StreamingPredictRequest) + returns (stream StreamingPredictResponse) {} + + // Perform a server-side streaming online prediction request for Vertex + // LLM streaming. + rpc ServerStreamingPredict(StreamingPredictRequest) + returns (stream StreamingPredictResponse) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:serverStreamingPredict" + body: "*" + additional_bindings { + post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:serverStreamingPredict" + body: "*" + } + }; + } + + // Perform a streaming online prediction request through gRPC. + rpc StreamingRawPredict(stream StreamingRawPredictRequest) + returns (stream StreamingRawPredictResponse) {} + + // Perform an online explanation. + // + // 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. + rpc Explain(ExplainRequest) returns (ExplainResponse) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:explain" + body: "*" + }; + option (google.api.method_signature) = + "endpoint,instances,parameters,deployed_model_id"; + } + + // Perform a token counting. + rpc CountTokens(CountTokensRequest) returns (CountTokensResponse) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:countTokens" + body: "*" + additional_bindings { + post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:countTokens" + body: "*" + } + }; + option (google.api.method_signature) = "endpoint,instances"; + } + + // Generate content with multimodal inputs with streaming support. + rpc StreamGenerateContent(GenerateContentRequest) + returns (stream GenerateContentResponse) { + option (google.api.http) = { + post: "/v1beta1/{model=projects/*/locations/*/endpoints/*}:streamGenerateContent" + body: "*" + additional_bindings { + post: "/v1beta1/{model=projects/*/locations/*/publishers/*/models/*}:streamGenerateContent" + body: "*" + } + }; + option (google.api.method_signature) = "model,contents"; + } +} + +// Request message for +// [PredictionService.Predict][google.cloud.vertexai.v1beta1.PredictionService.Predict]. +message PredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // 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]. + repeated google.protobuf.Value instances = 2 + [(google.api.field_behavior) = REQUIRED]; + + // 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]. + google.protobuf.Value parameters = 3; +} + +// Response message for +// [PredictionService.Predict][google.cloud.vertexai.v1beta1.PredictionService.Predict]. +message PredictResponse { + // The predictions that are the output of the predictions call. + // The schema of any single prediction may be specified via Endpoint's + // DeployedModels' [Model's + // ][google.cloud.vertexai.v1beta1.DeployedModel.model] + // [PredictSchemata's][google.cloud.vertexai.v1beta1.Model.predict_schemata] + // [prediction_schema_uri][google.cloud.vertexai.v1beta1.PredictSchemata.prediction_schema_uri]. + repeated google.protobuf.Value predictions = 1; + + // ID of the Endpoint's DeployedModel that served this prediction. + string deployed_model_id = 2; + + // Output only. The resource name of the Model which is deployed as the + // DeployedModel that this prediction hits. + string model = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Output only. The version ID of the Model which is deployed as the + // DeployedModel that this prediction hits. + string model_version_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [display + // name][google.cloud.vertexai.v1beta1.Model.display_name] of the Model + // which is deployed as the DeployedModel that this prediction hits. + string model_display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Request-level metadata returned by the model. The metadata + // type will be dependent upon the model implementation. + google.protobuf.Value metadata = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for +// [PredictionService.RawPredict][google.cloud.vertexai.v1beta1.PredictionService.RawPredict]. +message RawPredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // The prediction input. Supports HTTP headers and arbitrary data payload. + // + // 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. + google.api.HttpBody http_body = 2; +} + +// Request message for +// [PredictionService.DirectPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectPredict]. +message DirectPredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // The prediction input. + repeated Tensor inputs = 2; + + // The parameters that govern the prediction. + Tensor parameters = 3; +} + +// Response message for +// [PredictionService.DirectPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectPredict]. +message DirectPredictResponse { + // The prediction output. + repeated Tensor outputs = 1; + + // The parameters that govern the prediction. + Tensor parameters = 2; +} + +// Request message for +// [PredictionService.DirectRawPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectRawPredict]. +message DirectRawPredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Fully qualified name of the API method being invoked to perform + // predictions. + // + // Format: + // `/namespace.Service/Method/` + // Example: + // `/tensorflow.serving.PredictionService/Predict` + string method_name = 2; + + // The prediction input. + bytes input = 3; +} + +// Response message for +// [PredictionService.DirectRawPredict][google.cloud.vertexai.v1beta1.PredictionService.DirectRawPredict]. +message DirectRawPredictResponse { + // The prediction output. + bytes output = 1; +} + +// Request message for +// [PredictionService.StreamingPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingPredict]. +// +// The first message must contain +// [endpoint][google.cloud.vertexai.v1beta1.StreamingPredictRequest.endpoint] +// field and optionally [input][]. The subsequent messages must contain +// [input][]. +message StreamingPredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // The prediction input. + repeated Tensor inputs = 2; + + // The parameters that govern the prediction. + Tensor parameters = 3; +} + +// Response message for +// [PredictionService.StreamingPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingPredict]. +message StreamingPredictResponse { + // The prediction output. + repeated Tensor outputs = 1; + + // The parameters that govern the prediction. + Tensor parameters = 2; +} + +// Request message for +// [PredictionService.StreamingRawPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingRawPredict]. +// +// The first message must contain +// [endpoint][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.endpoint] +// and +// [method_name][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.method_name] +// fields and optionally +// [input][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.input]. +// The subsequent messages must contain +// [input][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.input]. +// [method_name][google.cloud.vertexai.v1beta1.StreamingRawPredictRequest.method_name] +// in the subsequent messages have no effect. +message StreamingRawPredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Fully qualified name of the API method being invoked to perform + // predictions. + // + // Format: + // `/namespace.Service/Method/` + // Example: + // `/tensorflow.serving.PredictionService/Predict` + string method_name = 2; + + // The prediction input. + bytes input = 3; +} + +// Response message for +// [PredictionService.StreamingRawPredict][google.cloud.vertexai.v1beta1.PredictionService.StreamingRawPredict]. +message StreamingRawPredictResponse { + // The prediction output. + bytes output = 1; +} + +// Request message for +// [PredictionService.Explain][google.cloud.vertexai.v1beta1.PredictionService.Explain]. +message ExplainRequest { + // Required. The name of the Endpoint requested to serve the explanation. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // 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]. + repeated google.protobuf.Value instances = 2 + [(google.api.field_behavior) = REQUIRED]; + + // 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]. + google.protobuf.Value parameters = 4; + + // If specified, overrides the + // [explanation_spec][google.cloud.vertexai.v1beta1.DeployedModel.explanation_spec] + // of the DeployedModel. Can be used for explaining prediction results with + // different configurations, such as: + // - Explaining top-5 predictions results as opposed to top-1; + // - Increasing path count or step count of the attribution methods to reduce + // approximate errors; + // - Using different baselines for explaining the prediction results. + ExplanationSpecOverride explanation_spec_override = 5; + + // Optional. This field is the same as the one above, but supports multiple + // explanations to occur in parallel. The key can be any string. Each override + // will be run against the model, then its explanations will be grouped + // together. + // + // Note - these explanations are run **In Addition** to the default + // Explanation in the deployed model. + map concurrent_explanation_spec_override = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // If specified, this ExplainRequest will be served by the chosen + // DeployedModel, overriding + // [Endpoint.traffic_split][google.cloud.vertexai.v1beta1.Endpoint.traffic_split]. + string deployed_model_id = 3; +} + +// Response message for +// [PredictionService.Explain][google.cloud.vertexai.v1beta1.PredictionService.Explain]. +message ExplainResponse { + // This message is a wrapper grouping Concurrent Explanations. + message ConcurrentExplanation { + // The explanations of the Model's + // [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions]. + // + // It has the same number of elements as + // [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to + // be explained. + repeated Explanation explanations = 1; + } + + // The explanations of the Model's + // [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions]. + // + // It has the same number of elements as + // [instances][google.cloud.vertexai.v1beta1.ExplainRequest.instances] to be + // explained. + repeated Explanation explanations = 1; + + // This field stores the results of the explanations run in parallel with + // The default explanation strategy/method. + map concurrent_explanations = 4; + + // ID of the Endpoint's DeployedModel that served this explanation. + string deployed_model_id = 2; + + // The predictions that are the output of the predictions call. + // Same as + // [PredictResponse.predictions][google.cloud.vertexai.v1beta1.PredictResponse.predictions]. + repeated google.protobuf.Value predictions = 3; +} + +// Request message for +// [PredictionService.CountTokens][google.cloud.vertexai.v1beta1.PredictionService.CountTokens]. +message CountTokensRequest { + // Required. The name of the Endpoint requested to perform token counting. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The name of the publisher model requested to serve the + // prediction. Format: + // `projects/{project}/locations/{location}/publishers/*/models/*` + string model = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The instances that are the input to token counting call. + // Schema is identical to the prediction schema of the underlying model. + repeated google.protobuf.Value instances = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Input content. + repeated Content contents = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [PredictionService.CountTokens][google.cloud.vertexai.v1beta1.PredictionService.CountTokens]. +message CountTokensResponse { + // The total number of tokens counted across all instances from the request. + int32 total_tokens = 1; + + // The total number of billable characters counted across all instances from + // the request. + int32 total_billable_characters = 2; +} + +// Request message for [PredictionService.GenerateContent]. +message GenerateContentRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The name of the publisher model requested to serve the + // prediction. Format: + // `projects/{project}/locations/{location}/publishers/*/models/*` + string model = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The content of the current conversation with the model. + // + // For single-turn queries, this is a single instance. For multi-turn queries, + // this is a repeated field that contains conversation history + latest + // request. + repeated Content contents = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A list of `Tools` the model may use to generate the next + // response. + // + // A `Tool` is a piece of code that enables the system to interact with + // external systems to perform an action, or set of actions, outside of + // knowledge and scope of the model. The only supported tool is currently + // `Function` + repeated Tool tools = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Per request settings for blocking unsafe content. + // Enforced on GenerateContentResponse.candidates. + repeated SafetySetting safety_settings = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Generation config. + GenerationConfig generation_config = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [PredictionService.GenerateContent]. +message GenerateContentResponse { + // Content filter results for a prompt sent in the request. + message PromptFeedback { + // Blocked reason enumeration. + enum BlockedReason { + // Unspecified blocked reason. + BLOCKED_REASON_UNSPECIFIED = 0; + + // Candidates blocked due to safety. + SAFETY = 1; + + // Candidates blocked due to other reason. + OTHER = 2; + } + + // Output only. Blocked reason. + BlockedReason block_reason = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Safety ratings. + repeated SafetyRating safety_ratings = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A readable block reason message. + string block_reason_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Usage metadata about response(s). + message UsageMetadata { + // Number of tokens in the request. + int32 prompt_token_count = 1; + + // Number of tokens in the response(s). + int32 candidates_token_count = 2; + + int32 total_token_count = 3; + } + + // Output only. Generated candidates. + repeated Candidate candidates = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Content filter results for a prompt sent in the request. + // Note: Sent only in the first stream chunk. + // Only happens when no candidates were generated due to content violations. + PromptFeedback prompt_feedback = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Usage metadata about the response(s). + UsageMetadata usage_metadata = 4; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/tool.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/tool.proto new file mode 100644 index 000000000000..79b253fd6803 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/tool.proto @@ -0,0 +1,105 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/vertexai/v1beta1/openapi.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "ToolProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// Tool details that the model may use to generate response. +// +// A `Tool` is a piece of code that enables the system to interact with +// external systems to perform an action, or set of actions, outside of +// knowledge and scope of the model. +message Tool { + // Optional. One or more function declarations to be passed to the model along + // with the current user query. Model may decide to call a subset of these + // functions by populating [FunctionCall][content.part.function_call] in the + // response. User should provide a + // [FunctionResponse][content.part.function_response] for each function call + // in the next turn. Based on the function responses, Model will generate the + // final response back to the user. Maximum 64 function declarations can be + // provided. + repeated FunctionDeclaration function_declarations = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Structured representation of a function declaration as defined by the +// [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included +// in this declaration are the function name and parameters. This +// FunctionDeclaration is a representation of a block of code that can be used +// as a `Tool` by the model and executed by the client. +message FunctionDeclaration { + // Required. The name of the function to call. + // Must start with a letter or an underscore. + // Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum + // length of 64. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description and purpose of the function. + // Model uses it to decide how and whether to call the function. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the parameters to this function in JSON Schema Object + // format. Reflects the Open API 3.03 Parameter Object. string Key: the name + // of the parameter. Parameter names are case sensitive. Schema Value: the + // Schema defining the type used for the parameter. For function with no + // parameters, this can be left unset. Example with 1 required and 1 optional + // parameter: type: OBJECT properties: + // param1: + // type: STRING + // param2: + // type: INTEGER + // required: + // - param1 + google.cloud.vertexai.v1beta1.Schema parameters = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A predicted [FunctionCall] returned from the model that contains a string +// representing the [FunctionDeclaration.name] and a structured JSON object +// containing the parameters and their values. +message FunctionCall { + // Required. The name of the function to call. + // Matches [FunctionDeclaration.name]. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Required. The function parameters and values in JSON object + // format. See [FunctionDeclaration.parameters] for parameter details. + google.protobuf.Struct args = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The result output from a [FunctionCall] that contains a string representing +// the [FunctionDeclaration.name] and a structured JSON object containing any +// output from the function is used as context to the model. This should contain +// the result of a [FunctionCall] made based on model prediction. +message FunctionResponse { + // Required. The name of the function to call. + // Matches [FunctionDeclaration.name] and [FunctionCall.name]. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The function response in JSON object format. + google.protobuf.Struct response = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/types.proto b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/types.proto new file mode 100644 index 000000000000..544ff54ac85f --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1beta1/src/main/proto/google/cloud/vertexai/v1beta1/types.proto @@ -0,0 +1,136 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.vertexai.v1beta1; + +option csharp_namespace = "Google.Cloud.VertexAI.V1Beta1"; +option go_package = "cloud.google.com/go/vertexai/apiv1beta1/vertexaipb;vertexaipb"; +option java_multiple_files = true; +option java_outer_classname = "TypesProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\VertexAI\\V1beta1"; +option ruby_package = "Google::Cloud::VertexAI::V1beta1"; + +// A list of boolean values. +message BoolArray { + // A list of bool values. + repeated bool values = 1; +} + +// A list of double values. +message DoubleArray { + // A list of double values. + repeated double values = 1; +} + +// A list of int64 values. +message Int64Array { + // A list of int64 values. + repeated int64 values = 1; +} + +// A list of string values. +message StringArray { + // A list of string values. + repeated string values = 1; +} + +// A tensor value type. +message Tensor { + // Data type of the tensor. + enum DataType { + // Not a legal value for DataType. Used to indicate a DataType field has not + // been set. + DATA_TYPE_UNSPECIFIED = 0; + + // Data types that all computation devices are expected to be + // capable to support. + BOOL = 1; + + STRING = 2; + + FLOAT = 3; + + DOUBLE = 4; + + INT8 = 5; + + INT16 = 6; + + INT32 = 7; + + INT64 = 8; + + UINT8 = 9; + + UINT16 = 10; + + UINT32 = 11; + + UINT64 = 12; + } + + // The data type of tensor. + DataType dtype = 1; + + // Shape of the tensor. + repeated int64 shape = 2; + + // Type specific representations that make it easy to create tensor protos in + // all languages. Only the representation corresponding to "dtype" can + // be set. The values hold the flattened representation of the tensor in + // row major order. + // + // [BOOL][google.vertexai.master.Tensor.DataType.BOOL] + repeated bool bool_val = 3; + + // [STRING][google.vertexai.master.Tensor.DataType.STRING] + repeated string string_val = 14; + + // [STRING][google.vertexai.master.Tensor.DataType.STRING] + repeated bytes bytes_val = 15; + + // [FLOAT][google.vertexai.master.Tensor.DataType.FLOAT] + repeated float float_val = 5; + + // [DOUBLE][google.vertexai.master.Tensor.DataType.DOUBLE] + repeated double double_val = 6; + + // [INT_8][google.vertexai.master.Tensor.DataType.INT8] + // [INT_16][google.vertexai.master.Tensor.DataType.INT16] + // [INT_32][google.vertexai.master.Tensor.DataType.INT32] + repeated int32 int_val = 7; + + // [INT64][google.vertexai.master.Tensor.DataType.INT64] + repeated int64 int64_val = 8; + + // [UINT8][google.vertexai.master.Tensor.DataType.UINT8] + // [UINT16][google.vertexai.master.Tensor.DataType.UINT16] + // [UINT32][google.vertexai.master.Tensor.DataType.UINT32] + repeated uint32 uint_val = 9; + + // [UINT64][google.vertexai.master.Tensor.DataType.UINT64] + repeated uint64 uint64_val = 10; + + // A list of tensor values. + repeated Tensor list_val = 11; + + // A map of string to tensor. + map struct_val = 12; + + // Serialized raw tensor content. + bytes tensor_val = 13; +} diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/create/SyncCreateSetCredentialsProvider.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..27d27506acb4 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.EndpointServiceSettings; +import com.google.cloud.vertexai.api.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_EndpointService_Create_SetCredentialsProvider_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/create/SyncCreateSetCredentialsProvider1.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..d42e2bef3fdf --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.EndpointServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_EndpointService_Create_SetCredentialsProvider1_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/create/SyncCreateSetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..5d9803818459 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_Create_SetEndpoint_sync] +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.EndpointServiceSettings; +import com.google.cloud.vertexai.api.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_EndpointService_Create_SetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/AsyncCreateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/AsyncCreateEndpoint.java new file mode 100644 index 000000000000..77095fef20bc --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/AsyncCreateEndpoint.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.CreateEndpointRequest; +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateEndpoint { + + public static void main(String[] args) throws Exception { + asyncCreateEndpoint(); + } + + public static void asyncCreateEndpoint() throws Exception { + // 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 future = + endpointServiceClient.createEndpointCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/AsyncCreateEndpointLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/AsyncCreateEndpointLRO.java new file mode 100644 index 000000000000..99a94e87a40b --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/AsyncCreateEndpointLRO.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.api.CreateEndpointOperationMetadata; +import com.google.cloud.vertexai.api.CreateEndpointRequest; +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.LocationName; + +public class AsyncCreateEndpointLRO { + + public static void main(String[] args) throws Exception { + asyncCreateEndpointLRO(); + } + + public static void asyncCreateEndpointLRO() throws Exception { + // 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 future = + endpointServiceClient.createEndpointOperationCallable().futureCall(request); + // Do something. + Endpoint response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpoint.java new file mode 100644 index 000000000000..257c05656f07 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpoint.java @@ -0,0 +1,48 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_sync] +import com.google.cloud.vertexai.api.CreateEndpointRequest; +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.LocationName; + +public class SyncCreateEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateEndpoint(); + } + + public static void syncCreateEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpoint.java new file mode 100644 index 000000000000..f6a5311e189b --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpoint.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LocationnameEndpoint_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.LocationName; + +public class SyncCreateEndpointLocationnameEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateEndpointLocationnameEndpoint(); + } + + public static void syncCreateEndpointLocationnameEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LocationnameEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpointString.java new file mode 100644 index 000000000000..6c9c167bf193 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpointString.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LocationnameEndpointString_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.LocationName; + +public class SyncCreateEndpointLocationnameEndpointString { + + public static void main(String[] args) throws Exception { + syncCreateEndpointLocationnameEndpointString(); + } + + public static void syncCreateEndpointLocationnameEndpointString() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LocationnameEndpointString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointStringEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointStringEndpoint.java new file mode 100644 index 000000000000..0c6726e5ef42 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointStringEndpoint.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_StringEndpoint_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.LocationName; + +public class SyncCreateEndpointStringEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateEndpointStringEndpoint(); + } + + public static void syncCreateEndpointStringEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_StringEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointStringEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointStringEndpointString.java new file mode 100644 index 000000000000..3cdf2937cd5a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/createendpoint/SyncCreateEndpointStringEndpointString.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_StringEndpointString_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.LocationName; + +public class SyncCreateEndpointStringEndpointString { + + public static void main(String[] args) throws Exception { + syncCreateEndpointStringEndpointString(); + } + + public static void syncCreateEndpointStringEndpointString() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_StringEndpointString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/AsyncDeleteEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/AsyncDeleteEndpoint.java new file mode 100644 index 000000000000..d177f44995f0 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/AsyncDeleteEndpoint.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.DeleteEndpointRequest; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteEndpoint { + + public static void main(String[] args) throws Exception { + asyncDeleteEndpoint(); + } + + public static void asyncDeleteEndpoint() throws Exception { + // 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 future = + endpointServiceClient.deleteEndpointCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/AsyncDeleteEndpointLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/AsyncDeleteEndpointLRO.java new file mode 100644 index 000000000000..1cc71cc680bd --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/AsyncDeleteEndpointLRO.java @@ -0,0 +1,54 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.api.DeleteEndpointRequest; +import com.google.cloud.vertexai.api.DeleteOperationMetadata; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteEndpointLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteEndpointLRO(); + } + + public static void asyncDeleteEndpointLRO() throws Exception { + // 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 future = + endpointServiceClient.deleteEndpointOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/SyncDeleteEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/SyncDeleteEndpoint.java new file mode 100644 index 000000000000..987856dc68a0 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/SyncDeleteEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_sync] +import com.google.cloud.vertexai.api.DeleteEndpointRequest; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEndpoint { + + public static void main(String[] args) throws Exception { + syncDeleteEndpoint(); + } + + public static void syncDeleteEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/SyncDeleteEndpointEndpointname.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/SyncDeleteEndpointEndpointname.java new file mode 100644 index 000000000000..7d7bdff9e0a9 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/SyncDeleteEndpointEndpointname.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_Endpointname_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEndpointEndpointname { + + public static void main(String[] args) throws Exception { + syncDeleteEndpointEndpointname(); + } + + public static void syncDeleteEndpointEndpointname() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_Endpointname_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/SyncDeleteEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/SyncDeleteEndpointString.java new file mode 100644 index 000000000000..f6e0123438c1 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deleteendpoint/SyncDeleteEndpointString.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_String_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEndpointString { + + public static void main(String[] args) throws Exception { + syncDeleteEndpointString(); + } + + public static void syncDeleteEndpointString() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_String_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/AsyncDeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/AsyncDeployModel.java new file mode 100644 index 000000000000..0d8e63d92743 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/AsyncDeployModel.java @@ -0,0 +1,56 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeployModel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.DeployModelRequest; +import com.google.cloud.vertexai.api.DeployedModel; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.longrunning.Operation; +import java.util.HashMap; + +public class AsyncDeployModel { + + public static void main(String[] args) throws Exception { + asyncDeployModel(); + } + + public static void asyncDeployModel() throws Exception { + // 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()) + .build(); + ApiFuture future = endpointServiceClient.deployModelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeployModel_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/AsyncDeployModelLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/AsyncDeployModelLRO.java new file mode 100644 index 000000000000..33073b405b20 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/AsyncDeployModelLRO.java @@ -0,0 +1,58 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeployModel_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +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.DeployedModel; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import java.util.HashMap; + +public class AsyncDeployModelLRO { + + public static void main(String[] args) throws Exception { + asyncDeployModelLRO(); + } + + public static void asyncDeployModelLRO() throws Exception { + // 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()) + .build(); + OperationFuture future = + endpointServiceClient.deployModelOperationCallable().futureCall(request); + // Do something. + DeployModelResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeployModel_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/SyncDeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/SyncDeployModel.java new file mode 100644 index 000000000000..f8b047385db0 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/SyncDeployModel.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeployModel_sync] +import com.google.cloud.vertexai.api.DeployModelRequest; +import com.google.cloud.vertexai.api.DeployModelResponse; +import com.google.cloud.vertexai.api.DeployedModel; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import java.util.HashMap; + +public class SyncDeployModel { + + public static void main(String[] args) throws Exception { + syncDeployModel(); + } + + public static void syncDeployModel() throws Exception { + // 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()) + .build(); + DeployModelResponse response = endpointServiceClient.deployModelAsync(request).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeployModel_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/SyncDeployModelEndpointnameDeployedmodelMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/SyncDeployModelEndpointnameDeployedmodelMapstringinteger.java new file mode 100644 index 000000000000..4d61c8597f44 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/SyncDeployModelEndpointnameDeployedmodelMapstringinteger.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeployModel_EndpointnameDeployedmodelMapstringinteger_sync] +import com.google.cloud.vertexai.api.DeployModelResponse; +import com.google.cloud.vertexai.api.DeployedModel; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import java.util.HashMap; +import java.util.Map; + +public class SyncDeployModelEndpointnameDeployedmodelMapstringinteger { + + public static void main(String[] args) throws Exception { + syncDeployModelEndpointnameDeployedmodelMapstringinteger(); + } + + public static void syncDeployModelEndpointnameDeployedmodelMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + DeployModelResponse response = + endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeployModel_EndpointnameDeployedmodelMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/SyncDeployModelStringDeployedmodelMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/SyncDeployModelStringDeployedmodelMapstringinteger.java new file mode 100644 index 000000000000..6e8cdc87b402 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/deploymodel/SyncDeployModelStringDeployedmodelMapstringinteger.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeployModel_StringDeployedmodelMapstringinteger_sync] +import com.google.cloud.vertexai.api.DeployModelResponse; +import com.google.cloud.vertexai.api.DeployedModel; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import java.util.HashMap; +import java.util.Map; + +public class SyncDeployModelStringDeployedmodelMapstringinteger { + + public static void main(String[] args) throws Exception { + syncDeployModelStringDeployedmodelMapstringinteger(); + } + + public static void syncDeployModelStringDeployedmodelMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + DeployModelResponse response = + endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeployModel_StringDeployedmodelMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/AsyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/AsyncGetEndpoint.java new file mode 100644 index 000000000000..6b9d1a6c9a92 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/AsyncGetEndpoint.java @@ -0,0 +1,52 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.GetEndpointRequest; + +public class AsyncGetEndpoint { + + public static void main(String[] args) throws Exception { + asyncGetEndpoint(); + } + + public static void asyncGetEndpoint() throws Exception { + // 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 future = endpointServiceClient.getEndpointCallable().futureCall(request); + // Do something. + Endpoint response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/SyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/SyncGetEndpoint.java new file mode 100644 index 000000000000..550dc670c731 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/SyncGetEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetEndpoint_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.GetEndpointRequest; + +public class SyncGetEndpoint { + + public static void main(String[] args) throws Exception { + syncGetEndpoint(); + } + + public static void syncGetEndpoint() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/SyncGetEndpointEndpointname.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/SyncGetEndpointEndpointname.java new file mode 100644 index 000000000000..6d9e56beed3a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/SyncGetEndpointEndpointname.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetEndpoint_Endpointname_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; + +public class SyncGetEndpointEndpointname { + + public static void main(String[] args) throws Exception { + syncGetEndpointEndpointname(); + } + + public static void syncGetEndpointEndpointname() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetEndpoint_Endpointname_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/SyncGetEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/SyncGetEndpointString.java new file mode 100644 index 000000000000..59e93c71ad54 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getendpoint/SyncGetEndpointString.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetEndpoint_String_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; + +public class SyncGetEndpointString { + + public static void main(String[] args) throws Exception { + syncGetEndpointString(); + } + + public static void syncGetEndpointString() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetEndpoint_String_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getiampolicy/AsyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..7461d586d02c --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,54 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // 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 future = endpointServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getiampolicy/SyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..e75ed0af3885 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetIamPolicy_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getlocation/AsyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..a648f0719ed8 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.EndpointServiceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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 future = endpointServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetLocation_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getlocation/SyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..25c2f5a6585d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.EndpointServiceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetLocation_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/AsyncListEndpoints.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/AsyncListEndpoints.java new file mode 100644 index 000000000000..777e2b34ece2 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/AsyncListEndpoints.java @@ -0,0 +1,57 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListEndpoints_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.ListEndpointsRequest; +import com.google.cloud.vertexai.api.LocationName; +import com.google.protobuf.FieldMask; + +public class AsyncListEndpoints { + + public static void main(String[] args) throws Exception { + asyncListEndpoints(); + } + + public static void asyncListEndpoints() throws Exception { + // 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 future = + endpointServiceClient.listEndpointsPagedCallable().futureCall(request); + // Do something. + for (Endpoint element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListEndpoints_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/AsyncListEndpointsPaged.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/AsyncListEndpointsPaged.java new file mode 100644 index 000000000000..e0856197a517 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/AsyncListEndpointsPaged.java @@ -0,0 +1,65 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListEndpoints_Paged_async] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.ListEndpointsRequest; +import com.google.cloud.vertexai.api.ListEndpointsResponse; +import com.google.cloud.vertexai.api.LocationName; +import com.google.common.base.Strings; +import com.google.protobuf.FieldMask; + +public class AsyncListEndpointsPaged { + + public static void main(String[] args) throws Exception { + asyncListEndpointsPaged(); + } + + public static void asyncListEndpointsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListEndpoints_Paged_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/SyncListEndpoints.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/SyncListEndpoints.java new file mode 100644 index 000000000000..e03117f2fa3b --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/SyncListEndpoints.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListEndpoints_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.ListEndpointsRequest; +import com.google.cloud.vertexai.api.LocationName; +import com.google.protobuf.FieldMask; + +public class SyncListEndpoints { + + public static void main(String[] args) throws Exception { + syncListEndpoints(); + } + + public static void syncListEndpoints() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListEndpoints_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/SyncListEndpointsLocationname.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/SyncListEndpointsLocationname.java new file mode 100644 index 000000000000..49db364f254f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/SyncListEndpointsLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListEndpoints_Locationname_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.LocationName; + +public class SyncListEndpointsLocationname { + + public static void main(String[] args) throws Exception { + syncListEndpointsLocationname(); + } + + public static void syncListEndpointsLocationname() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListEndpoints_Locationname_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/SyncListEndpointsString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/SyncListEndpointsString.java new file mode 100644 index 000000000000..3e1c13272450 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listendpoints/SyncListEndpointsString.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListEndpoints_String_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.LocationName; + +public class SyncListEndpointsString { + + public static void main(String[] args) throws Exception { + syncListEndpointsString(); + } + + public static void syncListEndpointsString() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListEndpoints_String_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listlocations/AsyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..afbc04cc9301 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.EndpointServiceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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 future = + endpointServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListLocations_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listlocations/AsyncListLocationsPaged.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..4b7666ecea9a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListLocations_Paged_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listlocations/SyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..b9c7120f424f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.EndpointServiceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListLocations_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModel.java new file mode 100644 index 000000000000..63dc0a42d47e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModel.java @@ -0,0 +1,57 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.DeployedModel; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.MutateDeployedModelRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncMutateDeployedModel { + + public static void main(String[] args) throws Exception { + asyncMutateDeployedModel(); + } + + public static void asyncMutateDeployedModel() throws Exception { + // 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 future = + endpointServiceClient.mutateDeployedModelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModelLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModelLRO.java new file mode 100644 index 000000000000..91ae5e31f862 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModelLRO.java @@ -0,0 +1,58 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.api.DeployedModel; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.MutateDeployedModelOperationMetadata; +import com.google.cloud.vertexai.api.MutateDeployedModelRequest; +import com.google.cloud.vertexai.api.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class AsyncMutateDeployedModelLRO { + + public static void main(String[] args) throws Exception { + asyncMutateDeployedModelLRO(); + } + + public static void asyncMutateDeployedModelLRO() throws Exception { + // 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 future = + endpointServiceClient.mutateDeployedModelOperationCallable().futureCall(request); + // Do something. + MutateDeployedModelResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/SyncMutateDeployedModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/SyncMutateDeployedModel.java new file mode 100644 index 000000000000..a70ef090a4da --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/SyncMutateDeployedModel.java @@ -0,0 +1,54 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_sync] +import com.google.cloud.vertexai.api.DeployedModel; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.MutateDeployedModelRequest; +import com.google.cloud.vertexai.api.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class SyncMutateDeployedModel { + + public static void main(String[] args) throws Exception { + syncMutateDeployedModel(); + } + + public static void syncMutateDeployedModel() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask.java new file mode 100644 index 000000000000..2cedd90ca142 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask.java @@ -0,0 +1,48 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_EndpointnameDeployedmodelFieldmask_sync] +import com.google.cloud.vertexai.api.DeployedModel; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask { + + public static void main(String[] args) throws Exception { + syncMutateDeployedModelEndpointnameDeployedmodelFieldmask(); + } + + public static void syncMutateDeployedModelEndpointnameDeployedmodelFieldmask() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_EndpointnameDeployedmodelFieldmask_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelStringDeployedmodelFieldmask.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelStringDeployedmodelFieldmask.java new file mode 100644 index 000000000000..65d78cc75e27 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelStringDeployedmodelFieldmask.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_StringDeployedmodelFieldmask_sync] +import com.google.cloud.vertexai.api.DeployedModel; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class SyncMutateDeployedModelStringDeployedmodelFieldmask { + + public static void main(String[] args) throws Exception { + syncMutateDeployedModelStringDeployedmodelFieldmask(); + } + + public static void syncMutateDeployedModelStringDeployedmodelFieldmask() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_StringDeployedmodelFieldmask_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/setiampolicy/AsyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..d8064d6d3b07 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,55 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // 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 future = endpointServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_SetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/setiampolicy/SyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..8866876c31d9 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_SetIamPolicy_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_SetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/testiampermissions/AsyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..a431282b97bc --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,55 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // 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()) + .build(); + ApiFuture future = + endpointServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_TestIamPermissions_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/testiampermissions/SyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..e74bf720b8c5 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,51 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_TestIamPermissions_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // 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()) + .build(); + TestIamPermissionsResponse response = endpointServiceClient.testIamPermissions(request); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_TestIamPermissions_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/AsyncUndeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/AsyncUndeployModel.java new file mode 100644 index 000000000000..e806f4386a0f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/AsyncUndeployModel.java @@ -0,0 +1,56 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UndeployModel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.UndeployModelRequest; +import com.google.longrunning.Operation; +import java.util.HashMap; + +public class AsyncUndeployModel { + + public static void main(String[] args) throws Exception { + asyncUndeployModel(); + } + + public static void asyncUndeployModel() throws Exception { + // 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()) + .build(); + ApiFuture future = + endpointServiceClient.undeployModelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UndeployModel_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/AsyncUndeployModelLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/AsyncUndeployModelLRO.java new file mode 100644 index 000000000000..a859be4f8d0f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/AsyncUndeployModelLRO.java @@ -0,0 +1,57 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UndeployModel_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.UndeployModelOperationMetadata; +import com.google.cloud.vertexai.api.UndeployModelRequest; +import com.google.cloud.vertexai.api.UndeployModelResponse; +import java.util.HashMap; + +public class AsyncUndeployModelLRO { + + public static void main(String[] args) throws Exception { + asyncUndeployModelLRO(); + } + + public static void asyncUndeployModelLRO() throws Exception { + // 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()) + .build(); + OperationFuture future = + endpointServiceClient.undeployModelOperationCallable().futureCall(request); + // Do something. + UndeployModelResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UndeployModel_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/SyncUndeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/SyncUndeployModel.java new file mode 100644 index 000000000000..a6073dd6d962 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/SyncUndeployModel.java @@ -0,0 +1,52 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UndeployModel_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.UndeployModelRequest; +import com.google.cloud.vertexai.api.UndeployModelResponse; +import java.util.HashMap; + +public class SyncUndeployModel { + + public static void main(String[] args) throws Exception { + syncUndeployModel(); + } + + public static void syncUndeployModel() throws Exception { + // 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()) + .build(); + UndeployModelResponse response = endpointServiceClient.undeployModelAsync(request).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UndeployModel_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/SyncUndeployModelEndpointnameStringMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/SyncUndeployModelEndpointnameStringMapstringinteger.java new file mode 100644 index 000000000000..fc8c74ac1b47 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/SyncUndeployModelEndpointnameStringMapstringinteger.java @@ -0,0 +1,48 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UndeployModel_EndpointnameStringMapstringinteger_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.UndeployModelResponse; +import java.util.HashMap; +import java.util.Map; + +public class SyncUndeployModelEndpointnameStringMapstringinteger { + + public static void main(String[] args) throws Exception { + syncUndeployModelEndpointnameStringMapstringinteger(); + } + + public static void syncUndeployModelEndpointnameStringMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + UndeployModelResponse response = + endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UndeployModel_EndpointnameStringMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/SyncUndeployModelStringStringMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/SyncUndeployModelStringStringMapstringinteger.java new file mode 100644 index 000000000000..c607c2d3263b --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/undeploymodel/SyncUndeployModelStringStringMapstringinteger.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UndeployModel_StringStringMapstringinteger_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.UndeployModelResponse; +import java.util.HashMap; +import java.util.Map; + +public class SyncUndeployModelStringStringMapstringinteger { + + public static void main(String[] args) throws Exception { + syncUndeployModelStringStringMapstringinteger(); + } + + public static void syncUndeployModelStringStringMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + UndeployModelResponse response = + endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UndeployModel_StringStringMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/updateendpoint/AsyncUpdateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/updateendpoint/AsyncUpdateEndpoint.java new file mode 100644 index 000000000000..38307e53b29a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/updateendpoint/AsyncUpdateEndpoint.java @@ -0,0 +1,51 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.UpdateEndpointRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateEndpoint { + + public static void main(String[] args) throws Exception { + asyncUpdateEndpoint(); + } + + public static void asyncUpdateEndpoint() throws Exception { + // 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 future = + endpointServiceClient.updateEndpointCallable().futureCall(request); + // Do something. + Endpoint response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/updateendpoint/SyncUpdateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/updateendpoint/SyncUpdateEndpoint.java new file mode 100644 index 000000000000..a8df725a3b46 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/updateendpoint/SyncUpdateEndpoint.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.cloud.vertexai.api.UpdateEndpointRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateEndpoint { + + public static void main(String[] args) throws Exception { + syncUpdateEndpoint(); + } + + public static void syncUpdateEndpoint() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/updateendpoint/SyncUpdateEndpointEndpointFieldmask.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/updateendpoint/SyncUpdateEndpointEndpointFieldmask.java new file mode 100644 index 000000000000..cb00c32a8066 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservice/updateendpoint/SyncUpdateEndpointEndpointFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_EndpointFieldmask_sync] +import com.google.cloud.vertexai.api.Endpoint; +import com.google.cloud.vertexai.api.EndpointServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateEndpointEndpointFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateEndpointEndpointFieldmask(); + } + + public static void syncUpdateEndpointEndpointFieldmask() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_EndpointFieldmask_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservicesettings/getendpoint/SyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservicesettings/getendpoint/SyncGetEndpoint.java new file mode 100644 index 000000000000..012180ec2e3e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/endpointservicesettings/getendpoint/SyncGetEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointServiceSettings_GetEndpoint_sync] +import com.google.cloud.vertexai.api.EndpointServiceSettings; +import java.time.Duration; + +public class SyncGetEndpoint { + + public static void main(String[] args) throws Exception { + syncGetEndpoint(); + } + + public static void syncGetEndpoint() throws Exception { + // 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(); + } +} +// [END aiplatform_v1beta1_generated_EndpointServiceSettings_GetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/AsyncCountTokens.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/AsyncCountTokens.java new file mode 100644 index 000000000000..ec02e9050dbf --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/AsyncCountTokens.java @@ -0,0 +1,59 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_CountTokens_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.Content; +import com.google.cloud.vertexai.api.CountTokensRequest; +import com.google.cloud.vertexai.api.CountTokensResponse; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class AsyncCountTokens { + + public static void main(String[] args) throws Exception { + asyncCountTokens(); + } + + public static void asyncCountTokens() throws Exception { + // 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()) + .addAllContents(new ArrayList()) + .build(); + ApiFuture future = + predictionServiceClient.countTokensCallable().futureCall(request); + // Do something. + CountTokensResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_CountTokens_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/SyncCountTokens.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/SyncCountTokens.java new file mode 100644 index 000000000000..82142aa94fc9 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/SyncCountTokens.java @@ -0,0 +1,55 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_CountTokens_sync] +import com.google.cloud.vertexai.api.Content; +import com.google.cloud.vertexai.api.CountTokensRequest; +import com.google.cloud.vertexai.api.CountTokensResponse; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class SyncCountTokens { + + public static void main(String[] args) throws Exception { + syncCountTokens(); + } + + public static void syncCountTokens() throws Exception { + // 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()) + .addAllContents(new ArrayList()) + .build(); + CountTokensResponse response = predictionServiceClient.countTokens(request); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_CountTokens_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/SyncCountTokensEndpointnameListvalue.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/SyncCountTokensEndpointnameListvalue.java new file mode 100644 index 000000000000..23df850d1100 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/SyncCountTokensEndpointnameListvalue.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_CountTokens_EndpointnameListvalue_sync] +import com.google.cloud.vertexai.api.CountTokensResponse; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncCountTokensEndpointnameListvalue { + + public static void main(String[] args) throws Exception { + syncCountTokensEndpointnameListvalue(); + } + + public static void syncCountTokensEndpointnameListvalue() throws Exception { + // 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 instances = new ArrayList<>(); + CountTokensResponse response = predictionServiceClient.countTokens(endpoint, instances); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_CountTokens_EndpointnameListvalue_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/SyncCountTokensStringListvalue.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/SyncCountTokensStringListvalue.java new file mode 100644 index 000000000000..53a89f2a28bd --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/counttokens/SyncCountTokensStringListvalue.java @@ -0,0 +1,48 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_CountTokens_StringListvalue_sync] +import com.google.cloud.vertexai.api.CountTokensResponse; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncCountTokensStringListvalue { + + public static void main(String[] args) throws Exception { + syncCountTokensStringListvalue(); + } + + public static void syncCountTokensStringListvalue() throws Exception { + // 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 instances = new ArrayList<>(); + CountTokensResponse response = predictionServiceClient.countTokens(endpoint, instances); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_CountTokens_StringListvalue_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/create/SyncCreateSetCredentialsProvider.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..7af0df595e34 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.PredictionServiceSettings; +import com.google.cloud.vertexai.api.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Create_SetCredentialsProvider_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/create/SyncCreateSetCredentialsProvider1.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..b0d861950465 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.PredictionServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Create_SetCredentialsProvider1_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/create/SyncCreateSetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..5441b81f23fc --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Create_SetEndpoint_sync] +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.PredictionServiceSettings; +import com.google.cloud.vertexai.api.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Create_SetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directpredict/AsyncDirectPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directpredict/AsyncDirectPredict.java new file mode 100644 index 000000000000..87e03477aad2 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directpredict/AsyncDirectPredict.java @@ -0,0 +1,57 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_DirectPredict_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.DirectPredictRequest; +import com.google.cloud.vertexai.api.DirectPredictResponse; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.Tensor; +import java.util.ArrayList; + +public class AsyncDirectPredict { + + public static void main(String[] args) throws Exception { + asyncDirectPredict(); + } + + public static void asyncDirectPredict() throws Exception { + // 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()) + .setParameters(Tensor.newBuilder().build()) + .build(); + ApiFuture future = + predictionServiceClient.directPredictCallable().futureCall(request); + // Do something. + DirectPredictResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_DirectPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directpredict/SyncDirectPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directpredict/SyncDirectPredict.java new file mode 100644 index 000000000000..c6d9801461fb --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directpredict/SyncDirectPredict.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_DirectPredict_sync] +import com.google.cloud.vertexai.api.DirectPredictRequest; +import com.google.cloud.vertexai.api.DirectPredictResponse; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.Tensor; +import java.util.ArrayList; + +public class SyncDirectPredict { + + public static void main(String[] args) throws Exception { + syncDirectPredict(); + } + + public static void syncDirectPredict() throws Exception { + // 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()) + .setParameters(Tensor.newBuilder().build()) + .build(); + DirectPredictResponse response = predictionServiceClient.directPredict(request); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_DirectPredict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directrawpredict/AsyncDirectRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directrawpredict/AsyncDirectRawPredict.java new file mode 100644 index 000000000000..2bfaaab5a14e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directrawpredict/AsyncDirectRawPredict.java @@ -0,0 +1,56 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_DirectRawPredict_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.DirectRawPredictRequest; +import com.google.cloud.vertexai.api.DirectRawPredictResponse; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.ByteString; + +public class AsyncDirectRawPredict { + + public static void main(String[] args) throws Exception { + asyncDirectRawPredict(); + } + + public static void asyncDirectRawPredict() throws Exception { + // 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 future = + predictionServiceClient.directRawPredictCallable().futureCall(request); + // Do something. + DirectRawPredictResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_DirectRawPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directrawpredict/SyncDirectRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directrawpredict/SyncDirectRawPredict.java new file mode 100644 index 000000000000..971e5716b641 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/directrawpredict/SyncDirectRawPredict.java @@ -0,0 +1,52 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_DirectRawPredict_sync] +import com.google.cloud.vertexai.api.DirectRawPredictRequest; +import com.google.cloud.vertexai.api.DirectRawPredictResponse; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.ByteString; + +public class SyncDirectRawPredict { + + public static void main(String[] args) throws Exception { + syncDirectRawPredict(); + } + + public static void syncDirectRawPredict() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_DirectRawPredict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/AsyncExplain.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/AsyncExplain.java new file mode 100644 index 000000000000..11f2a5fcb468 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/AsyncExplain.java @@ -0,0 +1,63 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Explain_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.ExplainRequest; +import com.google.cloud.vertexai.api.ExplainResponse; +import com.google.cloud.vertexai.api.ExplanationSpecOverride; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.HashMap; + +public class AsyncExplain { + + public static void main(String[] args) throws Exception { + asyncExplain(); + } + + public static void asyncExplain() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .setExplanationSpecOverride(ExplanationSpecOverride.newBuilder().build()) + .putAllConcurrentExplanationSpecOverride( + new HashMap()) + .setDeployedModelId("deployedModelId-1817547906") + .build(); + ApiFuture future = + predictionServiceClient.explainCallable().futureCall(request); + // Do something. + ExplainResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Explain_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/SyncExplain.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/SyncExplain.java new file mode 100644 index 000000000000..9cd792ac2107 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/SyncExplain.java @@ -0,0 +1,59 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Explain_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.ExplainRequest; +import com.google.cloud.vertexai.api.ExplainResponse; +import com.google.cloud.vertexai.api.ExplanationSpecOverride; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.HashMap; + +public class SyncExplain { + + public static void main(String[] args) throws Exception { + syncExplain(); + } + + public static void syncExplain() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .setExplanationSpecOverride(ExplanationSpecOverride.newBuilder().build()) + .putAllConcurrentExplanationSpecOverride( + new HashMap()) + .setDeployedModelId("deployedModelId-1817547906") + .build(); + ExplainResponse response = predictionServiceClient.explain(request); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Explain_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/SyncExplainEndpointnameListvalueValueString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/SyncExplainEndpointnameListvalueValueString.java new file mode 100644 index 000000000000..874899720739 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/SyncExplainEndpointnameListvalueValueString.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Explain_EndpointnameListvalueValueString_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.ExplainResponse; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncExplainEndpointnameListvalueValueString { + + public static void main(String[] args) throws Exception { + syncExplainEndpointnameListvalueValueString(); + } + + public static void syncExplainEndpointnameListvalueValueString() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + ExplainResponse response = + predictionServiceClient.explain(endpoint, instances, parameters, deployedModelId); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Explain_EndpointnameListvalueValueString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/SyncExplainStringListvalueValueString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/SyncExplainStringListvalueValueString.java new file mode 100644 index 000000000000..ac8cf87c220f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/explain/SyncExplainStringListvalueValueString.java @@ -0,0 +1,51 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Explain_StringListvalueValueString_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.ExplainResponse; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncExplainStringListvalueValueString { + + public static void main(String[] args) throws Exception { + syncExplainStringListvalueValueString(); + } + + public static void syncExplainStringListvalueValueString() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + ExplainResponse response = + predictionServiceClient.explain(endpoint, instances, parameters, deployedModelId); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Explain_StringListvalueValueString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getiampolicy/AsyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..780bb3c17bbd --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,54 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // 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 future = predictionServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_GetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getiampolicy/SyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..c0c82aa72405 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_GetIamPolicy_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_GetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getlocation/AsyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..2fb997cf644f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,46 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.PredictionServiceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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 future = + predictionServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_GetLocation_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getlocation/SyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..24d1e450bb4a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.PredictionServiceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_GetLocation_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/listlocations/AsyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..2b9abfc1275c --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.PredictionServiceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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 future = + predictionServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_ListLocations_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/listlocations/AsyncListLocationsPaged.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..b771701ff0bd --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_ListLocations_Paged_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/listlocations/SyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..1a64230a03cd --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.api.PredictionServiceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_ListLocations_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/AsyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/AsyncPredict.java new file mode 100644 index 000000000000..4a724af854d4 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/AsyncPredict.java @@ -0,0 +1,57 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Predict_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictRequest; +import com.google.cloud.vertexai.api.PredictResponse; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class AsyncPredict { + + public static void main(String[] args) throws Exception { + asyncPredict(); + } + + public static void asyncPredict() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .build(); + ApiFuture future = + predictionServiceClient.predictCallable().futureCall(request); + // Do something. + PredictResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Predict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/SyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/SyncPredict.java new file mode 100644 index 000000000000..46130d4766d4 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/SyncPredict.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Predict_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictRequest; +import com.google.cloud.vertexai.api.PredictResponse; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class SyncPredict { + + public static void main(String[] args) throws Exception { + syncPredict(); + } + + public static void syncPredict() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .build(); + PredictResponse response = predictionServiceClient.predict(request); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Predict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/SyncPredictEndpointnameListvalueValue.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/SyncPredictEndpointnameListvalueValue.java new file mode 100644 index 000000000000..249a638348d2 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/SyncPredictEndpointnameListvalueValue.java @@ -0,0 +1,48 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Predict_EndpointnameListvalueValue_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictResponse; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncPredictEndpointnameListvalueValue { + + public static void main(String[] args) throws Exception { + syncPredictEndpointnameListvalueValue(); + } + + public static void syncPredictEndpointnameListvalueValue() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Predict_EndpointnameListvalueValue_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/SyncPredictStringListvalueValue.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/SyncPredictStringListvalueValue.java new file mode 100644 index 000000000000..568a6d07502f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/predict/SyncPredictStringListvalueValue.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Predict_StringListvalueValue_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictResponse; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncPredictStringListvalueValue { + + public static void main(String[] args) throws Exception { + syncPredictStringListvalueValue(); + } + + public static void syncPredictStringListvalueValue() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Predict_StringListvalueValue_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/AsyncRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/AsyncRawPredict.java new file mode 100644 index 000000000000..262a920ae8ba --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/AsyncRawPredict.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_RawPredict_async] +import com.google.api.HttpBody; +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.RawPredictRequest; + +public class AsyncRawPredict { + + public static void main(String[] args) throws Exception { + asyncRawPredict(); + } + + public static void asyncRawPredict() throws Exception { + // 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 future = predictionServiceClient.rawPredictCallable().futureCall(request); + // Do something. + HttpBody response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_RawPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/SyncRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/SyncRawPredict.java new file mode 100644 index 000000000000..b7bd2ffdbc38 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/SyncRawPredict.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_RawPredict_sync] +import com.google.api.HttpBody; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.RawPredictRequest; + +public class SyncRawPredict { + + public static void main(String[] args) throws Exception { + syncRawPredict(); + } + + public static void syncRawPredict() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_RawPredict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/SyncRawPredictEndpointnameHttpbody.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/SyncRawPredictEndpointnameHttpbody.java new file mode 100644 index 000000000000..1ef67024e52c --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/SyncRawPredictEndpointnameHttpbody.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_RawPredict_EndpointnameHttpbody_sync] +import com.google.api.HttpBody; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; + +public class SyncRawPredictEndpointnameHttpbody { + + public static void main(String[] args) throws Exception { + syncRawPredictEndpointnameHttpbody(); + } + + public static void syncRawPredictEndpointnameHttpbody() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_RawPredict_EndpointnameHttpbody_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/SyncRawPredictStringHttpbody.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/SyncRawPredictStringHttpbody.java new file mode 100644 index 000000000000..3bae61c9b83b --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/rawpredict/SyncRawPredictStringHttpbody.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_RawPredict_StringHttpbody_sync] +import com.google.api.HttpBody; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; + +public class SyncRawPredictStringHttpbody { + + public static void main(String[] args) throws Exception { + syncRawPredictStringHttpbody(); + } + + public static void syncRawPredictStringHttpbody() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_RawPredict_StringHttpbody_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/serverstreamingpredict/AsyncServerStreamingPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/serverstreamingpredict/AsyncServerStreamingPredict.java new file mode 100644 index 000000000000..73cd1f24be99 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/serverstreamingpredict/AsyncServerStreamingPredict.java @@ -0,0 +1,58 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_ServerStreamingPredict_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.StreamingPredictRequest; +import com.google.cloud.vertexai.api.StreamingPredictResponse; +import com.google.cloud.vertexai.api.Tensor; +import java.util.ArrayList; + +public class AsyncServerStreamingPredict { + + public static void main(String[] args) throws Exception { + asyncServerStreamingPredict(); + } + + public static void asyncServerStreamingPredict() throws Exception { + // 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()) + .setParameters(Tensor.newBuilder().build()) + .build(); + ServerStream stream = + predictionServiceClient.serverStreamingPredictCallable().call(request); + for (StreamingPredictResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_ServerStreamingPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/setiampolicy/AsyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..6c555516e5c6 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,55 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // 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 future = predictionServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_SetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/setiampolicy/SyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..2e2929ec4ce3 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_SetIamPolicy_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_SetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/streamgeneratecontent/AsyncStreamGenerateContent.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/streamgeneratecontent/AsyncStreamGenerateContent.java new file mode 100644 index 000000000000..4eb275037341 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/streamgeneratecontent/AsyncStreamGenerateContent.java @@ -0,0 +1,64 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_StreamGenerateContent_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.vertexai.api.Content; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.GenerateContentRequest; +import com.google.cloud.vertexai.api.GenerateContentResponse; +import com.google.cloud.vertexai.api.GenerationConfig; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.SafetySetting; +import com.google.cloud.vertexai.api.Tool; +import java.util.ArrayList; + +public class AsyncStreamGenerateContent { + + public static void main(String[] args) throws Exception { + asyncStreamGenerateContent(); + } + + public static void asyncStreamGenerateContent() throws Exception { + // 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()) + .addAllTools(new ArrayList()) + .addAllSafetySettings(new ArrayList()) + .setGenerationConfig(GenerationConfig.newBuilder().build()) + .build(); + ServerStream stream = + predictionServiceClient.streamGenerateContentCallable().call(request); + for (GenerateContentResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_StreamGenerateContent_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/streamingpredict/AsyncStreamingPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/streamingpredict/AsyncStreamingPredict.java new file mode 100644 index 000000000000..428a1d0d5b9d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/streamingpredict/AsyncStreamingPredict.java @@ -0,0 +1,59 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_StreamingPredict_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.StreamingPredictRequest; +import com.google.cloud.vertexai.api.StreamingPredictResponse; +import com.google.cloud.vertexai.api.Tensor; +import java.util.ArrayList; + +public class AsyncStreamingPredict { + + public static void main(String[] args) throws Exception { + asyncStreamingPredict(); + } + + public static void asyncStreamingPredict() throws Exception { + // 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 bidiStream = + predictionServiceClient.streamingPredictCallable().call(); + StreamingPredictRequest request = + StreamingPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + bidiStream.send(request); + for (StreamingPredictResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_StreamingPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/streamingrawpredict/AsyncStreamingRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/streamingrawpredict/AsyncStreamingRawPredict.java new file mode 100644 index 000000000000..2e4051ef7f4c --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/streamingrawpredict/AsyncStreamingRawPredict.java @@ -0,0 +1,58 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_StreamingRawPredict_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.cloud.vertexai.api.StreamingRawPredictRequest; +import com.google.cloud.vertexai.api.StreamingRawPredictResponse; +import com.google.protobuf.ByteString; + +public class AsyncStreamingRawPredict { + + public static void main(String[] args) throws Exception { + asyncStreamingRawPredict(); + } + + public static void asyncStreamingRawPredict() throws Exception { + // 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 bidiStream = + predictionServiceClient.streamingRawPredictCallable().call(); + StreamingRawPredictRequest request = + StreamingRawPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setMethodName("methodName-723163380") + .setInput(ByteString.EMPTY) + .build(); + bidiStream.send(request); + for (StreamingRawPredictResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_StreamingRawPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/testiampermissions/AsyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..eb205d6bb6ac --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,55 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // 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()) + .build(); + ApiFuture future = + predictionServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_TestIamPermissions_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/testiampermissions/SyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..cc22946d1ea1 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,51 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_TestIamPermissions_sync] +import com.google.cloud.vertexai.api.EndpointName; +import com.google.cloud.vertexai.api.PredictionServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // 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()) + .build(); + TestIamPermissionsResponse response = predictionServiceClient.testIamPermissions(request); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_TestIamPermissions_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservicesettings/predict/SyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservicesettings/predict/SyncPredict.java new file mode 100644 index 000000000000..70776706d865 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/predictionservicesettings/predict/SyncPredict.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionServiceSettings_Predict_sync] +import com.google.cloud.vertexai.api.PredictionServiceSettings; +import java.time.Duration; + +public class SyncPredict { + + public static void main(String[] args) throws Exception { + syncPredict(); + } + + public static void syncPredict() throws Exception { + // 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(); + } +} +// [END aiplatform_v1beta1_generated_PredictionServiceSettings_Predict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/stub/endpointservicestubsettings/getendpoint/SyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/stub/endpointservicestubsettings/getendpoint/SyncGetEndpoint.java new file mode 100644 index 000000000000..e40bd657aa84 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/stub/endpointservicestubsettings/getendpoint/SyncGetEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_EndpointServiceStubSettings_GetEndpoint_sync] +import com.google.cloud.vertexai.api.stub.EndpointServiceStubSettings; +import java.time.Duration; + +public class SyncGetEndpoint { + + public static void main(String[] args) throws Exception { + syncGetEndpoint(); + } + + public static void syncGetEndpoint() throws Exception { + // 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(); + } +} +// [END aiplatform_v1beta1_generated_EndpointServiceStubSettings_GetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/stub/predictionservicestubsettings/predict/SyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/stub/predictionservicestubsettings/predict/SyncPredict.java new file mode 100644 index 000000000000..81eced2b2ecd --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/api/stub/predictionservicestubsettings/predict/SyncPredict.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START aiplatform_v1beta1_generated_PredictionServiceStubSettings_Predict_sync] +import com.google.cloud.vertexai.api.stub.PredictionServiceStubSettings; +import java.time.Duration; + +public class SyncPredict { + + public static void main(String[] args) throws Exception { + syncPredict(); + } + + public static void syncPredict() throws Exception { + // 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 + PredictionServiceStubSettings.Builder predictionServiceSettingsBuilder = + PredictionServiceStubSettings.newBuilder(); + predictionServiceSettingsBuilder + .predictSettings() + .setRetrySettings( + predictionServiceSettingsBuilder + .predictSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + PredictionServiceStubSettings predictionServiceSettings = + predictionServiceSettingsBuilder.build(); + } +} +// [END aiplatform_v1beta1_generated_PredictionServiceStubSettings_Predict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/create/SyncCreateSetCredentialsProvider.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..87fd344ff831 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.EndpointServiceSettings; +import com.google.cloud.vertexai.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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); + } +} +// [END aiplatform_v1_generated_EndpointService_Create_SetCredentialsProvider_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/create/SyncCreateSetCredentialsProvider1.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..a58e2d458aef --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.EndpointServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // 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); + } +} +// [END aiplatform_v1_generated_EndpointService_Create_SetCredentialsProvider1_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/create/SyncCreateSetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..591492206b11 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_Create_SetEndpoint_sync] +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.EndpointServiceSettings; +import com.google.cloud.vertexai.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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); + } +} +// [END aiplatform_v1_generated_EndpointService_Create_SetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/AsyncCreateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/AsyncCreateEndpoint.java new file mode 100644 index 000000000000..bf606094fa15 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/AsyncCreateEndpoint.java @@ -0,0 +1,53 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_CreateEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.CreateEndpointRequest; +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateEndpoint { + + public static void main(String[] args) throws Exception { + asyncCreateEndpoint(); + } + + public static void asyncCreateEndpoint() throws Exception { + // 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 future = + endpointServiceClient.createEndpointCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_CreateEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/AsyncCreateEndpointLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/AsyncCreateEndpointLRO.java new file mode 100644 index 000000000000..d785512f0aa8 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/AsyncCreateEndpointLRO.java @@ -0,0 +1,53 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_CreateEndpoint_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.v1.CreateEndpointOperationMetadata; +import com.google.cloud.vertexai.v1.CreateEndpointRequest; +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.LocationName; + +public class AsyncCreateEndpointLRO { + + public static void main(String[] args) throws Exception { + asyncCreateEndpointLRO(); + } + + public static void asyncCreateEndpointLRO() throws Exception { + // 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 future = + endpointServiceClient.createEndpointOperationCallable().futureCall(request); + // Do something. + Endpoint response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_CreateEndpoint_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpoint.java new file mode 100644 index 000000000000..28c7d98b83da --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpoint.java @@ -0,0 +1,48 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_CreateEndpoint_sync] +import com.google.cloud.vertexai.v1.CreateEndpointRequest; +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.LocationName; + +public class SyncCreateEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateEndpoint(); + } + + public static void syncCreateEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_CreateEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpoint.java new file mode 100644 index 000000000000..155f39913252 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpoint.java @@ -0,0 +1,43 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_CreateEndpoint_LocationnameEndpoint_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.LocationName; + +public class SyncCreateEndpointLocationnameEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateEndpointLocationnameEndpoint(); + } + + public static void syncCreateEndpointLocationnameEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_CreateEndpoint_LocationnameEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpointString.java new file mode 100644 index 000000000000..993f68949898 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpointString.java @@ -0,0 +1,45 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_CreateEndpoint_LocationnameEndpointString_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.LocationName; + +public class SyncCreateEndpointLocationnameEndpointString { + + public static void main(String[] args) throws Exception { + syncCreateEndpointLocationnameEndpointString(); + } + + public static void syncCreateEndpointLocationnameEndpointString() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_CreateEndpoint_LocationnameEndpointString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointStringEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointStringEndpoint.java new file mode 100644 index 000000000000..30254d9d176c --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointStringEndpoint.java @@ -0,0 +1,43 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_CreateEndpoint_StringEndpoint_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.LocationName; + +public class SyncCreateEndpointStringEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateEndpointStringEndpoint(); + } + + public static void syncCreateEndpointStringEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_CreateEndpoint_StringEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointStringEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointStringEndpointString.java new file mode 100644 index 000000000000..bb3f3cf062b4 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/createendpoint/SyncCreateEndpointStringEndpointString.java @@ -0,0 +1,45 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_CreateEndpoint_StringEndpointString_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.LocationName; + +public class SyncCreateEndpointStringEndpointString { + + public static void main(String[] args) throws Exception { + syncCreateEndpointStringEndpointString(); + } + + public static void syncCreateEndpointStringEndpointString() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_CreateEndpoint_StringEndpointString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/AsyncDeleteEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/AsyncDeleteEndpoint.java new file mode 100644 index 000000000000..d77bc59b42c8 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/AsyncDeleteEndpoint.java @@ -0,0 +1,53 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_DeleteEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.DeleteEndpointRequest; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteEndpoint { + + public static void main(String[] args) throws Exception { + asyncDeleteEndpoint(); + } + + public static void asyncDeleteEndpoint() throws Exception { + // 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 future = + endpointServiceClient.deleteEndpointCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_DeleteEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/AsyncDeleteEndpointLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/AsyncDeleteEndpointLRO.java new file mode 100644 index 000000000000..9df12d518d33 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/AsyncDeleteEndpointLRO.java @@ -0,0 +1,54 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_DeleteEndpoint_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.v1.DeleteEndpointRequest; +import com.google.cloud.vertexai.v1.DeleteOperationMetadata; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteEndpointLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteEndpointLRO(); + } + + public static void asyncDeleteEndpointLRO() throws Exception { + // 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 future = + endpointServiceClient.deleteEndpointOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_DeleteEndpoint_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/SyncDeleteEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/SyncDeleteEndpoint.java new file mode 100644 index 000000000000..2f7500132285 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/SyncDeleteEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_DeleteEndpoint_sync] +import com.google.cloud.vertexai.v1.DeleteEndpointRequest; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEndpoint { + + public static void main(String[] args) throws Exception { + syncDeleteEndpoint(); + } + + public static void syncDeleteEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_DeleteEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/SyncDeleteEndpointEndpointname.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/SyncDeleteEndpointEndpointname.java new file mode 100644 index 000000000000..284540b0c35e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/SyncDeleteEndpointEndpointname.java @@ -0,0 +1,43 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_DeleteEndpoint_Endpointname_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEndpointEndpointname { + + public static void main(String[] args) throws Exception { + syncDeleteEndpointEndpointname(); + } + + public static void syncDeleteEndpointEndpointname() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_DeleteEndpoint_Endpointname_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/SyncDeleteEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/SyncDeleteEndpointString.java new file mode 100644 index 000000000000..53abc60aef57 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deleteendpoint/SyncDeleteEndpointString.java @@ -0,0 +1,44 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_DeleteEndpoint_String_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEndpointString { + + public static void main(String[] args) throws Exception { + syncDeleteEndpointString(); + } + + public static void syncDeleteEndpointString() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_DeleteEndpoint_String_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/AsyncDeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/AsyncDeployModel.java new file mode 100644 index 000000000000..dd294c71bd85 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/AsyncDeployModel.java @@ -0,0 +1,56 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_DeployModel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.DeployModelRequest; +import com.google.cloud.vertexai.v1.DeployedModel; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.longrunning.Operation; +import java.util.HashMap; + +public class AsyncDeployModel { + + public static void main(String[] args) throws Exception { + asyncDeployModel(); + } + + public static void asyncDeployModel() throws Exception { + // 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()) + .build(); + ApiFuture future = endpointServiceClient.deployModelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_DeployModel_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/AsyncDeployModelLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/AsyncDeployModelLRO.java new file mode 100644 index 000000000000..88354a2d155e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/AsyncDeployModelLRO.java @@ -0,0 +1,58 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_DeployModel_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.v1.DeployModelOperationMetadata; +import com.google.cloud.vertexai.v1.DeployModelRequest; +import com.google.cloud.vertexai.v1.DeployModelResponse; +import com.google.cloud.vertexai.v1.DeployedModel; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import java.util.HashMap; + +public class AsyncDeployModelLRO { + + public static void main(String[] args) throws Exception { + asyncDeployModelLRO(); + } + + public static void asyncDeployModelLRO() throws Exception { + // 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()) + .build(); + OperationFuture future = + endpointServiceClient.deployModelOperationCallable().futureCall(request); + // Do something. + DeployModelResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_DeployModel_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/SyncDeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/SyncDeployModel.java new file mode 100644 index 000000000000..22728e1e4388 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/SyncDeployModel.java @@ -0,0 +1,53 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_DeployModel_sync] +import com.google.cloud.vertexai.v1.DeployModelRequest; +import com.google.cloud.vertexai.v1.DeployModelResponse; +import com.google.cloud.vertexai.v1.DeployedModel; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import java.util.HashMap; + +public class SyncDeployModel { + + public static void main(String[] args) throws Exception { + syncDeployModel(); + } + + public static void syncDeployModel() throws Exception { + // 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()) + .build(); + DeployModelResponse response = endpointServiceClient.deployModelAsync(request).get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_DeployModel_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/SyncDeployModelEndpointnameDeployedmodelMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/SyncDeployModelEndpointnameDeployedmodelMapstringinteger.java new file mode 100644 index 000000000000..2c28caf64c81 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/SyncDeployModelEndpointnameDeployedmodelMapstringinteger.java @@ -0,0 +1,49 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_DeployModel_EndpointnameDeployedmodelMapstringinteger_sync] +import com.google.cloud.vertexai.v1.DeployModelResponse; +import com.google.cloud.vertexai.v1.DeployedModel; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import java.util.HashMap; +import java.util.Map; + +public class SyncDeployModelEndpointnameDeployedmodelMapstringinteger { + + public static void main(String[] args) throws Exception { + syncDeployModelEndpointnameDeployedmodelMapstringinteger(); + } + + public static void syncDeployModelEndpointnameDeployedmodelMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + DeployModelResponse response = + endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_DeployModel_EndpointnameDeployedmodelMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/SyncDeployModelStringDeployedmodelMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/SyncDeployModelStringDeployedmodelMapstringinteger.java new file mode 100644 index 000000000000..c0b53990a969 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/deploymodel/SyncDeployModelStringDeployedmodelMapstringinteger.java @@ -0,0 +1,50 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_DeployModel_StringDeployedmodelMapstringinteger_sync] +import com.google.cloud.vertexai.v1.DeployModelResponse; +import com.google.cloud.vertexai.v1.DeployedModel; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import java.util.HashMap; +import java.util.Map; + +public class SyncDeployModelStringDeployedmodelMapstringinteger { + + public static void main(String[] args) throws Exception { + syncDeployModelStringDeployedmodelMapstringinteger(); + } + + public static void syncDeployModelStringDeployedmodelMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + DeployModelResponse response = + endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_DeployModel_StringDeployedmodelMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/AsyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/AsyncGetEndpoint.java new file mode 100644 index 000000000000..2d73b4ee804b --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/AsyncGetEndpoint.java @@ -0,0 +1,52 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_GetEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.GetEndpointRequest; + +public class AsyncGetEndpoint { + + public static void main(String[] args) throws Exception { + asyncGetEndpoint(); + } + + public static void asyncGetEndpoint() throws Exception { + // 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 future = endpointServiceClient.getEndpointCallable().futureCall(request); + // Do something. + Endpoint response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_GetEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/SyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/SyncGetEndpoint.java new file mode 100644 index 000000000000..a678343c40fc --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/SyncGetEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_GetEndpoint_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.GetEndpointRequest; + +public class SyncGetEndpoint { + + public static void main(String[] args) throws Exception { + syncGetEndpoint(); + } + + public static void syncGetEndpoint() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_EndpointService_GetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/SyncGetEndpointEndpointname.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/SyncGetEndpointEndpointname.java new file mode 100644 index 000000000000..5c2b6990f66b --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/SyncGetEndpointEndpointname.java @@ -0,0 +1,43 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_GetEndpoint_Endpointname_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; + +public class SyncGetEndpointEndpointname { + + public static void main(String[] args) throws Exception { + syncGetEndpointEndpointname(); + } + + public static void syncGetEndpointEndpointname() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_EndpointService_GetEndpoint_Endpointname_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/SyncGetEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/SyncGetEndpointString.java new file mode 100644 index 000000000000..a6a58dcc7914 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getendpoint/SyncGetEndpointString.java @@ -0,0 +1,44 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_GetEndpoint_String_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; + +public class SyncGetEndpointString { + + public static void main(String[] args) throws Exception { + syncGetEndpointString(); + } + + public static void syncGetEndpointString() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_EndpointService_GetEndpoint_String_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getiampolicy/AsyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..630a1f494fce --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,54 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // 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 future = endpointServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_GetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getiampolicy/SyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..689f97de9ec9 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_GetIamPolicy_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_EndpointService_GetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getlocation/AsyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..ef3b8d9ef42e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1.EndpointServiceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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 future = endpointServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_GetLocation_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getlocation/SyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..d329ec05432a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1.EndpointServiceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_EndpointService_GetLocation_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/AsyncListEndpoints.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/AsyncListEndpoints.java new file mode 100644 index 000000000000..664908630f06 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/AsyncListEndpoints.java @@ -0,0 +1,58 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_ListEndpoints_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.ListEndpointsRequest; +import com.google.cloud.vertexai.v1.LocationName; +import com.google.protobuf.FieldMask; + +public class AsyncListEndpoints { + + public static void main(String[] args) throws Exception { + asyncListEndpoints(); + } + + public static void asyncListEndpoints() throws Exception { + // 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()) + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + endpointServiceClient.listEndpointsPagedCallable().futureCall(request); + // Do something. + for (Endpoint element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_EndpointService_ListEndpoints_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/AsyncListEndpointsPaged.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/AsyncListEndpointsPaged.java new file mode 100644 index 000000000000..ed77837d733d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/AsyncListEndpointsPaged.java @@ -0,0 +1,66 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_ListEndpoints_Paged_async] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.ListEndpointsRequest; +import com.google.cloud.vertexai.v1.ListEndpointsResponse; +import com.google.cloud.vertexai.v1.LocationName; +import com.google.common.base.Strings; +import com.google.protobuf.FieldMask; + +public class AsyncListEndpointsPaged { + + public static void main(String[] args) throws Exception { + asyncListEndpointsPaged(); + } + + public static void asyncListEndpointsPaged() throws Exception { + // 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()) + .setOrderBy("orderBy-1207110587") + .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; + } + } + } + } +} +// [END aiplatform_v1_generated_EndpointService_ListEndpoints_Paged_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/SyncListEndpoints.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/SyncListEndpoints.java new file mode 100644 index 000000000000..c32ad3165460 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/SyncListEndpoints.java @@ -0,0 +1,54 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_ListEndpoints_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.ListEndpointsRequest; +import com.google.cloud.vertexai.v1.LocationName; +import com.google.protobuf.FieldMask; + +public class SyncListEndpoints { + + public static void main(String[] args) throws Exception { + syncListEndpoints(); + } + + public static void syncListEndpoints() throws Exception { + // 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()) + .setOrderBy("orderBy-1207110587") + .build(); + for (Endpoint element : endpointServiceClient.listEndpoints(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_EndpointService_ListEndpoints_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/SyncListEndpointsLocationname.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/SyncListEndpointsLocationname.java new file mode 100644 index 000000000000..703d41975d08 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/SyncListEndpointsLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_ListEndpoints_Locationname_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.LocationName; + +public class SyncListEndpointsLocationname { + + public static void main(String[] args) throws Exception { + syncListEndpointsLocationname(); + } + + public static void syncListEndpointsLocationname() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1_generated_EndpointService_ListEndpoints_Locationname_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/SyncListEndpointsString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/SyncListEndpointsString.java new file mode 100644 index 000000000000..da0b6a0515b1 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listendpoints/SyncListEndpointsString.java @@ -0,0 +1,44 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_ListEndpoints_String_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.LocationName; + +public class SyncListEndpointsString { + + public static void main(String[] args) throws Exception { + syncListEndpointsString(); + } + + public static void syncListEndpointsString() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1_generated_EndpointService_ListEndpoints_String_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listlocations/AsyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..8a7f6972302d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1.EndpointServiceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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 future = + endpointServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_EndpointService_ListLocations_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listlocations/AsyncListLocationsPaged.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..5f4ad4b9b7fb --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END aiplatform_v1_generated_EndpointService_ListLocations_Paged_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listlocations/SyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..6cbefe0bd79d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1.EndpointServiceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1_generated_EndpointService_ListLocations_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModel.java new file mode 100644 index 000000000000..adaa9882e27c --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModel.java @@ -0,0 +1,57 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_MutateDeployedModel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.DeployedModel; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.MutateDeployedModelRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncMutateDeployedModel { + + public static void main(String[] args) throws Exception { + asyncMutateDeployedModel(); + } + + public static void asyncMutateDeployedModel() throws Exception { + // 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 future = + endpointServiceClient.mutateDeployedModelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_MutateDeployedModel_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModelLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModelLRO.java new file mode 100644 index 000000000000..2462a749eb0b --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModelLRO.java @@ -0,0 +1,58 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_MutateDeployedModel_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.v1.DeployedModel; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.MutateDeployedModelOperationMetadata; +import com.google.cloud.vertexai.v1.MutateDeployedModelRequest; +import com.google.cloud.vertexai.v1.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class AsyncMutateDeployedModelLRO { + + public static void main(String[] args) throws Exception { + asyncMutateDeployedModelLRO(); + } + + public static void asyncMutateDeployedModelLRO() throws Exception { + // 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 future = + endpointServiceClient.mutateDeployedModelOperationCallable().futureCall(request); + // Do something. + MutateDeployedModelResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_MutateDeployedModel_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModel.java new file mode 100644 index 000000000000..26e6e26f0dc0 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModel.java @@ -0,0 +1,54 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_MutateDeployedModel_sync] +import com.google.cloud.vertexai.v1.DeployedModel; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.MutateDeployedModelRequest; +import com.google.cloud.vertexai.v1.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class SyncMutateDeployedModel { + + public static void main(String[] args) throws Exception { + syncMutateDeployedModel(); + } + + public static void syncMutateDeployedModel() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_MutateDeployedModel_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask.java new file mode 100644 index 000000000000..e346c469ed2f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask.java @@ -0,0 +1,48 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_MutateDeployedModel_EndpointnameDeployedmodelFieldmask_sync] +import com.google.cloud.vertexai.v1.DeployedModel; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask { + + public static void main(String[] args) throws Exception { + syncMutateDeployedModelEndpointnameDeployedmodelFieldmask(); + } + + public static void syncMutateDeployedModelEndpointnameDeployedmodelFieldmask() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_MutateDeployedModel_EndpointnameDeployedmodelFieldmask_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelStringDeployedmodelFieldmask.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelStringDeployedmodelFieldmask.java new file mode 100644 index 000000000000..466a4431abb2 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelStringDeployedmodelFieldmask.java @@ -0,0 +1,49 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_MutateDeployedModel_StringDeployedmodelFieldmask_sync] +import com.google.cloud.vertexai.v1.DeployedModel; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class SyncMutateDeployedModelStringDeployedmodelFieldmask { + + public static void main(String[] args) throws Exception { + syncMutateDeployedModelStringDeployedmodelFieldmask(); + } + + public static void syncMutateDeployedModelStringDeployedmodelFieldmask() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_MutateDeployedModel_StringDeployedmodelFieldmask_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/setiampolicy/AsyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..16ab892e1133 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,55 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // 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 future = endpointServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_SetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/setiampolicy/SyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..e84dc2a97a9c --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_SetIamPolicy_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_EndpointService_SetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/testiampermissions/AsyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..6df14fb800d4 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,55 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // 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()) + .build(); + ApiFuture future = + endpointServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_TestIamPermissions_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/testiampermissions/SyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..eddeeed2cca8 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,51 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_TestIamPermissions_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // 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()) + .build(); + TestIamPermissionsResponse response = endpointServiceClient.testIamPermissions(request); + } + } +} +// [END aiplatform_v1_generated_EndpointService_TestIamPermissions_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/AsyncUndeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/AsyncUndeployModel.java new file mode 100644 index 000000000000..3fbb43b3bed8 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/AsyncUndeployModel.java @@ -0,0 +1,56 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_UndeployModel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.UndeployModelRequest; +import com.google.longrunning.Operation; +import java.util.HashMap; + +public class AsyncUndeployModel { + + public static void main(String[] args) throws Exception { + asyncUndeployModel(); + } + + public static void asyncUndeployModel() throws Exception { + // 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()) + .build(); + ApiFuture future = + endpointServiceClient.undeployModelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_UndeployModel_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/AsyncUndeployModelLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/AsyncUndeployModelLRO.java new file mode 100644 index 000000000000..e173e8672095 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/AsyncUndeployModelLRO.java @@ -0,0 +1,57 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_UndeployModel_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.UndeployModelOperationMetadata; +import com.google.cloud.vertexai.v1.UndeployModelRequest; +import com.google.cloud.vertexai.v1.UndeployModelResponse; +import java.util.HashMap; + +public class AsyncUndeployModelLRO { + + public static void main(String[] args) throws Exception { + asyncUndeployModelLRO(); + } + + public static void asyncUndeployModelLRO() throws Exception { + // 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()) + .build(); + OperationFuture future = + endpointServiceClient.undeployModelOperationCallable().futureCall(request); + // Do something. + UndeployModelResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_UndeployModel_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/SyncUndeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/SyncUndeployModel.java new file mode 100644 index 000000000000..bd796d4be8d6 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/SyncUndeployModel.java @@ -0,0 +1,52 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_UndeployModel_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.UndeployModelRequest; +import com.google.cloud.vertexai.v1.UndeployModelResponse; +import java.util.HashMap; + +public class SyncUndeployModel { + + public static void main(String[] args) throws Exception { + syncUndeployModel(); + } + + public static void syncUndeployModel() throws Exception { + // 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()) + .build(); + UndeployModelResponse response = endpointServiceClient.undeployModelAsync(request).get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_UndeployModel_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/SyncUndeployModelEndpointnameStringMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/SyncUndeployModelEndpointnameStringMapstringinteger.java new file mode 100644 index 000000000000..450b7bf00187 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/SyncUndeployModelEndpointnameStringMapstringinteger.java @@ -0,0 +1,48 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_UndeployModel_EndpointnameStringMapstringinteger_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.UndeployModelResponse; +import java.util.HashMap; +import java.util.Map; + +public class SyncUndeployModelEndpointnameStringMapstringinteger { + + public static void main(String[] args) throws Exception { + syncUndeployModelEndpointnameStringMapstringinteger(); + } + + public static void syncUndeployModelEndpointnameStringMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + UndeployModelResponse response = + endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_UndeployModel_EndpointnameStringMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/SyncUndeployModelStringStringMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/SyncUndeployModelStringStringMapstringinteger.java new file mode 100644 index 000000000000..b19b0f4b2f6d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/undeploymodel/SyncUndeployModelStringStringMapstringinteger.java @@ -0,0 +1,49 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_UndeployModel_StringStringMapstringinteger_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.UndeployModelResponse; +import java.util.HashMap; +import java.util.Map; + +public class SyncUndeployModelStringStringMapstringinteger { + + public static void main(String[] args) throws Exception { + syncUndeployModelStringStringMapstringinteger(); + } + + public static void syncUndeployModelStringStringMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + UndeployModelResponse response = + endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_UndeployModel_StringStringMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/updateendpoint/AsyncUpdateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/updateendpoint/AsyncUpdateEndpoint.java new file mode 100644 index 000000000000..764722314bc5 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/updateendpoint/AsyncUpdateEndpoint.java @@ -0,0 +1,51 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_UpdateEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.UpdateEndpointRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateEndpoint { + + public static void main(String[] args) throws Exception { + asyncUpdateEndpoint(); + } + + public static void asyncUpdateEndpoint() throws Exception { + // 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 future = + endpointServiceClient.updateEndpointCallable().futureCall(request); + // Do something. + Endpoint response = future.get(); + } + } +} +// [END aiplatform_v1_generated_EndpointService_UpdateEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/updateendpoint/SyncUpdateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/updateendpoint/SyncUpdateEndpoint.java new file mode 100644 index 000000000000..bf205f5358c6 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/updateendpoint/SyncUpdateEndpoint.java @@ -0,0 +1,47 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_UpdateEndpoint_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.cloud.vertexai.v1.UpdateEndpointRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateEndpoint { + + public static void main(String[] args) throws Exception { + syncUpdateEndpoint(); + } + + public static void syncUpdateEndpoint() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_EndpointService_UpdateEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/updateendpoint/SyncUpdateEndpointEndpointFieldmask.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/updateendpoint/SyncUpdateEndpointEndpointFieldmask.java new file mode 100644 index 000000000000..3a8021dc679d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservice/updateendpoint/SyncUpdateEndpointEndpointFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointService_UpdateEndpoint_EndpointFieldmask_sync] +import com.google.cloud.vertexai.v1.Endpoint; +import com.google.cloud.vertexai.v1.EndpointServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateEndpointEndpointFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateEndpointEndpointFieldmask(); + } + + public static void syncUpdateEndpointEndpointFieldmask() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_EndpointService_UpdateEndpoint_EndpointFieldmask_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservicesettings/getendpoint/SyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservicesettings/getendpoint/SyncGetEndpoint.java new file mode 100644 index 000000000000..c034cfbcc444 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/endpointservicesettings/getendpoint/SyncGetEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_EndpointServiceSettings_GetEndpoint_sync] +import com.google.cloud.vertexai.v1.EndpointServiceSettings; +import java.time.Duration; + +public class SyncGetEndpoint { + + public static void main(String[] args) throws Exception { + syncGetEndpoint(); + } + + public static void syncGetEndpoint() throws Exception { + // 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(); + } +} +// [END aiplatform_v1_generated_EndpointServiceSettings_GetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/create/SyncCreateSetCredentialsProvider.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..772c36076536 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.cloud.vertexai.v1.PredictionServiceSettings; +import com.google.cloud.vertexai.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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); + } +} +// [END aiplatform_v1_generated_PredictionService_Create_SetCredentialsProvider_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/create/SyncCreateSetCredentialsProvider1.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..0d73ba4b991f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.cloud.vertexai.v1.PredictionServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // 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); + } +} +// [END aiplatform_v1_generated_PredictionService_Create_SetCredentialsProvider1_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/create/SyncCreateSetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..dc76a4a596da --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Create_SetEndpoint_sync] +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.cloud.vertexai.v1.PredictionServiceSettings; +import com.google.cloud.vertexai.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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); + } +} +// [END aiplatform_v1_generated_PredictionService_Create_SetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directpredict/AsyncDirectPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directpredict/AsyncDirectPredict.java new file mode 100644 index 000000000000..5f2de24af999 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directpredict/AsyncDirectPredict.java @@ -0,0 +1,57 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_DirectPredict_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.DirectPredictRequest; +import com.google.cloud.vertexai.v1.DirectPredictResponse; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.cloud.vertexai.v1.Tensor; +import java.util.ArrayList; + +public class AsyncDirectPredict { + + public static void main(String[] args) throws Exception { + asyncDirectPredict(); + } + + public static void asyncDirectPredict() throws Exception { + // 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()) + .setParameters(Tensor.newBuilder().build()) + .build(); + ApiFuture future = + predictionServiceClient.directPredictCallable().futureCall(request); + // Do something. + DirectPredictResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_PredictionService_DirectPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directpredict/SyncDirectPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directpredict/SyncDirectPredict.java new file mode 100644 index 000000000000..e1e26edb6df8 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directpredict/SyncDirectPredict.java @@ -0,0 +1,53 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_DirectPredict_sync] +import com.google.cloud.vertexai.v1.DirectPredictRequest; +import com.google.cloud.vertexai.v1.DirectPredictResponse; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.cloud.vertexai.v1.Tensor; +import java.util.ArrayList; + +public class SyncDirectPredict { + + public static void main(String[] args) throws Exception { + syncDirectPredict(); + } + + public static void syncDirectPredict() throws Exception { + // 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()) + .setParameters(Tensor.newBuilder().build()) + .build(); + DirectPredictResponse response = predictionServiceClient.directPredict(request); + } + } +} +// [END aiplatform_v1_generated_PredictionService_DirectPredict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directrawpredict/AsyncDirectRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directrawpredict/AsyncDirectRawPredict.java new file mode 100644 index 000000000000..62aa9b878d0d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directrawpredict/AsyncDirectRawPredict.java @@ -0,0 +1,56 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_DirectRawPredict_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.DirectRawPredictRequest; +import com.google.cloud.vertexai.v1.DirectRawPredictResponse; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.protobuf.ByteString; + +public class AsyncDirectRawPredict { + + public static void main(String[] args) throws Exception { + asyncDirectRawPredict(); + } + + public static void asyncDirectRawPredict() throws Exception { + // 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 future = + predictionServiceClient.directRawPredictCallable().futureCall(request); + // Do something. + DirectRawPredictResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_PredictionService_DirectRawPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directrawpredict/SyncDirectRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directrawpredict/SyncDirectRawPredict.java new file mode 100644 index 000000000000..9634f2885144 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/directrawpredict/SyncDirectRawPredict.java @@ -0,0 +1,52 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_DirectRawPredict_sync] +import com.google.cloud.vertexai.v1.DirectRawPredictRequest; +import com.google.cloud.vertexai.v1.DirectRawPredictResponse; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.protobuf.ByteString; + +public class SyncDirectRawPredict { + + public static void main(String[] args) throws Exception { + syncDirectRawPredict(); + } + + public static void syncDirectRawPredict() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_PredictionService_DirectRawPredict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/AsyncExplain.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/AsyncExplain.java new file mode 100644 index 000000000000..94f8d70335c5 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/AsyncExplain.java @@ -0,0 +1,60 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Explain_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.ExplainRequest; +import com.google.cloud.vertexai.v1.ExplainResponse; +import com.google.cloud.vertexai.v1.ExplanationSpecOverride; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class AsyncExplain { + + public static void main(String[] args) throws Exception { + asyncExplain(); + } + + public static void asyncExplain() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .setExplanationSpecOverride(ExplanationSpecOverride.newBuilder().build()) + .setDeployedModelId("deployedModelId-1817547906") + .build(); + ApiFuture future = + predictionServiceClient.explainCallable().futureCall(request); + // Do something. + ExplainResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_PredictionService_Explain_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/SyncExplain.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/SyncExplain.java new file mode 100644 index 000000000000..5ba59079caab --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/SyncExplain.java @@ -0,0 +1,56 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Explain_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.ExplainRequest; +import com.google.cloud.vertexai.v1.ExplainResponse; +import com.google.cloud.vertexai.v1.ExplanationSpecOverride; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class SyncExplain { + + public static void main(String[] args) throws Exception { + syncExplain(); + } + + public static void syncExplain() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .setExplanationSpecOverride(ExplanationSpecOverride.newBuilder().build()) + .setDeployedModelId("deployedModelId-1817547906") + .build(); + ExplainResponse response = predictionServiceClient.explain(request); + } + } +} +// [END aiplatform_v1_generated_PredictionService_Explain_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/SyncExplainEndpointnameListvalueValueString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/SyncExplainEndpointnameListvalueValueString.java new file mode 100644 index 000000000000..1402fc5244e4 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/SyncExplainEndpointnameListvalueValueString.java @@ -0,0 +1,50 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Explain_EndpointnameListvalueValueString_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.ExplainResponse; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncExplainEndpointnameListvalueValueString { + + public static void main(String[] args) throws Exception { + syncExplainEndpointnameListvalueValueString(); + } + + public static void syncExplainEndpointnameListvalueValueString() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + ExplainResponse response = + predictionServiceClient.explain(endpoint, instances, parameters, deployedModelId); + } + } +} +// [END aiplatform_v1_generated_PredictionService_Explain_EndpointnameListvalueValueString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/SyncExplainStringListvalueValueString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/SyncExplainStringListvalueValueString.java new file mode 100644 index 000000000000..c6620d595d57 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/explain/SyncExplainStringListvalueValueString.java @@ -0,0 +1,51 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Explain_StringListvalueValueString_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.ExplainResponse; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncExplainStringListvalueValueString { + + public static void main(String[] args) throws Exception { + syncExplainStringListvalueValueString(); + } + + public static void syncExplainStringListvalueValueString() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + ExplainResponse response = + predictionServiceClient.explain(endpoint, instances, parameters, deployedModelId); + } + } +} +// [END aiplatform_v1_generated_PredictionService_Explain_StringListvalueValueString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getiampolicy/AsyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..fc3a71341f40 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,54 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // 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 future = predictionServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1_generated_PredictionService_GetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getiampolicy/SyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..102b54ef8e8c --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_GetIamPolicy_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_PredictionService_GetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getlocation/AsyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..fe5559948283 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,46 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1.PredictionServiceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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 future = + predictionServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END aiplatform_v1_generated_PredictionService_GetLocation_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getlocation/SyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..ecb7876ed28d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1.PredictionServiceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_PredictionService_GetLocation_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/listlocations/AsyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..75884ca0289a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1.PredictionServiceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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 future = + predictionServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_PredictionService_ListLocations_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/listlocations/AsyncListLocationsPaged.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..6f6bf88d94f5 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END aiplatform_v1_generated_PredictionService_ListLocations_Paged_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/listlocations/SyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..64e8d4426e21 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1.PredictionServiceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1_generated_PredictionService_ListLocations_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/AsyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/AsyncPredict.java new file mode 100644 index 000000000000..d1e51047d17a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/AsyncPredict.java @@ -0,0 +1,57 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Predict_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictRequest; +import com.google.cloud.vertexai.v1.PredictResponse; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class AsyncPredict { + + public static void main(String[] args) throws Exception { + asyncPredict(); + } + + public static void asyncPredict() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .build(); + ApiFuture future = + predictionServiceClient.predictCallable().futureCall(request); + // Do something. + PredictResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_PredictionService_Predict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/SyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/SyncPredict.java new file mode 100644 index 000000000000..454b25dd1b0e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/SyncPredict.java @@ -0,0 +1,53 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Predict_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictRequest; +import com.google.cloud.vertexai.v1.PredictResponse; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class SyncPredict { + + public static void main(String[] args) throws Exception { + syncPredict(); + } + + public static void syncPredict() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .build(); + PredictResponse response = predictionServiceClient.predict(request); + } + } +} +// [END aiplatform_v1_generated_PredictionService_Predict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/SyncPredictEndpointnameListvalueValue.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/SyncPredictEndpointnameListvalueValue.java new file mode 100644 index 000000000000..aa3d3e87f4f2 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/SyncPredictEndpointnameListvalueValue.java @@ -0,0 +1,48 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Predict_EndpointnameListvalueValue_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictResponse; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncPredictEndpointnameListvalueValue { + + public static void main(String[] args) throws Exception { + syncPredictEndpointnameListvalueValue(); + } + + public static void syncPredictEndpointnameListvalueValue() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters); + } + } +} +// [END aiplatform_v1_generated_PredictionService_Predict_EndpointnameListvalueValue_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/SyncPredictStringListvalueValue.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/SyncPredictStringListvalueValue.java new file mode 100644 index 000000000000..4c0bd1847f57 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/predict/SyncPredictStringListvalueValue.java @@ -0,0 +1,49 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_Predict_StringListvalueValue_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictResponse; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncPredictStringListvalueValue { + + public static void main(String[] args) throws Exception { + syncPredictStringListvalueValue(); + } + + public static void syncPredictStringListvalueValue() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters); + } + } +} +// [END aiplatform_v1_generated_PredictionService_Predict_StringListvalueValue_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/AsyncRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/AsyncRawPredict.java new file mode 100644 index 000000000000..d06897f4cbe8 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/AsyncRawPredict.java @@ -0,0 +1,53 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_RawPredict_async] +import com.google.api.HttpBody; +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.cloud.vertexai.v1.RawPredictRequest; + +public class AsyncRawPredict { + + public static void main(String[] args) throws Exception { + asyncRawPredict(); + } + + public static void asyncRawPredict() throws Exception { + // 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 future = predictionServiceClient.rawPredictCallable().futureCall(request); + // Do something. + HttpBody response = future.get(); + } + } +} +// [END aiplatform_v1_generated_PredictionService_RawPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/SyncRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/SyncRawPredict.java new file mode 100644 index 000000000000..db17a3bfe361 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/SyncRawPredict.java @@ -0,0 +1,50 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_RawPredict_sync] +import com.google.api.HttpBody; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.cloud.vertexai.v1.RawPredictRequest; + +public class SyncRawPredict { + + public static void main(String[] args) throws Exception { + syncRawPredict(); + } + + public static void syncRawPredict() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_PredictionService_RawPredict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/SyncRawPredictEndpointnameHttpbody.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/SyncRawPredictEndpointnameHttpbody.java new file mode 100644 index 000000000000..e4c54e3313cf --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/SyncRawPredictEndpointnameHttpbody.java @@ -0,0 +1,44 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_RawPredict_EndpointnameHttpbody_sync] +import com.google.api.HttpBody; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; + +public class SyncRawPredictEndpointnameHttpbody { + + public static void main(String[] args) throws Exception { + syncRawPredictEndpointnameHttpbody(); + } + + public static void syncRawPredictEndpointnameHttpbody() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_PredictionService_RawPredict_EndpointnameHttpbody_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/SyncRawPredictStringHttpbody.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/SyncRawPredictStringHttpbody.java new file mode 100644 index 000000000000..a8b8424a0218 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/rawpredict/SyncRawPredictStringHttpbody.java @@ -0,0 +1,45 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_RawPredict_StringHttpbody_sync] +import com.google.api.HttpBody; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; + +public class SyncRawPredictStringHttpbody { + + public static void main(String[] args) throws Exception { + syncRawPredictStringHttpbody(); + } + + public static void syncRawPredictStringHttpbody() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_PredictionService_RawPredict_StringHttpbody_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/serverstreamingpredict/AsyncServerStreamingPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/serverstreamingpredict/AsyncServerStreamingPredict.java new file mode 100644 index 000000000000..3cf2461741e9 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/serverstreamingpredict/AsyncServerStreamingPredict.java @@ -0,0 +1,58 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_ServerStreamingPredict_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.cloud.vertexai.v1.StreamingPredictRequest; +import com.google.cloud.vertexai.v1.StreamingPredictResponse; +import com.google.cloud.vertexai.v1.Tensor; +import java.util.ArrayList; + +public class AsyncServerStreamingPredict { + + public static void main(String[] args) throws Exception { + asyncServerStreamingPredict(); + } + + public static void asyncServerStreamingPredict() throws Exception { + // 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()) + .setParameters(Tensor.newBuilder().build()) + .build(); + ServerStream stream = + predictionServiceClient.serverStreamingPredictCallable().call(request); + for (StreamingPredictResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1_generated_PredictionService_ServerStreamingPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/setiampolicy/AsyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..9169862fc6d1 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,55 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // 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 future = predictionServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1_generated_PredictionService_SetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/setiampolicy/SyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..d9669eec1952 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_SetIamPolicy_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1_generated_PredictionService_SetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/streamingpredict/AsyncStreamingPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/streamingpredict/AsyncStreamingPredict.java new file mode 100644 index 000000000000..7d9f922d5bcf --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/streamingpredict/AsyncStreamingPredict.java @@ -0,0 +1,59 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_StreamingPredict_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.cloud.vertexai.v1.StreamingPredictRequest; +import com.google.cloud.vertexai.v1.StreamingPredictResponse; +import com.google.cloud.vertexai.v1.Tensor; +import java.util.ArrayList; + +public class AsyncStreamingPredict { + + public static void main(String[] args) throws Exception { + asyncStreamingPredict(); + } + + public static void asyncStreamingPredict() throws Exception { + // 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 bidiStream = + predictionServiceClient.streamingPredictCallable().call(); + StreamingPredictRequest request = + StreamingPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + bidiStream.send(request); + for (StreamingPredictResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1_generated_PredictionService_StreamingPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/streamingrawpredict/AsyncStreamingRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/streamingrawpredict/AsyncStreamingRawPredict.java new file mode 100644 index 000000000000..ba92f178d755 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/streamingrawpredict/AsyncStreamingRawPredict.java @@ -0,0 +1,58 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_StreamingRawPredict_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.cloud.vertexai.v1.StreamingRawPredictRequest; +import com.google.cloud.vertexai.v1.StreamingRawPredictResponse; +import com.google.protobuf.ByteString; + +public class AsyncStreamingRawPredict { + + public static void main(String[] args) throws Exception { + asyncStreamingRawPredict(); + } + + public static void asyncStreamingRawPredict() throws Exception { + // 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 bidiStream = + predictionServiceClient.streamingRawPredictCallable().call(); + StreamingRawPredictRequest request = + StreamingRawPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setMethodName("methodName-723163380") + .setInput(ByteString.EMPTY) + .build(); + bidiStream.send(request); + for (StreamingRawPredictResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1_generated_PredictionService_StreamingRawPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/testiampermissions/AsyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..e40e94f44e46 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,55 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // 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()) + .build(); + ApiFuture future = + predictionServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_PredictionService_TestIamPermissions_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/testiampermissions/SyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..c153b53b2923 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,51 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionService_TestIamPermissions_sync] +import com.google.cloud.vertexai.v1.EndpointName; +import com.google.cloud.vertexai.v1.PredictionServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // 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()) + .build(); + TestIamPermissionsResponse response = predictionServiceClient.testIamPermissions(request); + } + } +} +// [END aiplatform_v1_generated_PredictionService_TestIamPermissions_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservicesettings/predict/SyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservicesettings/predict/SyncPredict.java new file mode 100644 index 000000000000..127950498ada --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/predictionservicesettings/predict/SyncPredict.java @@ -0,0 +1,49 @@ +/* + * 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.v1.samples; + +// [START aiplatform_v1_generated_PredictionServiceSettings_Predict_sync] +import com.google.cloud.vertexai.v1.PredictionServiceSettings; +import java.time.Duration; + +public class SyncPredict { + + public static void main(String[] args) throws Exception { + syncPredict(); + } + + public static void syncPredict() throws Exception { + // 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(); + } +} +// [END aiplatform_v1_generated_PredictionServiceSettings_Predict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/stub/endpointservicestubsettings/getendpoint/SyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/stub/endpointservicestubsettings/getendpoint/SyncGetEndpoint.java new file mode 100644 index 000000000000..7396dc248cad --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/stub/endpointservicestubsettings/getendpoint/SyncGetEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.v1.stub.samples; + +// [START aiplatform_v1_generated_EndpointServiceStubSettings_GetEndpoint_sync] +import com.google.cloud.vertexai.v1.stub.EndpointServiceStubSettings; +import java.time.Duration; + +public class SyncGetEndpoint { + + public static void main(String[] args) throws Exception { + syncGetEndpoint(); + } + + public static void syncGetEndpoint() throws Exception { + // 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(); + } +} +// [END aiplatform_v1_generated_EndpointServiceStubSettings_GetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/stub/predictionservicestubsettings/predict/SyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/stub/predictionservicestubsettings/predict/SyncPredict.java new file mode 100644 index 000000000000..22a2c3eabfa0 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1/stub/predictionservicestubsettings/predict/SyncPredict.java @@ -0,0 +1,50 @@ +/* + * 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.v1.stub.samples; + +// [START aiplatform_v1_generated_PredictionServiceStubSettings_Predict_sync] +import com.google.cloud.vertexai.v1.stub.PredictionServiceStubSettings; +import java.time.Duration; + +public class SyncPredict { + + public static void main(String[] args) throws Exception { + syncPredict(); + } + + public static void syncPredict() throws Exception { + // 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 + PredictionServiceStubSettings.Builder predictionServiceSettingsBuilder = + PredictionServiceStubSettings.newBuilder(); + predictionServiceSettingsBuilder + .predictSettings() + .setRetrySettings( + predictionServiceSettingsBuilder + .predictSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + PredictionServiceStubSettings predictionServiceSettings = + predictionServiceSettingsBuilder.build(); + } +} +// [END aiplatform_v1_generated_PredictionServiceStubSettings_Predict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/create/SyncCreateSetCredentialsProvider.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..e8cc1cf9c361 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.EndpointServiceSettings; +import com.google.cloud.vertexai.v1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_EndpointService_Create_SetCredentialsProvider_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/create/SyncCreateSetCredentialsProvider1.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..1007c5707b07 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.EndpointServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_EndpointService_Create_SetCredentialsProvider1_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/create/SyncCreateSetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..c9fcb7a14b41 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_Create_SetEndpoint_sync] +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.EndpointServiceSettings; +import com.google.cloud.vertexai.v1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_EndpointService_Create_SetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/AsyncCreateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/AsyncCreateEndpoint.java new file mode 100644 index 000000000000..e3946fbf558e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/AsyncCreateEndpoint.java @@ -0,0 +1,53 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.CreateEndpointRequest; +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateEndpoint { + + public static void main(String[] args) throws Exception { + asyncCreateEndpoint(); + } + + public static void asyncCreateEndpoint() throws Exception { + // 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 future = + endpointServiceClient.createEndpointCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/AsyncCreateEndpointLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/AsyncCreateEndpointLRO.java new file mode 100644 index 000000000000..b6e77608b74e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/AsyncCreateEndpointLRO.java @@ -0,0 +1,53 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.v1beta1.CreateEndpointOperationMetadata; +import com.google.cloud.vertexai.v1beta1.CreateEndpointRequest; +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.LocationName; + +public class AsyncCreateEndpointLRO { + + public static void main(String[] args) throws Exception { + asyncCreateEndpointLRO(); + } + + public static void asyncCreateEndpointLRO() throws Exception { + // 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 future = + endpointServiceClient.createEndpointOperationCallable().futureCall(request); + // Do something. + Endpoint response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpoint.java new file mode 100644 index 000000000000..293d20905e81 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpoint.java @@ -0,0 +1,48 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_sync] +import com.google.cloud.vertexai.v1beta1.CreateEndpointRequest; +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.LocationName; + +public class SyncCreateEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateEndpoint(); + } + + public static void syncCreateEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpoint.java new file mode 100644 index 000000000000..eca87e8e0709 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpoint.java @@ -0,0 +1,43 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LocationnameEndpoint_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.LocationName; + +public class SyncCreateEndpointLocationnameEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateEndpointLocationnameEndpoint(); + } + + public static void syncCreateEndpointLocationnameEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LocationnameEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpointString.java new file mode 100644 index 000000000000..395f864eb194 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointLocationnameEndpointString.java @@ -0,0 +1,45 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LocationnameEndpointString_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.LocationName; + +public class SyncCreateEndpointLocationnameEndpointString { + + public static void main(String[] args) throws Exception { + syncCreateEndpointLocationnameEndpointString(); + } + + public static void syncCreateEndpointLocationnameEndpointString() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_LocationnameEndpointString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointStringEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointStringEndpoint.java new file mode 100644 index 000000000000..45b63c5def19 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointStringEndpoint.java @@ -0,0 +1,43 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_StringEndpoint_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.LocationName; + +public class SyncCreateEndpointStringEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateEndpointStringEndpoint(); + } + + public static void syncCreateEndpointStringEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_StringEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointStringEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointStringEndpointString.java new file mode 100644 index 000000000000..ec96fbda42c5 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/createendpoint/SyncCreateEndpointStringEndpointString.java @@ -0,0 +1,45 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_StringEndpointString_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.LocationName; + +public class SyncCreateEndpointStringEndpointString { + + public static void main(String[] args) throws Exception { + syncCreateEndpointStringEndpointString(); + } + + public static void syncCreateEndpointStringEndpointString() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_StringEndpointString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/AsyncDeleteEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/AsyncDeleteEndpoint.java new file mode 100644 index 000000000000..64c2b8cef169 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/AsyncDeleteEndpoint.java @@ -0,0 +1,53 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.DeleteEndpointRequest; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteEndpoint { + + public static void main(String[] args) throws Exception { + asyncDeleteEndpoint(); + } + + public static void asyncDeleteEndpoint() throws Exception { + // 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 future = + endpointServiceClient.deleteEndpointCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/AsyncDeleteEndpointLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/AsyncDeleteEndpointLRO.java new file mode 100644 index 000000000000..21b0638353b6 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/AsyncDeleteEndpointLRO.java @@ -0,0 +1,54 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.v1beta1.DeleteEndpointRequest; +import com.google.cloud.vertexai.v1beta1.DeleteOperationMetadata; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteEndpointLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteEndpointLRO(); + } + + public static void asyncDeleteEndpointLRO() throws Exception { + // 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 future = + endpointServiceClient.deleteEndpointOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/SyncDeleteEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/SyncDeleteEndpoint.java new file mode 100644 index 000000000000..878b4b103d32 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/SyncDeleteEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_sync] +import com.google.cloud.vertexai.v1beta1.DeleteEndpointRequest; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEndpoint { + + public static void main(String[] args) throws Exception { + syncDeleteEndpoint(); + } + + public static void syncDeleteEndpoint() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/SyncDeleteEndpointEndpointname.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/SyncDeleteEndpointEndpointname.java new file mode 100644 index 000000000000..45da6d659791 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/SyncDeleteEndpointEndpointname.java @@ -0,0 +1,43 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_Endpointname_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEndpointEndpointname { + + public static void main(String[] args) throws Exception { + syncDeleteEndpointEndpointname(); + } + + public static void syncDeleteEndpointEndpointname() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_Endpointname_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/SyncDeleteEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/SyncDeleteEndpointString.java new file mode 100644 index 000000000000..c9b7e4b1ea34 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deleteendpoint/SyncDeleteEndpointString.java @@ -0,0 +1,44 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_String_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteEndpointString { + + public static void main(String[] args) throws Exception { + syncDeleteEndpointString(); + } + + public static void syncDeleteEndpointString() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_String_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/AsyncDeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/AsyncDeployModel.java new file mode 100644 index 000000000000..74d5e45248ad --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/AsyncDeployModel.java @@ -0,0 +1,56 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeployModel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.DeployModelRequest; +import com.google.cloud.vertexai.v1beta1.DeployedModel; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.longrunning.Operation; +import java.util.HashMap; + +public class AsyncDeployModel { + + public static void main(String[] args) throws Exception { + asyncDeployModel(); + } + + public static void asyncDeployModel() throws Exception { + // 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()) + .build(); + ApiFuture future = endpointServiceClient.deployModelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeployModel_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/AsyncDeployModelLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/AsyncDeployModelLRO.java new file mode 100644 index 000000000000..12e1e55fba6c --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/AsyncDeployModelLRO.java @@ -0,0 +1,58 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeployModel_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.v1beta1.DeployModelOperationMetadata; +import com.google.cloud.vertexai.v1beta1.DeployModelRequest; +import com.google.cloud.vertexai.v1beta1.DeployModelResponse; +import com.google.cloud.vertexai.v1beta1.DeployedModel; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import java.util.HashMap; + +public class AsyncDeployModelLRO { + + public static void main(String[] args) throws Exception { + asyncDeployModelLRO(); + } + + public static void asyncDeployModelLRO() throws Exception { + // 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()) + .build(); + OperationFuture future = + endpointServiceClient.deployModelOperationCallable().futureCall(request); + // Do something. + DeployModelResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeployModel_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/SyncDeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/SyncDeployModel.java new file mode 100644 index 000000000000..e718707e5959 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/SyncDeployModel.java @@ -0,0 +1,53 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeployModel_sync] +import com.google.cloud.vertexai.v1beta1.DeployModelRequest; +import com.google.cloud.vertexai.v1beta1.DeployModelResponse; +import com.google.cloud.vertexai.v1beta1.DeployedModel; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import java.util.HashMap; + +public class SyncDeployModel { + + public static void main(String[] args) throws Exception { + syncDeployModel(); + } + + public static void syncDeployModel() throws Exception { + // 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()) + .build(); + DeployModelResponse response = endpointServiceClient.deployModelAsync(request).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeployModel_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/SyncDeployModelEndpointnameDeployedmodelMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/SyncDeployModelEndpointnameDeployedmodelMapstringinteger.java new file mode 100644 index 000000000000..7988cbae46fe --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/SyncDeployModelEndpointnameDeployedmodelMapstringinteger.java @@ -0,0 +1,49 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeployModel_EndpointnameDeployedmodelMapstringinteger_sync] +import com.google.cloud.vertexai.v1beta1.DeployModelResponse; +import com.google.cloud.vertexai.v1beta1.DeployedModel; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import java.util.HashMap; +import java.util.Map; + +public class SyncDeployModelEndpointnameDeployedmodelMapstringinteger { + + public static void main(String[] args) throws Exception { + syncDeployModelEndpointnameDeployedmodelMapstringinteger(); + } + + public static void syncDeployModelEndpointnameDeployedmodelMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + DeployModelResponse response = + endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeployModel_EndpointnameDeployedmodelMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/SyncDeployModelStringDeployedmodelMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/SyncDeployModelStringDeployedmodelMapstringinteger.java new file mode 100644 index 000000000000..b3c08e08167e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/deploymodel/SyncDeployModelStringDeployedmodelMapstringinteger.java @@ -0,0 +1,50 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_DeployModel_StringDeployedmodelMapstringinteger_sync] +import com.google.cloud.vertexai.v1beta1.DeployModelResponse; +import com.google.cloud.vertexai.v1beta1.DeployedModel; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import java.util.HashMap; +import java.util.Map; + +public class SyncDeployModelStringDeployedmodelMapstringinteger { + + public static void main(String[] args) throws Exception { + syncDeployModelStringDeployedmodelMapstringinteger(); + } + + public static void syncDeployModelStringDeployedmodelMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + DeployModelResponse response = + endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_DeployModel_StringDeployedmodelMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/AsyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/AsyncGetEndpoint.java new file mode 100644 index 000000000000..8bbf3d1c0a66 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/AsyncGetEndpoint.java @@ -0,0 +1,52 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.GetEndpointRequest; + +public class AsyncGetEndpoint { + + public static void main(String[] args) throws Exception { + asyncGetEndpoint(); + } + + public static void asyncGetEndpoint() throws Exception { + // 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 future = endpointServiceClient.getEndpointCallable().futureCall(request); + // Do something. + Endpoint response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/SyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/SyncGetEndpoint.java new file mode 100644 index 000000000000..eb0f13d63492 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/SyncGetEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetEndpoint_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.GetEndpointRequest; + +public class SyncGetEndpoint { + + public static void main(String[] args) throws Exception { + syncGetEndpoint(); + } + + public static void syncGetEndpoint() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/SyncGetEndpointEndpointname.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/SyncGetEndpointEndpointname.java new file mode 100644 index 000000000000..f90a64d71b47 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/SyncGetEndpointEndpointname.java @@ -0,0 +1,43 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetEndpoint_Endpointname_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; + +public class SyncGetEndpointEndpointname { + + public static void main(String[] args) throws Exception { + syncGetEndpointEndpointname(); + } + + public static void syncGetEndpointEndpointname() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetEndpoint_Endpointname_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/SyncGetEndpointString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/SyncGetEndpointString.java new file mode 100644 index 000000000000..7a98386e06a3 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getendpoint/SyncGetEndpointString.java @@ -0,0 +1,44 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetEndpoint_String_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; + +public class SyncGetEndpointString { + + public static void main(String[] args) throws Exception { + syncGetEndpointString(); + } + + public static void syncGetEndpointString() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetEndpoint_String_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getiampolicy/AsyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..9d0d409fad45 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,54 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // 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 future = endpointServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getiampolicy/SyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..1a5e9a43251f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetIamPolicy_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getlocation/AsyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..cb54b3f5307d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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 future = endpointServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetLocation_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getlocation/SyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..37ebbb809ee5 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_GetLocation_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/AsyncListEndpoints.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/AsyncListEndpoints.java new file mode 100644 index 000000000000..512231d728c3 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/AsyncListEndpoints.java @@ -0,0 +1,57 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListEndpoints_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.ListEndpointsRequest; +import com.google.cloud.vertexai.v1beta1.LocationName; +import com.google.protobuf.FieldMask; + +public class AsyncListEndpoints { + + public static void main(String[] args) throws Exception { + asyncListEndpoints(); + } + + public static void asyncListEndpoints() throws Exception { + // 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 future = + endpointServiceClient.listEndpointsPagedCallable().futureCall(request); + // Do something. + for (Endpoint element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListEndpoints_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/AsyncListEndpointsPaged.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/AsyncListEndpointsPaged.java new file mode 100644 index 000000000000..23db566b64c4 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/AsyncListEndpointsPaged.java @@ -0,0 +1,65 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListEndpoints_Paged_async] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.ListEndpointsRequest; +import com.google.cloud.vertexai.v1beta1.ListEndpointsResponse; +import com.google.cloud.vertexai.v1beta1.LocationName; +import com.google.common.base.Strings; +import com.google.protobuf.FieldMask; + +public class AsyncListEndpointsPaged { + + public static void main(String[] args) throws Exception { + asyncListEndpointsPaged(); + } + + public static void asyncListEndpointsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListEndpoints_Paged_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/SyncListEndpoints.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/SyncListEndpoints.java new file mode 100644 index 000000000000..03ad703a0dcf --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/SyncListEndpoints.java @@ -0,0 +1,53 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListEndpoints_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.ListEndpointsRequest; +import com.google.cloud.vertexai.v1beta1.LocationName; +import com.google.protobuf.FieldMask; + +public class SyncListEndpoints { + + public static void main(String[] args) throws Exception { + syncListEndpoints(); + } + + public static void syncListEndpoints() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListEndpoints_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/SyncListEndpointsLocationname.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/SyncListEndpointsLocationname.java new file mode 100644 index 000000000000..57e7a372f6b7 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/SyncListEndpointsLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListEndpoints_Locationname_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.LocationName; + +public class SyncListEndpointsLocationname { + + public static void main(String[] args) throws Exception { + syncListEndpointsLocationname(); + } + + public static void syncListEndpointsLocationname() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListEndpoints_Locationname_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/SyncListEndpointsString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/SyncListEndpointsString.java new file mode 100644 index 000000000000..ede8c4a2daac --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listendpoints/SyncListEndpointsString.java @@ -0,0 +1,44 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListEndpoints_String_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.LocationName; + +public class SyncListEndpointsString { + + public static void main(String[] args) throws Exception { + syncListEndpointsString(); + } + + public static void syncListEndpointsString() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListEndpoints_String_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listlocations/AsyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..abdfa028b26e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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 future = + endpointServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListLocations_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listlocations/AsyncListLocationsPaged.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..6171a3b28216 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListLocations_Paged_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listlocations/SyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..5f266b2e8151 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_ListLocations_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModel.java new file mode 100644 index 000000000000..99458c492f69 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModel.java @@ -0,0 +1,57 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.DeployedModel; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.MutateDeployedModelRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncMutateDeployedModel { + + public static void main(String[] args) throws Exception { + asyncMutateDeployedModel(); + } + + public static void asyncMutateDeployedModel() throws Exception { + // 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 future = + endpointServiceClient.mutateDeployedModelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModelLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModelLRO.java new file mode 100644 index 000000000000..34f5553c4da3 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/AsyncMutateDeployedModelLRO.java @@ -0,0 +1,58 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.v1beta1.DeployedModel; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.MutateDeployedModelOperationMetadata; +import com.google.cloud.vertexai.v1beta1.MutateDeployedModelRequest; +import com.google.cloud.vertexai.v1beta1.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class AsyncMutateDeployedModelLRO { + + public static void main(String[] args) throws Exception { + asyncMutateDeployedModelLRO(); + } + + public static void asyncMutateDeployedModelLRO() throws Exception { + // 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 future = + endpointServiceClient.mutateDeployedModelOperationCallable().futureCall(request); + // Do something. + MutateDeployedModelResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModel.java new file mode 100644 index 000000000000..b416acc5e4da --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModel.java @@ -0,0 +1,54 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_sync] +import com.google.cloud.vertexai.v1beta1.DeployedModel; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.MutateDeployedModelRequest; +import com.google.cloud.vertexai.v1beta1.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class SyncMutateDeployedModel { + + public static void main(String[] args) throws Exception { + syncMutateDeployedModel(); + } + + public static void syncMutateDeployedModel() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask.java new file mode 100644 index 000000000000..356d75221ce7 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask.java @@ -0,0 +1,48 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_EndpointnameDeployedmodelFieldmask_sync] +import com.google.cloud.vertexai.v1beta1.DeployedModel; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class SyncMutateDeployedModelEndpointnameDeployedmodelFieldmask { + + public static void main(String[] args) throws Exception { + syncMutateDeployedModelEndpointnameDeployedmodelFieldmask(); + } + + public static void syncMutateDeployedModelEndpointnameDeployedmodelFieldmask() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_EndpointnameDeployedmodelFieldmask_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelStringDeployedmodelFieldmask.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelStringDeployedmodelFieldmask.java new file mode 100644 index 000000000000..25fba4060fad --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/mutatedeployedmodel/SyncMutateDeployedModelStringDeployedmodelFieldmask.java @@ -0,0 +1,49 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_StringDeployedmodelFieldmask_sync] +import com.google.cloud.vertexai.v1beta1.DeployedModel; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.MutateDeployedModelResponse; +import com.google.protobuf.FieldMask; + +public class SyncMutateDeployedModelStringDeployedmodelFieldmask { + + public static void main(String[] args) throws Exception { + syncMutateDeployedModelStringDeployedmodelFieldmask(); + } + + public static void syncMutateDeployedModelStringDeployedmodelFieldmask() throws Exception { + // 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(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_MutateDeployedModel_StringDeployedmodelFieldmask_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/setiampolicy/AsyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..d6e274f1b65e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,55 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // 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 future = endpointServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_SetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/setiampolicy/SyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..5ca8ce3b4612 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_SetIamPolicy_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_SetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/testiampermissions/AsyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..972b1b59b1da --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,55 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // 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()) + .build(); + ApiFuture future = + endpointServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_TestIamPermissions_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/testiampermissions/SyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..2f0894f19d78 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,51 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_TestIamPermissions_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // 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()) + .build(); + TestIamPermissionsResponse response = endpointServiceClient.testIamPermissions(request); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_TestIamPermissions_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/AsyncUndeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/AsyncUndeployModel.java new file mode 100644 index 000000000000..3aa114167d5d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/AsyncUndeployModel.java @@ -0,0 +1,56 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UndeployModel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.UndeployModelRequest; +import com.google.longrunning.Operation; +import java.util.HashMap; + +public class AsyncUndeployModel { + + public static void main(String[] args) throws Exception { + asyncUndeployModel(); + } + + public static void asyncUndeployModel() throws Exception { + // 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()) + .build(); + ApiFuture future = + endpointServiceClient.undeployModelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UndeployModel_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/AsyncUndeployModelLRO.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/AsyncUndeployModelLRO.java new file mode 100644 index 000000000000..6275a4527171 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/AsyncUndeployModelLRO.java @@ -0,0 +1,57 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UndeployModel_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.UndeployModelOperationMetadata; +import com.google.cloud.vertexai.v1beta1.UndeployModelRequest; +import com.google.cloud.vertexai.v1beta1.UndeployModelResponse; +import java.util.HashMap; + +public class AsyncUndeployModelLRO { + + public static void main(String[] args) throws Exception { + asyncUndeployModelLRO(); + } + + public static void asyncUndeployModelLRO() throws Exception { + // 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()) + .build(); + OperationFuture future = + endpointServiceClient.undeployModelOperationCallable().futureCall(request); + // Do something. + UndeployModelResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UndeployModel_LRO_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/SyncUndeployModel.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/SyncUndeployModel.java new file mode 100644 index 000000000000..d9e4c155f727 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/SyncUndeployModel.java @@ -0,0 +1,52 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UndeployModel_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.UndeployModelRequest; +import com.google.cloud.vertexai.v1beta1.UndeployModelResponse; +import java.util.HashMap; + +public class SyncUndeployModel { + + public static void main(String[] args) throws Exception { + syncUndeployModel(); + } + + public static void syncUndeployModel() throws Exception { + // 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()) + .build(); + UndeployModelResponse response = endpointServiceClient.undeployModelAsync(request).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UndeployModel_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/SyncUndeployModelEndpointnameStringMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/SyncUndeployModelEndpointnameStringMapstringinteger.java new file mode 100644 index 000000000000..290b66e7793e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/SyncUndeployModelEndpointnameStringMapstringinteger.java @@ -0,0 +1,48 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UndeployModel_EndpointnameStringMapstringinteger_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.UndeployModelResponse; +import java.util.HashMap; +import java.util.Map; + +public class SyncUndeployModelEndpointnameStringMapstringinteger { + + public static void main(String[] args) throws Exception { + syncUndeployModelEndpointnameStringMapstringinteger(); + } + + public static void syncUndeployModelEndpointnameStringMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + UndeployModelResponse response = + endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UndeployModel_EndpointnameStringMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/SyncUndeployModelStringStringMapstringinteger.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/SyncUndeployModelStringStringMapstringinteger.java new file mode 100644 index 000000000000..65c5c8e632a3 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/undeploymodel/SyncUndeployModelStringStringMapstringinteger.java @@ -0,0 +1,49 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UndeployModel_StringStringMapstringinteger_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.UndeployModelResponse; +import java.util.HashMap; +import java.util.Map; + +public class SyncUndeployModelStringStringMapstringinteger { + + public static void main(String[] args) throws Exception { + syncUndeployModelStringStringMapstringinteger(); + } + + public static void syncUndeployModelStringStringMapstringinteger() throws Exception { + // 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 trafficSplit = new HashMap<>(); + UndeployModelResponse response = + endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UndeployModel_StringStringMapstringinteger_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/updateendpoint/AsyncUpdateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/updateendpoint/AsyncUpdateEndpoint.java new file mode 100644 index 000000000000..bb931f38f1ac --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/updateendpoint/AsyncUpdateEndpoint.java @@ -0,0 +1,51 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.UpdateEndpointRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateEndpoint { + + public static void main(String[] args) throws Exception { + asyncUpdateEndpoint(); + } + + public static void asyncUpdateEndpoint() throws Exception { + // 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 future = + endpointServiceClient.updateEndpointCallable().futureCall(request); + // Do something. + Endpoint response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/updateendpoint/SyncUpdateEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/updateendpoint/SyncUpdateEndpoint.java new file mode 100644 index 000000000000..64c2e6a580e5 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/updateendpoint/SyncUpdateEndpoint.java @@ -0,0 +1,47 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.cloud.vertexai.v1beta1.UpdateEndpointRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateEndpoint { + + public static void main(String[] args) throws Exception { + syncUpdateEndpoint(); + } + + public static void syncUpdateEndpoint() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/updateendpoint/SyncUpdateEndpointEndpointFieldmask.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/updateendpoint/SyncUpdateEndpointEndpointFieldmask.java new file mode 100644 index 000000000000..739ea0846cfb --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservice/updateendpoint/SyncUpdateEndpointEndpointFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_EndpointFieldmask_sync] +import com.google.cloud.vertexai.v1beta1.Endpoint; +import com.google.cloud.vertexai.v1beta1.EndpointServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateEndpointEndpointFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateEndpointEndpointFieldmask(); + } + + public static void syncUpdateEndpointEndpointFieldmask() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_EndpointFieldmask_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservicesettings/getendpoint/SyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservicesettings/getendpoint/SyncGetEndpoint.java new file mode 100644 index 000000000000..81e204863b85 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/endpointservicesettings/getendpoint/SyncGetEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_EndpointServiceSettings_GetEndpoint_sync] +import com.google.cloud.vertexai.v1beta1.EndpointServiceSettings; +import java.time.Duration; + +public class SyncGetEndpoint { + + public static void main(String[] args) throws Exception { + syncGetEndpoint(); + } + + public static void syncGetEndpoint() throws Exception { + // 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(); + } +} +// [END aiplatform_v1beta1_generated_EndpointServiceSettings_GetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/AsyncCountTokens.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/AsyncCountTokens.java new file mode 100644 index 000000000000..2844d70be67b --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/AsyncCountTokens.java @@ -0,0 +1,59 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_CountTokens_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.Content; +import com.google.cloud.vertexai.v1beta1.CountTokensRequest; +import com.google.cloud.vertexai.v1beta1.CountTokensResponse; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class AsyncCountTokens { + + public static void main(String[] args) throws Exception { + asyncCountTokens(); + } + + public static void asyncCountTokens() throws Exception { + // 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()) + .addAllContents(new ArrayList()) + .build(); + ApiFuture future = + predictionServiceClient.countTokensCallable().futureCall(request); + // Do something. + CountTokensResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_CountTokens_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/SyncCountTokens.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/SyncCountTokens.java new file mode 100644 index 000000000000..63846e0bb97a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/SyncCountTokens.java @@ -0,0 +1,55 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_CountTokens_sync] +import com.google.cloud.vertexai.v1beta1.Content; +import com.google.cloud.vertexai.v1beta1.CountTokensRequest; +import com.google.cloud.vertexai.v1beta1.CountTokensResponse; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class SyncCountTokens { + + public static void main(String[] args) throws Exception { + syncCountTokens(); + } + + public static void syncCountTokens() throws Exception { + // 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()) + .addAllContents(new ArrayList()) + .build(); + CountTokensResponse response = predictionServiceClient.countTokens(request); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_CountTokens_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/SyncCountTokensEndpointnameListvalue.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/SyncCountTokensEndpointnameListvalue.java new file mode 100644 index 000000000000..ad3a48cf9f1a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/SyncCountTokensEndpointnameListvalue.java @@ -0,0 +1,47 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_CountTokens_EndpointnameListvalue_sync] +import com.google.cloud.vertexai.v1beta1.CountTokensResponse; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncCountTokensEndpointnameListvalue { + + public static void main(String[] args) throws Exception { + syncCountTokensEndpointnameListvalue(); + } + + public static void syncCountTokensEndpointnameListvalue() throws Exception { + // 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 instances = new ArrayList<>(); + CountTokensResponse response = predictionServiceClient.countTokens(endpoint, instances); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_CountTokens_EndpointnameListvalue_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/SyncCountTokensStringListvalue.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/SyncCountTokensStringListvalue.java new file mode 100644 index 000000000000..457e4a0fcf4d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/counttokens/SyncCountTokensStringListvalue.java @@ -0,0 +1,48 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_CountTokens_StringListvalue_sync] +import com.google.cloud.vertexai.v1beta1.CountTokensResponse; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncCountTokensStringListvalue { + + public static void main(String[] args) throws Exception { + syncCountTokensStringListvalue(); + } + + public static void syncCountTokensStringListvalue() throws Exception { + // 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 instances = new ArrayList<>(); + CountTokensResponse response = predictionServiceClient.countTokens(endpoint, instances); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_CountTokens_StringListvalue_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/create/SyncCreateSetCredentialsProvider.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..98bf16f97f38 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.PredictionServiceSettings; +import com.google.cloud.vertexai.v1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Create_SetCredentialsProvider_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/create/SyncCreateSetCredentialsProvider1.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..944d2ebca9a5 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.PredictionServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Create_SetCredentialsProvider1_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/create/SyncCreateSetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..17d99d1c6282 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Create_SetEndpoint_sync] +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.PredictionServiceSettings; +import com.google.cloud.vertexai.v1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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); + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Create_SetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directpredict/AsyncDirectPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directpredict/AsyncDirectPredict.java new file mode 100644 index 000000000000..027d6d9ce11e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directpredict/AsyncDirectPredict.java @@ -0,0 +1,57 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_DirectPredict_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.DirectPredictRequest; +import com.google.cloud.vertexai.v1beta1.DirectPredictResponse; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.Tensor; +import java.util.ArrayList; + +public class AsyncDirectPredict { + + public static void main(String[] args) throws Exception { + asyncDirectPredict(); + } + + public static void asyncDirectPredict() throws Exception { + // 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()) + .setParameters(Tensor.newBuilder().build()) + .build(); + ApiFuture future = + predictionServiceClient.directPredictCallable().futureCall(request); + // Do something. + DirectPredictResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_DirectPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directpredict/SyncDirectPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directpredict/SyncDirectPredict.java new file mode 100644 index 000000000000..b9490043408d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directpredict/SyncDirectPredict.java @@ -0,0 +1,53 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_DirectPredict_sync] +import com.google.cloud.vertexai.v1beta1.DirectPredictRequest; +import com.google.cloud.vertexai.v1beta1.DirectPredictResponse; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.Tensor; +import java.util.ArrayList; + +public class SyncDirectPredict { + + public static void main(String[] args) throws Exception { + syncDirectPredict(); + } + + public static void syncDirectPredict() throws Exception { + // 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()) + .setParameters(Tensor.newBuilder().build()) + .build(); + DirectPredictResponse response = predictionServiceClient.directPredict(request); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_DirectPredict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directrawpredict/AsyncDirectRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directrawpredict/AsyncDirectRawPredict.java new file mode 100644 index 000000000000..227f72a2e94f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directrawpredict/AsyncDirectRawPredict.java @@ -0,0 +1,56 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_DirectRawPredict_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.DirectRawPredictRequest; +import com.google.cloud.vertexai.v1beta1.DirectRawPredictResponse; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.ByteString; + +public class AsyncDirectRawPredict { + + public static void main(String[] args) throws Exception { + asyncDirectRawPredict(); + } + + public static void asyncDirectRawPredict() throws Exception { + // 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 future = + predictionServiceClient.directRawPredictCallable().futureCall(request); + // Do something. + DirectRawPredictResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_DirectRawPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directrawpredict/SyncDirectRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directrawpredict/SyncDirectRawPredict.java new file mode 100644 index 000000000000..48be1ccf041d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/directrawpredict/SyncDirectRawPredict.java @@ -0,0 +1,52 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_DirectRawPredict_sync] +import com.google.cloud.vertexai.v1beta1.DirectRawPredictRequest; +import com.google.cloud.vertexai.v1beta1.DirectRawPredictResponse; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.ByteString; + +public class SyncDirectRawPredict { + + public static void main(String[] args) throws Exception { + syncDirectRawPredict(); + } + + public static void syncDirectRawPredict() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_DirectRawPredict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/AsyncExplain.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/AsyncExplain.java new file mode 100644 index 000000000000..5063e9ead097 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/AsyncExplain.java @@ -0,0 +1,63 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Explain_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.ExplainRequest; +import com.google.cloud.vertexai.v1beta1.ExplainResponse; +import com.google.cloud.vertexai.v1beta1.ExplanationSpecOverride; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.HashMap; + +public class AsyncExplain { + + public static void main(String[] args) throws Exception { + asyncExplain(); + } + + public static void asyncExplain() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .setExplanationSpecOverride(ExplanationSpecOverride.newBuilder().build()) + .putAllConcurrentExplanationSpecOverride( + new HashMap()) + .setDeployedModelId("deployedModelId-1817547906") + .build(); + ApiFuture future = + predictionServiceClient.explainCallable().futureCall(request); + // Do something. + ExplainResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Explain_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/SyncExplain.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/SyncExplain.java new file mode 100644 index 000000000000..65b3a7f370b2 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/SyncExplain.java @@ -0,0 +1,59 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Explain_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.ExplainRequest; +import com.google.cloud.vertexai.v1beta1.ExplainResponse; +import com.google.cloud.vertexai.v1beta1.ExplanationSpecOverride; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.HashMap; + +public class SyncExplain { + + public static void main(String[] args) throws Exception { + syncExplain(); + } + + public static void syncExplain() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .setExplanationSpecOverride(ExplanationSpecOverride.newBuilder().build()) + .putAllConcurrentExplanationSpecOverride( + new HashMap()) + .setDeployedModelId("deployedModelId-1817547906") + .build(); + ExplainResponse response = predictionServiceClient.explain(request); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Explain_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/SyncExplainEndpointnameListvalueValueString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/SyncExplainEndpointnameListvalueValueString.java new file mode 100644 index 000000000000..f8b5d97bedfd --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/SyncExplainEndpointnameListvalueValueString.java @@ -0,0 +1,50 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Explain_EndpointnameListvalueValueString_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.ExplainResponse; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncExplainEndpointnameListvalueValueString { + + public static void main(String[] args) throws Exception { + syncExplainEndpointnameListvalueValueString(); + } + + public static void syncExplainEndpointnameListvalueValueString() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + ExplainResponse response = + predictionServiceClient.explain(endpoint, instances, parameters, deployedModelId); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Explain_EndpointnameListvalueValueString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/SyncExplainStringListvalueValueString.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/SyncExplainStringListvalueValueString.java new file mode 100644 index 000000000000..c761f73581df --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/explain/SyncExplainStringListvalueValueString.java @@ -0,0 +1,51 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Explain_StringListvalueValueString_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.ExplainResponse; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncExplainStringListvalueValueString { + + public static void main(String[] args) throws Exception { + syncExplainStringListvalueValueString(); + } + + public static void syncExplainStringListvalueValueString() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + String deployedModelId = "deployedModelId-1817547906"; + ExplainResponse response = + predictionServiceClient.explain(endpoint, instances, parameters, deployedModelId); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Explain_StringListvalueValueString_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getiampolicy/AsyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..4f66d9ba42ff --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,54 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // 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 future = predictionServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_GetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getiampolicy/SyncGetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..f5b5e1a33a0d --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_GetIamPolicy_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_GetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getlocation/AsyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..bc341ba9cbcf --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,46 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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 future = + predictionServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_GetLocation_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getlocation/SyncGetLocation.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..427ec7c3cebe --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_GetLocation_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/listlocations/AsyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..c984ef8eacf4 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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 future = + predictionServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_ListLocations_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/listlocations/AsyncListLocationsPaged.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..8fb7dc987718 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_ListLocations_Paged_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/listlocations/SyncListLocations.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..e2f6374db51f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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); + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_ListLocations_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/AsyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/AsyncPredict.java new file mode 100644 index 000000000000..422a98289ea8 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/AsyncPredict.java @@ -0,0 +1,57 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Predict_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictRequest; +import com.google.cloud.vertexai.v1beta1.PredictResponse; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class AsyncPredict { + + public static void main(String[] args) throws Exception { + asyncPredict(); + } + + public static void asyncPredict() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .build(); + ApiFuture future = + predictionServiceClient.predictCallable().futureCall(request); + // Do something. + PredictResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Predict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/SyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/SyncPredict.java new file mode 100644 index 000000000000..679a789b841b --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/SyncPredict.java @@ -0,0 +1,53 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Predict_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictRequest; +import com.google.cloud.vertexai.v1beta1.PredictResponse; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; + +public class SyncPredict { + + public static void main(String[] args) throws Exception { + syncPredict(); + } + + public static void syncPredict() throws Exception { + // 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()) + .setParameters(Value.newBuilder().setBoolValue(true).build()) + .build(); + PredictResponse response = predictionServiceClient.predict(request); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Predict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/SyncPredictEndpointnameListvalueValue.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/SyncPredictEndpointnameListvalueValue.java new file mode 100644 index 000000000000..947510ed26e3 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/SyncPredictEndpointnameListvalueValue.java @@ -0,0 +1,48 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Predict_EndpointnameListvalueValue_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictResponse; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncPredictEndpointnameListvalueValue { + + public static void main(String[] args) throws Exception { + syncPredictEndpointnameListvalueValue(); + } + + public static void syncPredictEndpointnameListvalueValue() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Predict_EndpointnameListvalueValue_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/SyncPredictStringListvalueValue.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/SyncPredictStringListvalueValue.java new file mode 100644 index 000000000000..73df25dd5d1f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/predict/SyncPredictStringListvalueValue.java @@ -0,0 +1,49 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_Predict_StringListvalueValue_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictResponse; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.List; + +public class SyncPredictStringListvalueValue { + + public static void main(String[] args) throws Exception { + syncPredictStringListvalueValue(); + } + + public static void syncPredictStringListvalueValue() throws Exception { + // 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 instances = new ArrayList<>(); + Value parameters = Value.newBuilder().setBoolValue(true).build(); + PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_Predict_StringListvalueValue_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/AsyncRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/AsyncRawPredict.java new file mode 100644 index 000000000000..8abd7ae00e7f --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/AsyncRawPredict.java @@ -0,0 +1,53 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_RawPredict_async] +import com.google.api.HttpBody; +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.RawPredictRequest; + +public class AsyncRawPredict { + + public static void main(String[] args) throws Exception { + asyncRawPredict(); + } + + public static void asyncRawPredict() throws Exception { + // 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 future = predictionServiceClient.rawPredictCallable().futureCall(request); + // Do something. + HttpBody response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_RawPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/SyncRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/SyncRawPredict.java new file mode 100644 index 000000000000..c05cedd26d13 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/SyncRawPredict.java @@ -0,0 +1,50 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_RawPredict_sync] +import com.google.api.HttpBody; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.RawPredictRequest; + +public class SyncRawPredict { + + public static void main(String[] args) throws Exception { + syncRawPredict(); + } + + public static void syncRawPredict() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_RawPredict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/SyncRawPredictEndpointnameHttpbody.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/SyncRawPredictEndpointnameHttpbody.java new file mode 100644 index 000000000000..82e0f345fc4e --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/SyncRawPredictEndpointnameHttpbody.java @@ -0,0 +1,44 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_RawPredict_EndpointnameHttpbody_sync] +import com.google.api.HttpBody; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; + +public class SyncRawPredictEndpointnameHttpbody { + + public static void main(String[] args) throws Exception { + syncRawPredictEndpointnameHttpbody(); + } + + public static void syncRawPredictEndpointnameHttpbody() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_RawPredict_EndpointnameHttpbody_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/SyncRawPredictStringHttpbody.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/SyncRawPredictStringHttpbody.java new file mode 100644 index 000000000000..aa31dae153a7 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/rawpredict/SyncRawPredictStringHttpbody.java @@ -0,0 +1,45 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_RawPredict_StringHttpbody_sync] +import com.google.api.HttpBody; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; + +public class SyncRawPredictStringHttpbody { + + public static void main(String[] args) throws Exception { + syncRawPredictStringHttpbody(); + } + + public static void syncRawPredictStringHttpbody() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_RawPredict_StringHttpbody_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/serverstreamingpredict/AsyncServerStreamingPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/serverstreamingpredict/AsyncServerStreamingPredict.java new file mode 100644 index 000000000000..09c5c85a29d3 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/serverstreamingpredict/AsyncServerStreamingPredict.java @@ -0,0 +1,58 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_ServerStreamingPredict_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.StreamingPredictRequest; +import com.google.cloud.vertexai.v1beta1.StreamingPredictResponse; +import com.google.cloud.vertexai.v1beta1.Tensor; +import java.util.ArrayList; + +public class AsyncServerStreamingPredict { + + public static void main(String[] args) throws Exception { + asyncServerStreamingPredict(); + } + + public static void asyncServerStreamingPredict() throws Exception { + // 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()) + .setParameters(Tensor.newBuilder().build()) + .build(); + ServerStream stream = + predictionServiceClient.serverStreamingPredictCallable().call(request); + for (StreamingPredictResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_ServerStreamingPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/setiampolicy/AsyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..7b0f4443d903 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,55 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // 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 future = predictionServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_SetIamPolicy_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/setiampolicy/SyncSetIamPolicy.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..93ba24f27a7a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_SetIamPolicy_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // 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); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_SetIamPolicy_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/streamgeneratecontent/AsyncStreamGenerateContent.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/streamgeneratecontent/AsyncStreamGenerateContent.java new file mode 100644 index 000000000000..8de238427367 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/streamgeneratecontent/AsyncStreamGenerateContent.java @@ -0,0 +1,64 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_StreamGenerateContent_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.vertexai.v1beta1.Content; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.GenerateContentRequest; +import com.google.cloud.vertexai.v1beta1.GenerateContentResponse; +import com.google.cloud.vertexai.v1beta1.GenerationConfig; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.SafetySetting; +import com.google.cloud.vertexai.v1beta1.Tool; +import java.util.ArrayList; + +public class AsyncStreamGenerateContent { + + public static void main(String[] args) throws Exception { + asyncStreamGenerateContent(); + } + + public static void asyncStreamGenerateContent() throws Exception { + // 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()) + .addAllTools(new ArrayList()) + .addAllSafetySettings(new ArrayList()) + .setGenerationConfig(GenerationConfig.newBuilder().build()) + .build(); + ServerStream stream = + predictionServiceClient.streamGenerateContentCallable().call(request); + for (GenerateContentResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_StreamGenerateContent_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/streamingpredict/AsyncStreamingPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/streamingpredict/AsyncStreamingPredict.java new file mode 100644 index 000000000000..eb1954405880 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/streamingpredict/AsyncStreamingPredict.java @@ -0,0 +1,59 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_StreamingPredict_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.StreamingPredictRequest; +import com.google.cloud.vertexai.v1beta1.StreamingPredictResponse; +import com.google.cloud.vertexai.v1beta1.Tensor; +import java.util.ArrayList; + +public class AsyncStreamingPredict { + + public static void main(String[] args) throws Exception { + asyncStreamingPredict(); + } + + public static void asyncStreamingPredict() throws Exception { + // 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 bidiStream = + predictionServiceClient.streamingPredictCallable().call(); + StreamingPredictRequest request = + StreamingPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllInputs(new ArrayList()) + .setParameters(Tensor.newBuilder().build()) + .build(); + bidiStream.send(request); + for (StreamingPredictResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_StreamingPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/streamingrawpredict/AsyncStreamingRawPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/streamingrawpredict/AsyncStreamingRawPredict.java new file mode 100644 index 000000000000..8eb935a23cc2 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/streamingrawpredict/AsyncStreamingRawPredict.java @@ -0,0 +1,58 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_StreamingRawPredict_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.cloud.vertexai.v1beta1.StreamingRawPredictRequest; +import com.google.cloud.vertexai.v1beta1.StreamingRawPredictResponse; +import com.google.protobuf.ByteString; + +public class AsyncStreamingRawPredict { + + public static void main(String[] args) throws Exception { + asyncStreamingRawPredict(); + } + + public static void asyncStreamingRawPredict() throws Exception { + // 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 bidiStream = + predictionServiceClient.streamingRawPredictCallable().call(); + StreamingRawPredictRequest request = + StreamingRawPredictRequest.newBuilder() + .setEndpoint( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setMethodName("methodName-723163380") + .setInput(ByteString.EMPTY) + .build(); + bidiStream.send(request); + for (StreamingRawPredictResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_StreamingRawPredict_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/testiampermissions/AsyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..e6d26523f320 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,55 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // 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()) + .build(); + ApiFuture future = + predictionServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_TestIamPermissions_async] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/testiampermissions/SyncTestIamPermissions.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..259ece5a9978 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,51 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionService_TestIamPermissions_sync] +import com.google.cloud.vertexai.v1beta1.EndpointName; +import com.google.cloud.vertexai.v1beta1.PredictionServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // 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()) + .build(); + TestIamPermissionsResponse response = predictionServiceClient.testIamPermissions(request); + } + } +} +// [END aiplatform_v1beta1_generated_PredictionService_TestIamPermissions_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservicesettings/predict/SyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservicesettings/predict/SyncPredict.java new file mode 100644 index 000000000000..fcb0e1f39c47 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/predictionservicesettings/predict/SyncPredict.java @@ -0,0 +1,49 @@ +/* + * 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.v1beta1.samples; + +// [START aiplatform_v1beta1_generated_PredictionServiceSettings_Predict_sync] +import com.google.cloud.vertexai.v1beta1.PredictionServiceSettings; +import java.time.Duration; + +public class SyncPredict { + + public static void main(String[] args) throws Exception { + syncPredict(); + } + + public static void syncPredict() throws Exception { + // 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(); + } +} +// [END aiplatform_v1beta1_generated_PredictionServiceSettings_Predict_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/stub/endpointservicestubsettings/getendpoint/SyncGetEndpoint.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/stub/endpointservicestubsettings/getendpoint/SyncGetEndpoint.java new file mode 100644 index 000000000000..3485d56a05c5 --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/stub/endpointservicestubsettings/getendpoint/SyncGetEndpoint.java @@ -0,0 +1,49 @@ +/* + * 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.v1beta1.stub.samples; + +// [START aiplatform_v1beta1_generated_EndpointServiceStubSettings_GetEndpoint_sync] +import com.google.cloud.vertexai.v1beta1.stub.EndpointServiceStubSettings; +import java.time.Duration; + +public class SyncGetEndpoint { + + public static void main(String[] args) throws Exception { + syncGetEndpoint(); + } + + public static void syncGetEndpoint() throws Exception { + // 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(); + } +} +// [END aiplatform_v1beta1_generated_EndpointServiceStubSettings_GetEndpoint_sync] diff --git a/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/stub/predictionservicestubsettings/predict/SyncPredict.java b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/stub/predictionservicestubsettings/predict/SyncPredict.java new file mode 100644 index 000000000000..3dee6f76d50a --- /dev/null +++ b/java-vertexai/samples/snippets/generated/com/google/cloud/vertexai/v1beta1/stub/predictionservicestubsettings/predict/SyncPredict.java @@ -0,0 +1,50 @@ +/* + * 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.v1beta1.stub.samples; + +// [START aiplatform_v1beta1_generated_PredictionServiceStubSettings_Predict_sync] +import com.google.cloud.vertexai.v1beta1.stub.PredictionServiceStubSettings; +import java.time.Duration; + +public class SyncPredict { + + public static void main(String[] args) throws Exception { + syncPredict(); + } + + public static void syncPredict() throws Exception { + // 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 + PredictionServiceStubSettings.Builder predictionServiceSettingsBuilder = + PredictionServiceStubSettings.newBuilder(); + predictionServiceSettingsBuilder + .predictSettings() + .setRetrySettings( + predictionServiceSettingsBuilder + .predictSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + PredictionServiceStubSettings predictionServiceSettings = + predictionServiceSettingsBuilder.build(); + } +} +// [END aiplatform_v1beta1_generated_PredictionServiceStubSettings_Predict_sync] diff --git a/pom.xml b/pom.xml index 00577f0f5945..62b5c90ef692 100644 --- a/pom.xml +++ b/pom.xml @@ -166,6 +166,7 @@ java-tpu java-trace java-translate + java-vertexai java-video-intelligence java-video-live-stream java-video-stitcher diff --git a/versions.txt b/versions.txt index 22a3705f74b6..9c6d5fe1b7b3 100644 --- a/versions.txt +++ b/versions.txt @@ -702,3 +702,8 @@ grpc-google-cloud-telcoautomation-v1alpha1:0.1.0:0.2.0-SNAPSHOT google-cloud-securesourcemanager:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-securesourcemanager-v1:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-securesourcemanager-v1:0.1.0:0.2.0-SNAPSHOT +google-cloud-vertexai:0.0.0:0.1.0-SNAPSHOT +proto-google-cloud-vertexai-v1:0.0.0:0.1.0-SNAPSHOT +proto-google-cloud-vertexai-v1beta1:0.0.0:0.1.0-SNAPSHOT +grpc-google-cloud-vertexai-v1:0.0.0:0.1.0-SNAPSHOT +grpc-google-cloud-vertexai-v1beta1:0.0.1:0.1.0-SNAPSHOT