diff --git a/java-aiplatform/README.md b/java-aiplatform/README.md index d4c284115b7c..25fc6fbb33f5 100644 --- a/java-aiplatform/README.md +++ b/java-aiplatform/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.14.0 + 26.15.0 pom import @@ -195,7 +195,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-aiplatform.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.17.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.18.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-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceClient.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceClient.java new file mode 100644 index 000000000000..7425eab546fb --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceClient.java @@ -0,0 +1,774 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +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.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.aiplatform.v1.stub.MatchServiceStub; +import com.google.cloud.aiplatform.v1.stub.MatchServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: MatchService is a Google managed service for efficient vector similarity + * search at scale. + * + *

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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+ *   FindNeighborsRequest request =
+ *       FindNeighborsRequest.newBuilder()
+ *           .setIndexEndpoint(
+ *               IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString())
+ *           .setDeployedIndexId("deployedIndexId-1101212953")
+ *           .addAllQueries(new ArrayList())
+ *           .setReturnFullDatapoint(true)
+ *           .build();
+ *   FindNeighborsResponse response = matchServiceClient.findNeighbors(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the MatchServiceClient 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 MatchServiceSettings 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
+ * MatchServiceSettings matchServiceSettings =
+ *     MatchServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * MatchServiceClient matchServiceClient = MatchServiceClient.create(matchServiceSettings);
+ * }
+ * + *

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
+ * MatchServiceSettings matchServiceSettings =
+ *     MatchServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * MatchServiceClient matchServiceClient = MatchServiceClient.create(matchServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class MatchServiceClient implements BackgroundResource { + private final MatchServiceSettings settings; + private final MatchServiceStub stub; + + /** Constructs an instance of MatchServiceClient with default settings. */ + public static final MatchServiceClient create() throws IOException { + return create(MatchServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of MatchServiceClient, 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 MatchServiceClient create(MatchServiceSettings settings) throws IOException { + return new MatchServiceClient(settings); + } + + /** + * Constructs an instance of MatchServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(MatchServiceSettings). + */ + public static final MatchServiceClient create(MatchServiceStub stub) { + return new MatchServiceClient(stub); + } + + /** + * Constructs an instance of MatchServiceClient, 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 MatchServiceClient(MatchServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((MatchServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected MatchServiceClient(MatchServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final MatchServiceSettings getSettings() { + return settings; + } + + public MatchServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Finds the nearest neighbors of each vector within the request. + * + *

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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   FindNeighborsRequest request =
+   *       FindNeighborsRequest.newBuilder()
+   *           .setIndexEndpoint(
+   *               IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString())
+   *           .setDeployedIndexId("deployedIndexId-1101212953")
+   *           .addAllQueries(new ArrayList())
+   *           .setReturnFullDatapoint(true)
+   *           .build();
+   *   FindNeighborsResponse response = matchServiceClient.findNeighbors(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 FindNeighborsResponse findNeighbors(FindNeighborsRequest request) { + return findNeighborsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Finds the nearest neighbors of each vector within the request. + * + *

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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   FindNeighborsRequest request =
+   *       FindNeighborsRequest.newBuilder()
+   *           .setIndexEndpoint(
+   *               IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString())
+   *           .setDeployedIndexId("deployedIndexId-1101212953")
+   *           .addAllQueries(new ArrayList())
+   *           .setReturnFullDatapoint(true)
+   *           .build();
+   *   ApiFuture future =
+   *       matchServiceClient.findNeighborsCallable().futureCall(request);
+   *   // Do something.
+   *   FindNeighborsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable findNeighborsCallable() { + return stub.findNeighborsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reads the datapoints/vectors of the given IDs. A maximum of 1000 datapoints can be retrieved in + * a batch. + * + *

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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   ReadIndexDatapointsRequest request =
+   *       ReadIndexDatapointsRequest.newBuilder()
+   *           .setIndexEndpoint(
+   *               IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString())
+   *           .setDeployedIndexId("deployedIndexId-1101212953")
+   *           .addAllIds(new ArrayList())
+   *           .build();
+   *   ReadIndexDatapointsResponse response = matchServiceClient.readIndexDatapoints(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 ReadIndexDatapointsResponse readIndexDatapoints(ReadIndexDatapointsRequest request) { + return readIndexDatapointsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reads the datapoints/vectors of the given IDs. A maximum of 1000 datapoints can be retrieved in + * a batch. + * + *

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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   ReadIndexDatapointsRequest request =
+   *       ReadIndexDatapointsRequest.newBuilder()
+   *           .setIndexEndpoint(
+   *               IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString())
+   *           .setDeployedIndexId("deployedIndexId-1101212953")
+   *           .addAllIds(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       matchServiceClient.readIndexDatapointsCallable().futureCall(request);
+   *   // Do something.
+   *   ReadIndexDatapointsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + readIndexDatapointsCallable() { + return stub.readIndexDatapointsCallable(); + } + + // 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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : matchServiceClient.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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       matchServiceClient.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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = matchServiceClient.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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = matchServiceClient.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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = matchServiceClient.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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = matchServiceClient.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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = matchServiceClient.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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = matchServiceClient.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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = matchServiceClient.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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = matchServiceClient.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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       matchServiceClient.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-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceSettings.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceSettings.java new file mode 100644 index 000000000000..17ed53410c6e --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceSettings.java @@ -0,0 +1,265 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +import static com.google.cloud.aiplatform.v1.MatchServiceClient.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.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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.aiplatform.v1.stub.MatchServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MatchServiceClient}. + * + *

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 findNeighbors 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
+ * MatchServiceSettings.Builder matchServiceSettingsBuilder = MatchServiceSettings.newBuilder();
+ * matchServiceSettingsBuilder
+ *     .findNeighborsSettings()
+ *     .setRetrySettings(
+ *         matchServiceSettingsBuilder
+ *             .findNeighborsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * MatchServiceSettings matchServiceSettings = matchServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class MatchServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to findNeighbors. */ + public UnaryCallSettings findNeighborsSettings() { + return ((MatchServiceStubSettings) getStubSettings()).findNeighborsSettings(); + } + + /** Returns the object with the settings used for calls to readIndexDatapoints. */ + public UnaryCallSettings + readIndexDatapointsSettings() { + return ((MatchServiceStubSettings) getStubSettings()).readIndexDatapointsSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((MatchServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((MatchServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((MatchServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((MatchServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((MatchServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final MatchServiceSettings create(MatchServiceStubSettings stub) + throws IOException { + return new MatchServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MatchServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MatchServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MatchServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MatchServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MatchServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MatchServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MatchServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 MatchServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MatchServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MatchServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(MatchServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MatchServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MatchServiceStubSettings.newBuilder()); + } + + public MatchServiceStubSettings.Builder getStubSettingsBuilder() { + return ((MatchServiceStubSettings.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 findNeighbors. */ + public UnaryCallSettings.Builder + findNeighborsSettings() { + return getStubSettingsBuilder().findNeighborsSettings(); + } + + /** Returns the builder for the settings used for calls to readIndexDatapoints. */ + public UnaryCallSettings.Builder + readIndexDatapointsSettings() { + return getStubSettingsBuilder().readIndexDatapointsSettings(); + } + + /** 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 MatchServiceSettings build() throws IOException { + return new MatchServiceSettings(this); + } + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/gapic_metadata.json b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/gapic_metadata.json index 125495bd6646..e5017417f433 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/gapic_metadata.json +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/gapic_metadata.json @@ -455,6 +455,36 @@ } } }, + "MatchService": { + "clients": { + "grpc": { + "libraryClient": "MatchServiceClient", + "rpcs": { + "FindNeighbors": { + "methods": ["findNeighbors", "findNeighborsCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ReadIndexDatapoints": { + "methods": ["readIndexDatapoints", "readIndexDatapointsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + } + } + } + } + }, "MetadataService": { "clients": { "grpc": { diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/package-info.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/package-info.java index 90824ef1cda1..c87207543174 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/package-info.java +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/package-info.java @@ -152,6 +152,32 @@ * } * } * + *

======================= MatchServiceClient ======================= + * + *

Service Description: MatchService is a Google managed service for efficient vector similarity + * search at scale. + * + *

Sample for MatchServiceClient: + * + *

{@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 (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
+ *   FindNeighborsRequest request =
+ *       FindNeighborsRequest.newBuilder()
+ *           .setIndexEndpoint(
+ *               IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString())
+ *           .setDeployedIndexId("deployedIndexId-1101212953")
+ *           .addAllQueries(new ArrayList())
+ *           .setReturnFullDatapoint(true)
+ *           .build();
+ *   FindNeighborsResponse response = matchServiceClient.findNeighbors(request);
+ * }
+ * }
+ * *

======================= MetadataServiceClient ======================= * *

Service Description: Service for reading and writing metadata entries. diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcMatchServiceCallableFactory.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcMatchServiceCallableFactory.java new file mode 100644 index 000000000000..34d7d0cca892 --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcMatchServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.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 MatchService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcMatchServiceCallableFactory 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-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcMatchServiceStub.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcMatchServiceStub.java new file mode 100644 index 000000000000..0fa2ed269170 --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcMatchServiceStub.java @@ -0,0 +1,366 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.stub; + +import static com.google.cloud.aiplatform.v1.MatchServiceClient.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.UnaryCallable; +import com.google.cloud.aiplatform.v1.FindNeighborsRequest; +import com.google.cloud.aiplatform.v1.FindNeighborsResponse; +import com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest; +import com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse; +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.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.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 MatchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcMatchServiceStub extends MatchServiceStub { + private static final MethodDescriptor + findNeighborsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1.MatchService/FindNeighbors") + .setRequestMarshaller( + ProtoUtils.marshaller(FindNeighborsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FindNeighborsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + readIndexDatapointsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1.MatchService/ReadIndexDatapoints") + .setRequestMarshaller( + ProtoUtils.marshaller(ReadIndexDatapointsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ReadIndexDatapointsResponse.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 findNeighborsCallable; + private final UnaryCallable + readIndexDatapointsCallable; + 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 GrpcMatchServiceStub create(MatchServiceStubSettings settings) + throws IOException { + return new GrpcMatchServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcMatchServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcMatchServiceStub(MatchServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcMatchServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMatchServiceStub( + MatchServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcMatchServiceStub, 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 GrpcMatchServiceStub(MatchServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcMatchServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcMatchServiceStub, 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 GrpcMatchServiceStub( + MatchServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings findNeighborsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(findNeighborsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("index_endpoint", String.valueOf(request.getIndexEndpoint())); + return params.build(); + }) + .build(); + GrpcCallSettings + readIndexDatapointsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(readIndexDatapointsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("index_endpoint", String.valueOf(request.getIndexEndpoint())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + + this.findNeighborsCallable = + callableFactory.createUnaryCallable( + findNeighborsTransportSettings, settings.findNeighborsSettings(), clientContext); + this.readIndexDatapointsCallable = + callableFactory.createUnaryCallable( + readIndexDatapointsTransportSettings, + settings.readIndexDatapointsSettings(), + 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 findNeighborsCallable() { + return findNeighborsCallable; + } + + @Override + public UnaryCallable + readIndexDatapointsCallable() { + return readIndexDatapointsCallable; + } + + @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-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/MatchServiceStub.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/MatchServiceStub.java new file mode 100644 index 000000000000..d4b570fc48b8 --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/MatchServiceStub.java @@ -0,0 +1,84 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.stub; + +import static com.google.cloud.aiplatform.v1.MatchServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.aiplatform.v1.FindNeighborsRequest; +import com.google.cloud.aiplatform.v1.FindNeighborsResponse; +import com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest; +import com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the MatchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class MatchServiceStub implements BackgroundResource { + + public UnaryCallable findNeighborsCallable() { + throw new UnsupportedOperationException("Not implemented: findNeighborsCallable()"); + } + + public UnaryCallable + readIndexDatapointsCallable() { + throw new UnsupportedOperationException("Not implemented: readIndexDatapointsCallable()"); + } + + 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-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/MatchServiceStubSettings.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/MatchServiceStubSettings.java new file mode 100644 index 000000000000..aaa9ec7517fa --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/MatchServiceStubSettings.java @@ -0,0 +1,491 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.stub; + +import static com.google.cloud.aiplatform.v1.MatchServiceClient.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.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.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.aiplatform.v1.FindNeighborsRequest; +import com.google.cloud.aiplatform.v1.FindNeighborsResponse; +import com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest; +import com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse; +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.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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MatchServiceStub}. + * + *

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 findNeighbors 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
+ * MatchServiceStubSettings.Builder matchServiceSettingsBuilder =
+ *     MatchServiceStubSettings.newBuilder();
+ * matchServiceSettingsBuilder
+ *     .findNeighborsSettings()
+ *     .setRetrySettings(
+ *         matchServiceSettingsBuilder
+ *             .findNeighborsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * MatchServiceStubSettings matchServiceSettings = matchServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class MatchServiceStubSettings 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 + findNeighborsSettings; + private final UnaryCallSettings + readIndexDatapointsSettings; + 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 findNeighbors. */ + public UnaryCallSettings findNeighborsSettings() { + return findNeighborsSettings; + } + + /** Returns the object with the settings used for calls to readIndexDatapoints. */ + public UnaryCallSettings + readIndexDatapointsSettings() { + return readIndexDatapointsSettings; + } + + /** 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 MatchServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMatchServiceStub.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(MatchServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 MatchServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + findNeighborsSettings = settingsBuilder.findNeighborsSettings().build(); + readIndexDatapointsSettings = settingsBuilder.readIndexDatapointsSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for MatchServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + findNeighborsSettings; + private final UnaryCallSettings.Builder + readIndexDatapointsSettings; + 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_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().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); + + findNeighborsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + readIndexDatapointsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + findNeighborsSettings, + readIndexDatapointsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(MatchServiceStubSettings settings) { + super(settings); + + findNeighborsSettings = settings.findNeighborsSettings.toBuilder(); + readIndexDatapointsSettings = settings.readIndexDatapointsSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + findNeighborsSettings, + readIndexDatapointsSettings, + 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 initDefaults(Builder builder) { + builder + .findNeighborsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .readIndexDatapointsSettings() + .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 findNeighbors. */ + public UnaryCallSettings.Builder + findNeighborsSettings() { + return findNeighborsSettings; + } + + /** Returns the builder for the settings used for calls to readIndexDatapoints. */ + public UnaryCallSettings.Builder + readIndexDatapointsSettings() { + return readIndexDatapointsSettings; + } + + /** 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 MatchServiceStubSettings build() throws IOException { + return new MatchServiceStubSettings(this); + } + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceClient.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceClient.java index d73980a689fb..be00a04fbb25 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceClient.java +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceClient.java @@ -42,6 +42,7 @@ import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; @@ -1070,6 +1071,111 @@ public final UnaryCallable resumeScheduleCallable( return stub.resumeScheduleCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an active or paused Schedule. + * + *

When the Schedule is updated, new runs will be scheduled starting from the updated next + * execution time after the update time based on the time_specification in the updated Schedule. + * All unstarted runs before the update time will be skipped while already created runs will NOT + * be paused or canceled. + * + *

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 (ScheduleServiceClient scheduleServiceClient = ScheduleServiceClient.create()) {
+   *   Schedule schedule = Schedule.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Schedule response = scheduleServiceClient.updateSchedule(schedule, updateMask);
+   * }
+   * }
+ * + * @param schedule Required. The Schedule which replaces the resource on the server. The following + * restrictions will be applied: * The scheduled request type cannot be changed. * The + * output_only fields will be ignored if specified. + * @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 Schedule updateSchedule(Schedule schedule, FieldMask updateMask) { + UpdateScheduleRequest request = + UpdateScheduleRequest.newBuilder().setSchedule(schedule).setUpdateMask(updateMask).build(); + return updateSchedule(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an active or paused Schedule. + * + *

When the Schedule is updated, new runs will be scheduled starting from the updated next + * execution time after the update time based on the time_specification in the updated Schedule. + * All unstarted runs before the update time will be skipped while already created runs will NOT + * be paused or canceled. + * + *

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 (ScheduleServiceClient scheduleServiceClient = ScheduleServiceClient.create()) {
+   *   UpdateScheduleRequest request =
+   *       UpdateScheduleRequest.newBuilder()
+   *           .setSchedule(Schedule.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Schedule response = scheduleServiceClient.updateSchedule(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 Schedule updateSchedule(UpdateScheduleRequest request) { + return updateScheduleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an active or paused Schedule. + * + *

When the Schedule is updated, new runs will be scheduled starting from the updated next + * execution time after the update time based on the time_specification in the updated Schedule. + * All unstarted runs before the update time will be skipped while already created runs will NOT + * be paused or canceled. + * + *

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 (ScheduleServiceClient scheduleServiceClient = ScheduleServiceClient.create()) {
+   *   UpdateScheduleRequest request =
+   *       UpdateScheduleRequest.newBuilder()
+   *           .setSchedule(Schedule.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       scheduleServiceClient.updateScheduleCallable().futureCall(request);
+   *   // Do something.
+   *   Schedule response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateScheduleCallable() { + return stub.updateScheduleCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceSettings.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceSettings.java index ff205794b372..c7a76d018976 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceSettings.java +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceSettings.java @@ -125,6 +125,11 @@ public UnaryCallSettings resumeScheduleSettings() return ((ScheduleServiceStubSettings) getStubSettings()).resumeScheduleSettings(); } + /** Returns the object with the settings used for calls to updateSchedule. */ + public UnaryCallSettings updateScheduleSettings() { + return ((ScheduleServiceStubSettings) getStubSettings()).updateScheduleSettings(); + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -287,6 +292,11 @@ public UnaryCallSettings.Builder resumeScheduleSet return getStubSettingsBuilder().resumeScheduleSettings(); } + /** Returns the builder for the settings used for calls to updateSchedule. */ + public UnaryCallSettings.Builder updateScheduleSettings() { + return getStubSettingsBuilder().updateScheduleSettings(); + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/gapic_metadata.json b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/gapic_metadata.json index f19eb048febc..4f2a76e13138 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/gapic_metadata.json +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/gapic_metadata.json @@ -903,6 +903,9 @@ }, "TestIamPermissions": { "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateSchedule": { + "methods": ["updateSchedule", "updateSchedule", "updateScheduleCallable"] } } } diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GrpcScheduleServiceStub.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GrpcScheduleServiceStub.java index 7a8801a92a08..a561b9f8faf3 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GrpcScheduleServiceStub.java +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GrpcScheduleServiceStub.java @@ -36,6 +36,7 @@ import com.google.cloud.aiplatform.v1beta1.PauseScheduleRequest; import com.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest; import com.google.cloud.aiplatform.v1beta1.Schedule; +import com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -121,6 +122,16 @@ public class GrpcScheduleServiceStub extends ScheduleServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor + updateScheduleMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1beta1.ScheduleService/UpdateSchedule") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateScheduleRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Schedule.getDefaultInstance())) + .build(); + private static final MethodDescriptor listLocationsMethodDescriptor = MethodDescriptor.newBuilder() @@ -177,6 +188,7 @@ public class GrpcScheduleServiceStub extends ScheduleServiceStub { listSchedulesPagedCallable; private final UnaryCallable pauseScheduleCallable; private final UnaryCallable resumeScheduleCallable; + private final UnaryCallable updateScheduleCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; @@ -290,6 +302,16 @@ protected GrpcScheduleServiceStub( return params.build(); }) .build(); + GrpcCallSettings updateScheduleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateScheduleMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("schedule.name", String.valueOf(request.getSchedule().getName())); + return params.build(); + }) + .build(); GrpcCallSettings listLocationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) @@ -369,6 +391,9 @@ protected GrpcScheduleServiceStub( this.resumeScheduleCallable = callableFactory.createUnaryCallable( resumeScheduleTransportSettings, settings.resumeScheduleSettings(), clientContext); + this.updateScheduleCallable = + callableFactory.createUnaryCallable( + updateScheduleTransportSettings, settings.updateScheduleSettings(), clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); @@ -440,6 +465,11 @@ public UnaryCallable resumeScheduleCallable() { return resumeScheduleCallable; } + @Override + public UnaryCallable updateScheduleCallable() { + return updateScheduleCallable; + } + @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/ScheduleServiceStub.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/ScheduleServiceStub.java index bcb799efe403..ea103f83cca8 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/ScheduleServiceStub.java +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/ScheduleServiceStub.java @@ -32,6 +32,7 @@ import com.google.cloud.aiplatform.v1beta1.PauseScheduleRequest; import com.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest; import com.google.cloud.aiplatform.v1beta1.Schedule; +import com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -94,6 +95,10 @@ public UnaryCallable resumeScheduleCallable() { throw new UnsupportedOperationException("Not implemented: resumeScheduleCallable()"); } + public UnaryCallable updateScheduleCallable() { + throw new UnsupportedOperationException("Not implemented: updateScheduleCallable()"); + } + public UnaryCallable listLocationsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/ScheduleServiceStubSettings.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/ScheduleServiceStubSettings.java index 407377ba98e0..6578114bd2b2 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/ScheduleServiceStubSettings.java +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/ScheduleServiceStubSettings.java @@ -54,6 +54,7 @@ import com.google.cloud.aiplatform.v1beta1.PauseScheduleRequest; import com.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest; import com.google.cloud.aiplatform.v1beta1.Schedule; +import com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -128,6 +129,7 @@ public class ScheduleServiceStubSettings extends StubSettings pauseScheduleSettings; private final UnaryCallSettings resumeScheduleSettings; + private final UnaryCallSettings updateScheduleSettings; private final PagedCallSettings< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -280,6 +282,11 @@ public UnaryCallSettings resumeScheduleSettings() return resumeScheduleSettings; } + /** Returns the object with the settings used for calls to updateSchedule. */ + public UnaryCallSettings updateScheduleSettings() { + return updateScheduleSettings; + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -389,6 +396,7 @@ protected ScheduleServiceStubSettings(Builder settingsBuilder) throws IOExceptio listSchedulesSettings = settingsBuilder.listSchedulesSettings().build(); pauseScheduleSettings = settingsBuilder.pauseScheduleSettings().build(); resumeScheduleSettings = settingsBuilder.resumeScheduleSettings().build(); + updateScheduleSettings = settingsBuilder.updateScheduleSettings().build(); listLocationsSettings = settingsBuilder.listLocationsSettings().build(); getLocationSettings = settingsBuilder.getLocationSettings().build(); setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); @@ -411,6 +419,7 @@ public static class Builder extends StubSettings.Builder pauseScheduleSettings; private final UnaryCallSettings.Builder resumeScheduleSettings; + private final UnaryCallSettings.Builder updateScheduleSettings; private final PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -453,6 +462,7 @@ protected Builder(ClientContext clientContext) { listSchedulesSettings = PagedCallSettings.newBuilder(LIST_SCHEDULES_PAGE_STR_FACT); pauseScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); resumeScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateScheduleSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -467,6 +477,7 @@ protected Builder(ClientContext clientContext) { listSchedulesSettings, pauseScheduleSettings, resumeScheduleSettings, + updateScheduleSettings, listLocationsSettings, getLocationSettings, setIamPolicySettings, @@ -485,6 +496,7 @@ protected Builder(ScheduleServiceStubSettings settings) { listSchedulesSettings = settings.listSchedulesSettings.toBuilder(); pauseScheduleSettings = settings.pauseScheduleSettings.toBuilder(); resumeScheduleSettings = settings.resumeScheduleSettings.toBuilder(); + updateScheduleSettings = settings.updateScheduleSettings.toBuilder(); listLocationsSettings = settings.listLocationsSettings.toBuilder(); getLocationSettings = settings.getLocationSettings.toBuilder(); setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); @@ -499,6 +511,7 @@ protected Builder(ScheduleServiceStubSettings settings) { listSchedulesSettings, pauseScheduleSettings, resumeScheduleSettings, + updateScheduleSettings, listLocationsSettings, getLocationSettings, setIamPolicySettings, @@ -550,6 +563,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .updateScheduleSettings() + .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")) @@ -657,6 +675,11 @@ public UnaryCallSettings.Builder resumeScheduleSet return resumeScheduleSettings; } + /** Returns the builder for the settings used for calls to updateSchedule. */ + public UnaryCallSettings.Builder updateScheduleSettings() { + return updateScheduleSettings; + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MatchServiceClientTest.java b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MatchServiceClientTest.java new file mode 100644 index 000000000000..8061c1ec5f2d --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MatchServiceClientTest.java @@ -0,0 +1,473 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +import static com.google.cloud.aiplatform.v1.MatchServiceClient.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.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 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 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 MatchServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockMatchService mockMatchService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private MatchServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockMatchService = new MockMatchService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockMatchService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + MatchServiceSettings settings = + MatchServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MatchServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void findNeighborsTest() throws Exception { + FindNeighborsResponse expectedResponse = + FindNeighborsResponse.newBuilder() + .addAllNearestNeighbors(new ArrayList()) + .build(); + mockMatchService.addResponse(expectedResponse); + + FindNeighborsRequest request = + FindNeighborsRequest.newBuilder() + .setIndexEndpoint( + IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) + .setDeployedIndexId("deployedIndexId-1101212953") + .addAllQueries(new ArrayList()) + .setReturnFullDatapoint(true) + .build(); + + FindNeighborsResponse actualResponse = client.findNeighbors(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FindNeighborsRequest actualRequest = ((FindNeighborsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getIndexEndpoint(), actualRequest.getIndexEndpoint()); + Assert.assertEquals(request.getDeployedIndexId(), actualRequest.getDeployedIndexId()); + Assert.assertEquals(request.getQueriesList(), actualRequest.getQueriesList()); + Assert.assertEquals(request.getReturnFullDatapoint(), actualRequest.getReturnFullDatapoint()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void findNeighborsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMatchService.addException(exception); + + try { + FindNeighborsRequest request = + FindNeighborsRequest.newBuilder() + .setIndexEndpoint( + IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) + .setDeployedIndexId("deployedIndexId-1101212953") + .addAllQueries(new ArrayList()) + .setReturnFullDatapoint(true) + .build(); + client.findNeighbors(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void readIndexDatapointsTest() throws Exception { + ReadIndexDatapointsResponse expectedResponse = + ReadIndexDatapointsResponse.newBuilder() + .addAllDatapoints(new ArrayList()) + .build(); + mockMatchService.addResponse(expectedResponse); + + ReadIndexDatapointsRequest request = + ReadIndexDatapointsRequest.newBuilder() + .setIndexEndpoint( + IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) + .setDeployedIndexId("deployedIndexId-1101212953") + .addAllIds(new ArrayList()) + .build(); + + ReadIndexDatapointsResponse actualResponse = client.readIndexDatapoints(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMatchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReadIndexDatapointsRequest actualRequest = ((ReadIndexDatapointsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getIndexEndpoint(), actualRequest.getIndexEndpoint()); + Assert.assertEquals(request.getDeployedIndexId(), actualRequest.getDeployedIndexId()); + Assert.assertEquals(request.getIdsList(), actualRequest.getIdsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void readIndexDatapointsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMatchService.addException(exception); + + try { + ReadIndexDatapointsRequest request = + ReadIndexDatapointsRequest.newBuilder() + .setIndexEndpoint( + IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) + .setDeployedIndexId("deployedIndexId-1101212953") + .addAllIds(new ArrayList()) + .build(); + client.readIndexDatapoints(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @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-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockMatchService.java b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockMatchService.java new file mode 100644 index 000000000000..3df0d017bc7e --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockMatchService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +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 MockMatchService implements MockGrpcService { + private final MockMatchServiceImpl serviceImpl; + + public MockMatchService() { + serviceImpl = new MockMatchServiceImpl(); + } + + @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-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockMatchServiceImpl.java b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockMatchServiceImpl.java new file mode 100644 index 000000000000..e1a84a10004b --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockMatchServiceImpl.java @@ -0,0 +1,103 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.aiplatform.v1.MatchServiceGrpc.MatchServiceImplBase; +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 MockMatchServiceImpl extends MatchServiceImplBase { + private List requests; + private Queue responses; + + public MockMatchServiceImpl() { + 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 findNeighbors( + FindNeighborsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FindNeighborsResponse) { + requests.add(request); + responseObserver.onNext(((FindNeighborsResponse) 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 FindNeighbors, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FindNeighborsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void readIndexDatapoints( + ReadIndexDatapointsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReadIndexDatapointsResponse) { + requests.add(request); + responseObserver.onNext(((ReadIndexDatapointsResponse) 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 ReadIndexDatapoints, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReadIndexDatapointsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/MockScheduleServiceImpl.java b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/MockScheduleServiceImpl.java index 4922138b7047..0a8fcc040aa4 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/MockScheduleServiceImpl.java +++ b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/MockScheduleServiceImpl.java @@ -183,4 +183,25 @@ public void resumeSchedule( Exception.class.getName()))); } } + + @Override + public void updateSchedule( + UpdateScheduleRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Schedule) { + requests.add(request); + responseObserver.onNext(((Schedule) 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 UpdateSchedule, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Schedule.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceClientTest.java b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceClientTest.java index 8758f3c450c6..a14c27f6992b 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceClientTest.java +++ b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceClientTest.java @@ -702,6 +702,61 @@ public void resumeScheduleExceptionTest4() throws Exception { } } + @Test + public void updateScheduleTest() throws Exception { + Schedule expectedResponse = + Schedule.newBuilder() + .setName(ScheduleName.of("[PROJECT]", "[LOCATION]", "[SCHEDULE]").toString()) + .setDisplayName("displayName1714148973") + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setMaxRunCount(-845001408) + .setStartedRunCount(-479303651) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setNextRunTime(Timestamp.newBuilder().build()) + .setLastPauseTime(Timestamp.newBuilder().build()) + .setLastResumeTime(Timestamp.newBuilder().build()) + .setMaxConcurrentRunCount(-1478623794) + .setAllowQueueing(true) + .setCatchUp(true) + .setLastScheduledRunResponse(Schedule.RunResponse.newBuilder().build()) + .build(); + mockScheduleService.addResponse(expectedResponse); + + Schedule schedule = Schedule.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Schedule actualResponse = client.updateSchedule(schedule, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockScheduleService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateScheduleRequest actualRequest = ((UpdateScheduleRequest) actualRequests.get(0)); + + Assert.assertEquals(schedule, actualRequest.getSchedule()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateScheduleExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockScheduleService.addException(exception); + + try { + Schedule schedule = Schedule.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSchedule(schedule, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-aiplatform/grpc-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceGrpc.java b/java-aiplatform/grpc-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceGrpc.java new file mode 100644 index 000000000000..971ba4fea082 --- /dev/null +++ b/java-aiplatform/grpc-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceGrpc.java @@ -0,0 +1,512 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.aiplatform.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * MatchService is a Google managed service for efficient vector similarity
+ * search at scale.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/aiplatform/v1/match_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class MatchServiceGrpc { + + private MatchServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.aiplatform.v1.MatchService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.FindNeighborsRequest, + com.google.cloud.aiplatform.v1.FindNeighborsResponse> + getFindNeighborsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FindNeighbors", + requestType = com.google.cloud.aiplatform.v1.FindNeighborsRequest.class, + responseType = com.google.cloud.aiplatform.v1.FindNeighborsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.FindNeighborsRequest, + com.google.cloud.aiplatform.v1.FindNeighborsResponse> + getFindNeighborsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.FindNeighborsRequest, + com.google.cloud.aiplatform.v1.FindNeighborsResponse> + getFindNeighborsMethod; + if ((getFindNeighborsMethod = MatchServiceGrpc.getFindNeighborsMethod) == null) { + synchronized (MatchServiceGrpc.class) { + if ((getFindNeighborsMethod = MatchServiceGrpc.getFindNeighborsMethod) == null) { + MatchServiceGrpc.getFindNeighborsMethod = + getFindNeighborsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FindNeighbors")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.FindNeighborsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.FindNeighborsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new MatchServiceMethodDescriptorSupplier("FindNeighbors")) + .build(); + } + } + } + return getFindNeighborsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest, + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse> + getReadIndexDatapointsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReadIndexDatapoints", + requestType = com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.class, + responseType = com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest, + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse> + getReadIndexDatapointsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest, + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse> + getReadIndexDatapointsMethod; + if ((getReadIndexDatapointsMethod = MatchServiceGrpc.getReadIndexDatapointsMethod) == null) { + synchronized (MatchServiceGrpc.class) { + if ((getReadIndexDatapointsMethod = MatchServiceGrpc.getReadIndexDatapointsMethod) + == null) { + MatchServiceGrpc.getReadIndexDatapointsMethod = + getReadIndexDatapointsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ReadIndexDatapoints")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new MatchServiceMethodDescriptorSupplier("ReadIndexDatapoints")) + .build(); + } + } + } + return getReadIndexDatapointsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static MatchServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MatchServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MatchServiceStub(channel, callOptions); + } + }; + return MatchServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MatchServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MatchServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MatchServiceBlockingStub(channel, callOptions); + } + }; + return MatchServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static MatchServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MatchServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MatchServiceFutureStub(channel, callOptions); + } + }; + return MatchServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * MatchService is a Google managed service for efficient vector similarity
+   * search at scale.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Finds the nearest neighbors of each vector within the request.
+     * 
+ */ + default void findNeighbors( + com.google.cloud.aiplatform.v1.FindNeighborsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFindNeighborsMethod(), responseObserver); + } + + /** + * + * + *
+     * Reads the datapoints/vectors of the given IDs.
+     * A maximum of 1000 datapoints can be retrieved in a batch.
+     * 
+ */ + default void readIndexDatapoints( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReadIndexDatapointsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service MatchService. + * + *
+   * MatchService is a Google managed service for efficient vector similarity
+   * search at scale.
+   * 
+ */ + public abstract static class MatchServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return MatchServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service MatchService. + * + *
+   * MatchService is a Google managed service for efficient vector similarity
+   * search at scale.
+   * 
+ */ + public static final class MatchServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private MatchServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MatchServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MatchServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Finds the nearest neighbors of each vector within the request.
+     * 
+ */ + public void findNeighbors( + com.google.cloud.aiplatform.v1.FindNeighborsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFindNeighborsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Reads the datapoints/vectors of the given IDs.
+     * A maximum of 1000 datapoints can be retrieved in a batch.
+     * 
+ */ + public void readIndexDatapoints( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReadIndexDatapointsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service MatchService. + * + *
+   * MatchService is a Google managed service for efficient vector similarity
+   * search at scale.
+   * 
+ */ + public static final class MatchServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MatchServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MatchServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MatchServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Finds the nearest neighbors of each vector within the request.
+     * 
+ */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse findNeighbors( + com.google.cloud.aiplatform.v1.FindNeighborsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFindNeighborsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reads the datapoints/vectors of the given IDs.
+     * A maximum of 1000 datapoints can be retrieved in a batch.
+     * 
+ */ + public com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse readIndexDatapoints( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReadIndexDatapointsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service MatchService. + * + *
+   * MatchService is a Google managed service for efficient vector similarity
+   * search at scale.
+   * 
+ */ + public static final class MatchServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private MatchServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MatchServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MatchServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Finds the nearest neighbors of each vector within the request.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.aiplatform.v1.FindNeighborsResponse> + findNeighbors(com.google.cloud.aiplatform.v1.FindNeighborsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFindNeighborsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reads the datapoints/vectors of the given IDs.
+     * A maximum of 1000 datapoints can be retrieved in a batch.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse> + readIndexDatapoints(com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReadIndexDatapointsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_FIND_NEIGHBORS = 0; + private static final int METHODID_READ_INDEX_DATAPOINTS = 1; + + 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_FIND_NEIGHBORS: + serviceImpl.findNeighbors( + (com.google.cloud.aiplatform.v1.FindNeighborsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_READ_INDEX_DATAPOINTS: + serviceImpl.readIndexDatapoints( + (com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse>) + 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( + getFindNeighborsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1.FindNeighborsRequest, + com.google.cloud.aiplatform.v1.FindNeighborsResponse>( + service, METHODID_FIND_NEIGHBORS))) + .addMethod( + getReadIndexDatapointsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest, + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse>( + service, METHODID_READ_INDEX_DATAPOINTS))) + .build(); + } + + private abstract static class MatchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MatchServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("MatchService"); + } + } + + private static final class MatchServiceFileDescriptorSupplier + extends MatchServiceBaseDescriptorSupplier { + MatchServiceFileDescriptorSupplier() {} + } + + private static final class MatchServiceMethodDescriptorSupplier + extends MatchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + MatchServiceMethodDescriptorSupplier(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 (MatchServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MatchServiceFileDescriptorSupplier()) + .addMethod(getFindNeighborsMethod()) + .addMethod(getReadIndexDatapointsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-aiplatform/grpc-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceGrpc.java b/java-aiplatform/grpc-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceGrpc.java index 1f7bdd66f359..dd90b5b6bf0b 100644 --- a/java-aiplatform/grpc-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceGrpc.java +++ b/java-aiplatform/grpc-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceGrpc.java @@ -307,6 +307,52 @@ private ScheduleServiceGrpc() {} return getResumeScheduleMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest, + com.google.cloud.aiplatform.v1beta1.Schedule> + getUpdateScheduleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSchedule", + requestType = com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest.class, + responseType = com.google.cloud.aiplatform.v1beta1.Schedule.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest, + com.google.cloud.aiplatform.v1beta1.Schedule> + getUpdateScheduleMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest, + com.google.cloud.aiplatform.v1beta1.Schedule> + getUpdateScheduleMethod; + if ((getUpdateScheduleMethod = ScheduleServiceGrpc.getUpdateScheduleMethod) == null) { + synchronized (ScheduleServiceGrpc.class) { + if ((getUpdateScheduleMethod = ScheduleServiceGrpc.getUpdateScheduleMethod) == null) { + ScheduleServiceGrpc.getUpdateScheduleMethod = + getUpdateScheduleMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSchedule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1beta1.Schedule.getDefaultInstance())) + .setSchemaDescriptor( + new ScheduleServiceMethodDescriptorSupplier("UpdateSchedule")) + .build(); + } + } + } + return getUpdateScheduleMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static ScheduleServiceStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -453,6 +499,26 @@ default void resumeSchedule( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getResumeScheduleMethod(), responseObserver); } + + /** + * + * + *
+     * Updates an active or paused Schedule.
+     * When the Schedule is updated, new runs will be scheduled starting from the
+     * updated next execution time after the update time based on the
+     * time_specification in the updated Schedule. All unstarted runs before the
+     * update time will be skipped while already created runs will NOT be paused
+     * or canceled.
+     * 
+ */ + default void updateSchedule( + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateScheduleMethod(), responseObserver); + } } /** @@ -598,6 +664,28 @@ public void resumeSchedule( request, responseObserver); } + + /** + * + * + *
+     * Updates an active or paused Schedule.
+     * When the Schedule is updated, new runs will be scheduled starting from the
+     * updated next execution time after the update time based on the
+     * time_specification in the updated Schedule. All unstarted runs before the
+     * update time will be skipped while already created runs will NOT be paused
+     * or canceled.
+     * 
+ */ + public void updateSchedule( + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateScheduleMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -706,6 +794,24 @@ public com.google.protobuf.Empty resumeSchedule( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getResumeScheduleMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Updates an active or paused Schedule.
+     * When the Schedule is updated, new runs will be scheduled starting from the
+     * updated next execution time after the update time based on the
+     * time_specification in the updated Schedule. All unstarted runs before the
+     * update time will be skipped while already created runs will NOT be paused
+     * or canceled.
+     * 
+ */ + public com.google.cloud.aiplatform.v1beta1.Schedule updateSchedule( + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateScheduleMethod(), getCallOptions(), request); + } } /** @@ -817,6 +923,25 @@ protected ScheduleServiceFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getResumeScheduleMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Updates an active or paused Schedule.
+     * When the Schedule is updated, new runs will be scheduled starting from the
+     * updated next execution time after the update time based on the
+     * time_specification in the updated Schedule. All unstarted runs before the
+     * update time will be skipped while already created runs will NOT be paused
+     * or canceled.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.aiplatform.v1beta1.Schedule> + updateSchedule(com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateScheduleMethod(), getCallOptions()), request); + } } private static final int METHODID_CREATE_SCHEDULE = 0; @@ -825,6 +950,7 @@ protected ScheduleServiceFutureStub build( private static final int METHODID_LIST_SCHEDULES = 3; private static final int METHODID_PAUSE_SCHEDULE = 4; private static final int METHODID_RESUME_SCHEDULE = 5; + private static final int METHODID_UPDATE_SCHEDULE = 6; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -877,6 +1003,12 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_UPDATE_SCHEDULE: + serviceImpl.updateSchedule( + (com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; default: throw new AssertionError(); } @@ -933,6 +1065,13 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.cloud.aiplatform.v1beta1.ResumeScheduleRequest, com.google.protobuf.Empty>(service, METHODID_RESUME_SCHEDULE))) + .addMethod( + getUpdateScheduleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest, + com.google.cloud.aiplatform.v1beta1.Schedule>( + service, METHODID_UPDATE_SCHEDULE))) .build(); } @@ -990,6 +1129,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListSchedulesMethod()) .addMethod(getPauseScheduleMethod()) .addMethod(getResumeScheduleMethod()) + .addMethod(getUpdateScheduleMethod()) .build(); } } diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Examples.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Examples.java new file mode 100644 index 000000000000..6513c2865e9d --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Examples.java @@ -0,0 +1,2709 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/explanation.proto + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Example-based explainability that returns the nearest neighbors from the
+ * provided dataset.
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.Examples} + */ +public final class Examples extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.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(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Examples_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Examples_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.Examples.class, + com.google.cloud.aiplatform.v1.Examples.Builder.class); + } + + public interface ExampleGcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @return The dataFormat. + */ + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat getDataFormat(); + + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.aiplatform.v1.GcsSource gcs_source = 2; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.aiplatform.v1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + com.google.cloud.aiplatform.v1.GcsSource getGcsSource(); + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.aiplatform.v1.GcsSource gcs_source = 2; + */ + com.google.cloud.aiplatform.v1.GcsSourceOrBuilder getGcsSourceOrBuilder(); + } + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.Examples.ExampleGcsSource} + */ + public static final class ExampleGcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.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(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Examples_ExampleGcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Examples_ExampleGcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.class, + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.Builder.class); + } + + /** + * + * + *
+     * The format of the input example instances.
+     * 
+ * + * Protobuf enum {@code google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @return The dataFormat. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat getDataFormat() { + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat result = + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat.forNumber( + dataFormat_); + return result == null + ? com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat.UNRECOGNIZED + : result; + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.aiplatform.v1.GcsSource gcsSource_; + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.aiplatform.v1.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.aiplatform.v1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.GcsSource getGcsSource() { + return gcsSource_ == null + ? com.google.cloud.aiplatform.v1.GcsSource.getDefaultInstance() + : gcsSource_; + } + /** + * + * + *
+     * The Cloud Storage location for the input instances.
+     * 
+ * + * .google.cloud.aiplatform.v1.GcsSource gcs_source = 2; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + return gcsSource_ == null + ? com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource other = + (com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.Examples.ExampleGcsSource) + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Examples_ExampleGcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Examples_ExampleGcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.class, + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.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.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Examples_ExampleGcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource build() { + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource buildPartial() { + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource result = + new com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource) { + return mergeFrom((com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource other) { + if (other == com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @return The dataFormat. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat getDataFormat() { + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat result = + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.DataFormat.forNumber( + dataFormat_); + return result == null + ? com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource.DataFormat data_format = 1; + * + * + * @param value The dataFormat to set. + * @return This builder for chaining. + */ + public Builder setDataFormat( + com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.GcsSource gcsSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.GcsSource, + com.google.cloud.aiplatform.v1.GcsSource.Builder, + com.google.cloud.aiplatform.v1.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.aiplatform.v1.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.aiplatform.v1.GcsSource gcs_source = 2; + * + * @return The gcsSource. + */ + public com.google.cloud.aiplatform.v1.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + return gcsSource_ == null + ? com.google.cloud.aiplatform.v1.GcsSource.getDefaultInstance() + : gcsSource_; + } else { + return gcsSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.aiplatform.v1.GcsSource gcs_source = 2; + */ + public Builder setGcsSource(com.google.cloud.aiplatform.v1.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.aiplatform.v1.GcsSource gcs_source = 2; + */ + public Builder setGcsSource( + com.google.cloud.aiplatform.v1.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.aiplatform.v1.GcsSource gcs_source = 2; + */ + public Builder mergeGcsSource(com.google.cloud.aiplatform.v1.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && gcsSource_ != null + && gcsSource_ != com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.GcsSource gcs_source = 2; + */ + public com.google.cloud.aiplatform.v1.GcsSource.Builder getGcsSourceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.aiplatform.v1.GcsSource gcs_source = 2; + */ + public com.google.cloud.aiplatform.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (gcsSourceBuilder_ != null) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + return gcsSource_ == null + ? com.google.cloud.aiplatform.v1.GcsSource.getDefaultInstance() + : gcsSource_; + } + } + /** + * + * + *
+       * The Cloud Storage location for the input instances.
+       * 
+ * + * .google.cloud.aiplatform.v1.GcsSource gcs_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.GcsSource, + com.google.cloud.aiplatform.v1.GcsSource.Builder, + com.google.cloud.aiplatform.v1.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.GcsSource, + com.google.cloud.aiplatform.v1.GcsSource.Builder, + com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.Examples.ExampleGcsSource) + private static final com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource(); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int sourceCase_ = 0; + 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; + 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.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + * + * @return The exampleGcsSource. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource getExampleGcsSource() { + if (sourceCase_ == 5) { + return (com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource) source_; + } + return com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * .google.cloud.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples.ExampleGcsSourceOrBuilder + getExampleGcsSourceOrBuilder() { + if (sourceCase_ == 5) { + return (com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource) source_; + } + return com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets presets = 4; + * + * @return The presets. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Presets getPresets() { + if (configCase_ == 4) { + return (com.google.cloud.aiplatform.v1.Presets) config_; + } + return com.google.cloud.aiplatform.v1.Presets.getDefaultInstance(); + } + /** + * + * + *
+   * Simplified preset configuration, which automatically sets configuration
+   * values based on the desired query speed-precision trade-off and modality.
+   * 
+ * + * .google.cloud.aiplatform.v1.Presets presets = 4; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.PresetsOrBuilder getPresetsOrBuilder() { + if (configCase_ == 4) { + return (com.google.cloud.aiplatform.v1.Presets) config_; + } + return com.google.cloud.aiplatform.v1.Presets.getDefaultInstance(); + } + + 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 (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.aiplatform.v1.Presets) config_); + } + if (sourceCase_ == 5) { + output.writeMessage(5, (com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource) source_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.aiplatform.v1.Presets) config_); + } + if (sourceCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.Examples other = (com.google.cloud.aiplatform.v1.Examples) obj; + + 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(); + 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.aiplatform.v1.Examples parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.Examples parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Examples parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Examples} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.Examples) + com.google.cloud.aiplatform.v1.ExamplesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Examples_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Examples_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.Examples.class, + com.google.cloud.aiplatform.v1.Examples.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.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(); + } + 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.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Examples_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.Examples.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples build() { + com.google.cloud.aiplatform.v1.Examples result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples buildPartial() { + com.google.cloud.aiplatform.v1.Examples result = + new com.google.cloud.aiplatform.v1.Examples(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.Examples result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.neighborCount_ = neighborCount_; + } + } + + private void buildPartialOneofs(com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples) { + return mergeFrom((com.google.cloud.aiplatform.v1.Examples) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.Examples other) { + if (other == com.google.cloud.aiplatform.v1.Examples.getDefaultInstance()) return this; + 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 18: + { + input.readMessage( + getNearestNeighborSearchConfigFieldBuilder().getBuilder(), extensionRegistry); + configCase_ = 2; + break; + } // case 18 + case 24: + { + neighborCount_ = input.readInt32(); + bitField0_ |= 0x00000008; + 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.aiplatform.v1.Examples.ExampleGcsSource, + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.Builder, + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSourceOrBuilder> + exampleGcsSourceBuilder_; + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + * + * @return The exampleGcsSource. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource getExampleGcsSource() { + if (exampleGcsSourceBuilder_ == null) { + if (sourceCase_ == 5) { + return (com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource) source_; + } + return com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 5) { + return exampleGcsSourceBuilder_.getMessage(); + } + return com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + public Builder setExampleGcsSource( + com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + public Builder setExampleGcsSource( + com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + public Builder mergeExampleGcsSource( + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource value) { + if (exampleGcsSourceBuilder_ == null) { + if (sourceCase_ == 5 + && source_ + != com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.newBuilder( + (com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + public com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.Builder + getExampleGcsSourceBuilder() { + return getExampleGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples.ExampleGcsSourceOrBuilder + getExampleGcsSourceOrBuilder() { + if ((sourceCase_ == 5) && (exampleGcsSourceBuilder_ != null)) { + return exampleGcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 5) { + return (com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource) source_; + } + return com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Cloud Storage input instances.
+     * 
+ * + * .google.cloud.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource, + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.Builder, + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSourceOrBuilder> + getExampleGcsSourceFieldBuilder() { + if (exampleGcsSourceBuilder_ == null) { + if (!(sourceCase_ == 5)) { + source_ = com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.getDefaultInstance(); + } + exampleGcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource, + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource.Builder, + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSourceOrBuilder>( + (com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets, + com.google.cloud.aiplatform.v1.Presets.Builder, + com.google.cloud.aiplatform.v1.PresetsOrBuilder> + presetsBuilder_; + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.aiplatform.v1.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.aiplatform.v1.Presets presets = 4; + * + * @return The presets. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Presets getPresets() { + if (presetsBuilder_ == null) { + if (configCase_ == 4) { + return (com.google.cloud.aiplatform.v1.Presets) config_; + } + return com.google.cloud.aiplatform.v1.Presets.getDefaultInstance(); + } else { + if (configCase_ == 4) { + return presetsBuilder_.getMessage(); + } + return com.google.cloud.aiplatform.v1.Presets.getDefaultInstance(); + } + } + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.aiplatform.v1.Presets presets = 4; + */ + public Builder setPresets(com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets presets = 4; + */ + public Builder setPresets(com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets presets = 4; + */ + public Builder mergePresets(com.google.cloud.aiplatform.v1.Presets value) { + if (presetsBuilder_ == null) { + if (configCase_ == 4 + && config_ != com.google.cloud.aiplatform.v1.Presets.getDefaultInstance()) { + config_ = + com.google.cloud.aiplatform.v1.Presets.newBuilder( + (com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets presets = 4; + */ + public com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets presets = 4; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.PresetsOrBuilder getPresetsOrBuilder() { + if ((configCase_ == 4) && (presetsBuilder_ != null)) { + return presetsBuilder_.getMessageOrBuilder(); + } else { + if (configCase_ == 4) { + return (com.google.cloud.aiplatform.v1.Presets) config_; + } + return com.google.cloud.aiplatform.v1.Presets.getDefaultInstance(); + } + } + /** + * + * + *
+     * Simplified preset configuration, which automatically sets configuration
+     * values based on the desired query speed-precision trade-off and modality.
+     * 
+ * + * .google.cloud.aiplatform.v1.Presets presets = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.Presets, + com.google.cloud.aiplatform.v1.Presets.Builder, + com.google.cloud.aiplatform.v1.PresetsOrBuilder> + getPresetsFieldBuilder() { + if (presetsBuilder_ == null) { + if (!(configCase_ == 4)) { + config_ = com.google.cloud.aiplatform.v1.Presets.getDefaultInstance(); + } + presetsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.Presets, + com.google.cloud.aiplatform.v1.Presets.Builder, + com.google.cloud.aiplatform.v1.PresetsOrBuilder>( + (com.google.cloud.aiplatform.v1.Presets) config_, + getParentForChildren(), + isClean()); + config_ = null; + } + configCase_ = 4; + onChanged(); + return presetsBuilder_; + } + + 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_ |= 0x00000008; + 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_ & ~0x00000008); + 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.aiplatform.v1.Examples) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.Examples) + private static final com.google.cloud.aiplatform.v1.Examples DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.Examples(); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExamplesOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExamplesOrBuilder.java new file mode 100644 index 000000000000..371a98d045da --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExamplesOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/explanation.proto + +package com.google.cloud.aiplatform.v1; + +public interface ExamplesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.Examples) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * .google.cloud.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + * + * @return Whether the exampleGcsSource field is set. + */ + boolean hasExampleGcsSource(); + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * .google.cloud.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + * + * @return The exampleGcsSource. + */ + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSource getExampleGcsSource(); + /** + * + * + *
+   * The Cloud Storage input instances.
+   * 
+ * + * .google.cloud.aiplatform.v1.Examples.ExampleGcsSource example_gcs_source = 5; + */ + com.google.cloud.aiplatform.v1.Examples.ExampleGcsSourceOrBuilder getExampleGcsSourceOrBuilder(); + + /** + * + * + *
+   * The full configuration for the generated index, the semantics are the
+   * same as [metadata][google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets presets = 4; + * + * @return The presets. + */ + com.google.cloud.aiplatform.v1.Presets getPresets(); + /** + * + * + *
+   * Simplified preset configuration, which automatically sets configuration
+   * values based on the desired query speed-precision trade-off and modality.
+   * 
+ * + * .google.cloud.aiplatform.v1.Presets presets = 4; + */ + com.google.cloud.aiplatform.v1.PresetsOrBuilder getPresetsOrBuilder(); + + /** + * + * + *
+   * The number of neighbors to return when querying for examples.
+   * 
+ * + * int32 neighbor_count = 3; + * + * @return The neighborCount. + */ + int getNeighborCount(); + + public com.google.cloud.aiplatform.v1.Examples.SourceCase getSourceCase(); + + public com.google.cloud.aiplatform.v1.Examples.ConfigCase getConfigCase(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationParameters.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationParameters.java index ff74e65be707..39e77d38f663 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationParameters.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationParameters.java @@ -75,6 +75,7 @@ public enum MethodCase SAMPLED_SHAPLEY_ATTRIBUTION(1), INTEGRATED_GRADIENTS_ATTRIBUTION(2), XRAI_ATTRIBUTION(3), + EXAMPLES(7), METHOD_NOT_SET(0); private final int value; @@ -99,6 +100,8 @@ public static MethodCase forNumber(int value) { return INTEGRATED_GRADIENTS_ATTRIBUTION; case 3: return XRAI_ATTRIBUTION; + case 7: + return EXAMPLES; case 0: return METHOD_NOT_SET; default: @@ -316,6 +319,60 @@ public com.google.cloud.aiplatform.v1.XraiAttributionOrBuilder getXraiAttributio return com.google.cloud.aiplatform.v1.XraiAttribution.getDefaultInstance(); } + public static final int EXAMPLES_FIELD_NUMBER = 7; + /** + * + * + *
+   * Example-based explanations that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * .google.cloud.aiplatform.v1.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.aiplatform.v1.Examples examples = 7; + * + * @return The examples. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples getExamples() { + if (methodCase_ == 7) { + return (com.google.cloud.aiplatform.v1.Examples) method_; + } + return com.google.cloud.aiplatform.v1.Examples.getDefaultInstance(); + } + /** + * + * + *
+   * Example-based explanations that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * .google.cloud.aiplatform.v1.Examples examples = 7; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.ExamplesOrBuilder getExamplesOrBuilder() { + if (methodCase_ == 7) { + return (com.google.cloud.aiplatform.v1.Examples) method_; + } + return com.google.cloud.aiplatform.v1.Examples.getDefaultInstance(); + } + public static final int TOP_K_FIELD_NUMBER = 4; private int topK_ = 0; /** @@ -444,6 +501,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (outputIndices_ != null) { output.writeMessage(5, getOutputIndices()); } + if (methodCase_ == 7) { + output.writeMessage(7, (com.google.cloud.aiplatform.v1.Examples) method_); + } getUnknownFields().writeTo(output); } @@ -474,6 +534,11 @@ public int getSerializedSize() { if (outputIndices_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getOutputIndices()); } + if (methodCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.aiplatform.v1.Examples) method_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -508,6 +573,9 @@ public boolean equals(final java.lang.Object obj) { case 3: if (!getXraiAttribution().equals(other.getXraiAttribution())) return false; break; + case 7: + if (!getExamples().equals(other.getExamples())) return false; + break; case 0: default: } @@ -541,6 +609,10 @@ public int hashCode() { 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: } @@ -692,6 +764,9 @@ public Builder clear() { if (xraiAttributionBuilder_ != null) { xraiAttributionBuilder_.clear(); } + if (examplesBuilder_ != null) { + examplesBuilder_.clear(); + } topK_ = 0; outputIndices_ = null; if (outputIndicesBuilder_ != null) { @@ -737,10 +812,10 @@ public com.google.cloud.aiplatform.v1.ExplanationParameters buildPartial() { private void buildPartial0(com.google.cloud.aiplatform.v1.ExplanationParameters result) { int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000008) != 0)) { + if (((from_bitField0_ & 0x00000010) != 0)) { result.topK_ = topK_; } - if (((from_bitField0_ & 0x00000010) != 0)) { + if (((from_bitField0_ & 0x00000020) != 0)) { result.outputIndices_ = outputIndicesBuilder_ == null ? outputIndices_ : outputIndicesBuilder_.build(); } @@ -758,6 +833,9 @@ private void buildPartialOneofs(com.google.cloud.aiplatform.v1.ExplanationParame if (methodCase_ == 3 && xraiAttributionBuilder_ != null) { result.method_ = xraiAttributionBuilder_.build(); } + if (methodCase_ == 7 && examplesBuilder_ != null) { + result.method_ = examplesBuilder_.build(); + } } @java.lang.Override @@ -828,6 +906,11 @@ public Builder mergeFrom(com.google.cloud.aiplatform.v1.ExplanationParameters ot mergeXraiAttribution(other.getXraiAttribution()); break; } + case EXAMPLES: + { + mergeExamples(other.getExamples()); + break; + } case METHOD_NOT_SET: { break; @@ -883,15 +966,21 @@ public Builder mergeFrom( case 32: { topK_ = input.readInt32(); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; break; } // case 32 case 42: { input.readMessage(getOutputIndicesFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; break; } // case 42 + case 58: + { + input.readMessage(getExamplesFieldBuilder().getBuilder(), extensionRegistry); + methodCase_ = 7; + break; + } // case 58 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1700,6 +1789,223 @@ public com.google.cloud.aiplatform.v1.XraiAttributionOrBuilder getXraiAttributio return xraiAttributionBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.Examples, + com.google.cloud.aiplatform.v1.Examples.Builder, + com.google.cloud.aiplatform.v1.ExamplesOrBuilder> + examplesBuilder_; + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.aiplatform.v1.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.aiplatform.v1.Examples examples = 7; + * + * @return The examples. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Examples getExamples() { + if (examplesBuilder_ == null) { + if (methodCase_ == 7) { + return (com.google.cloud.aiplatform.v1.Examples) method_; + } + return com.google.cloud.aiplatform.v1.Examples.getDefaultInstance(); + } else { + if (methodCase_ == 7) { + return examplesBuilder_.getMessage(); + } + return com.google.cloud.aiplatform.v1.Examples.getDefaultInstance(); + } + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.aiplatform.v1.Examples examples = 7; + */ + public Builder setExamples(com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples examples = 7; + */ + public Builder setExamples(com.google.cloud.aiplatform.v1.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.aiplatform.v1.Examples examples = 7; + */ + public Builder mergeExamples(com.google.cloud.aiplatform.v1.Examples value) { + if (examplesBuilder_ == null) { + if (methodCase_ == 7 + && method_ != com.google.cloud.aiplatform.v1.Examples.getDefaultInstance()) { + method_ = + com.google.cloud.aiplatform.v1.Examples.newBuilder( + (com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Examples examples = 7; + */ + public com.google.cloud.aiplatform.v1.Examples.Builder getExamplesBuilder() { + return getExamplesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.aiplatform.v1.Examples examples = 7; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.ExamplesOrBuilder getExamplesOrBuilder() { + if ((methodCase_ == 7) && (examplesBuilder_ != null)) { + return examplesBuilder_.getMessageOrBuilder(); + } else { + if (methodCase_ == 7) { + return (com.google.cloud.aiplatform.v1.Examples) method_; + } + return com.google.cloud.aiplatform.v1.Examples.getDefaultInstance(); + } + } + /** + * + * + *
+     * Example-based explanations that returns the nearest neighbors from the
+     * provided dataset.
+     * 
+ * + * .google.cloud.aiplatform.v1.Examples examples = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.Examples, + com.google.cloud.aiplatform.v1.Examples.Builder, + com.google.cloud.aiplatform.v1.ExamplesOrBuilder> + getExamplesFieldBuilder() { + if (examplesBuilder_ == null) { + if (!(methodCase_ == 7)) { + method_ = com.google.cloud.aiplatform.v1.Examples.getDefaultInstance(); + } + examplesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.Examples, + com.google.cloud.aiplatform.v1.Examples.Builder, + com.google.cloud.aiplatform.v1.ExamplesOrBuilder>( + (com.google.cloud.aiplatform.v1.Examples) method_, + getParentForChildren(), + isClean()); + method_ = null; + } + methodCase_ = 7; + onChanged(); + return examplesBuilder_; + } + private int topK_; /** * @@ -1737,7 +2043,7 @@ public int getTopK() { public Builder setTopK(int value) { topK_ = value; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1756,7 +2062,7 @@ public Builder setTopK(int value) { * @return This builder for chaining. */ public Builder clearTopK() { - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000010); topK_ = 0; onChanged(); return this; @@ -1789,7 +2095,7 @@ public Builder clearTopK() { * @return Whether the outputIndices field is set. */ public boolean hasOutputIndices() { - return ((bitField0_ & 0x00000010) != 0); + return ((bitField0_ & 0x00000020) != 0); } /** * @@ -1847,7 +2153,7 @@ public Builder setOutputIndices(com.google.protobuf.ListValue value) { } else { outputIndicesBuilder_.setMessage(value); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -1875,7 +2181,7 @@ public Builder setOutputIndices(com.google.protobuf.ListValue.Builder builderFor } else { outputIndicesBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -1899,7 +2205,7 @@ public Builder setOutputIndices(com.google.protobuf.ListValue.Builder builderFor */ public Builder mergeOutputIndices(com.google.protobuf.ListValue value) { if (outputIndicesBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) + if (((bitField0_ & 0x00000020) != 0) && outputIndices_ != null && outputIndices_ != com.google.protobuf.ListValue.getDefaultInstance()) { getOutputIndicesBuilder().mergeFrom(value); @@ -1909,7 +2215,7 @@ public Builder mergeOutputIndices(com.google.protobuf.ListValue value) { } else { outputIndicesBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -1932,7 +2238,7 @@ public Builder mergeOutputIndices(com.google.protobuf.ListValue value) { * .google.protobuf.ListValue output_indices = 5; */ public Builder clearOutputIndices() { - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000020); outputIndices_ = null; if (outputIndicesBuilder_ != null) { outputIndicesBuilder_.dispose(); @@ -1960,7 +2266,7 @@ public Builder clearOutputIndices() { * .google.protobuf.ListValue output_indices = 5; */ public com.google.protobuf.ListValue.Builder getOutputIndicesBuilder() { - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return getOutputIndicesFieldBuilder().getBuilder(); } diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationParametersOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationParametersOrBuilder.java index 9365329d9cb1..4eb40cddd07e 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationParametersOrBuilder.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationParametersOrBuilder.java @@ -175,6 +175,44 @@ public interface ExplanationParametersOrBuilder */ com.google.cloud.aiplatform.v1.XraiAttributionOrBuilder getXraiAttributionOrBuilder(); + /** + * + * + *
+   * Example-based explanations that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * .google.cloud.aiplatform.v1.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.aiplatform.v1.Examples examples = 7; + * + * @return The examples. + */ + com.google.cloud.aiplatform.v1.Examples getExamples(); + /** + * + * + *
+   * Example-based explanations that returns the nearest neighbors from the
+   * provided dataset.
+   * 
+ * + * .google.cloud.aiplatform.v1.Examples examples = 7; + */ + com.google.cloud.aiplatform.v1.ExamplesOrBuilder getExamplesOrBuilder(); + /** * * diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationProto.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationProto.java index cbb23df8b8b3..c4a010f990dc 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationProto.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ExplanationProto.java @@ -79,6 +79,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_aiplatform_v1_BlurBaselineConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_aiplatform_v1_BlurBaselineConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_Examples_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_Examples_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_Examples_ExampleGcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_Examples_ExampleGcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_Presets_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_Presets_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_aiplatform_v1_ExplanationSpecOverride_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -116,86 +128,107 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + ".proto\022\032google.cloud.aiplatform.v1\032\037goog" + "le/api/field_behavior.proto\0325google/clou" + "d/aiplatform/v1/explanation_metadata.pro" - + "to\032\034google/protobuf/struct.proto\"\217\001\n\013Exp" - + "lanation\022B\n\014attributions\030\001 \003(\0132\'.google." - + "cloud.aiplatform.v1.AttributionB\003\340A\003\022<\n\t" - + "neighbors\030\002 \003(\0132$.google.cloud.aiplatfor" - + "m.v1.NeighborB\003\340A\003\"[\n\020ModelExplanation\022G" - + "\n\021mean_attributions\030\001 \003(\0132\'.google.cloud" - + ".aiplatform.v1.AttributionB\003\340A\003\"\211\002\n\013Attr" - + "ibution\022\"\n\025baseline_output_value\030\001 \001(\001B\003" - + "\340A\003\022\"\n\025instance_output_value\030\002 \001(\001B\003\340A\003\022" - + "9\n\024feature_attributions\030\003 \001(\0132\026.google.p" - + "rotobuf.ValueB\003\340A\003\022\031\n\014output_index\030\004 \003(\005" - + "B\003\340A\003\022 \n\023output_display_name\030\005 \001(\tB\003\340A\003\022" - + " \n\023approximation_error\030\006 \001(\001B\003\340A\003\022\030\n\013out" - + "put_name\030\007 \001(\tB\003\340A\003\"D\n\010Neighbor\022\030\n\013neigh" - + "bor_id\030\001 \001(\tB\003\340A\003\022\036\n\021neighbor_distance\030\002" - + " \001(\001B\003\340A\003\"\245\001\n\017ExplanationSpec\022J\n\nparamet" - + "ers\030\001 \001(\01321.google.cloud.aiplatform.v1.E" - + "xplanationParametersB\003\340A\002\022F\n\010metadata\030\002 " - + "\001(\0132/.google.cloud.aiplatform.v1.Explana" - + "tionMetadataB\003\340A\001\"\363\002\n\025ExplanationParamet" - + "ers\022\\\n\033sampled_shapley_attribution\030\001 \001(\013" - + "25.google.cloud.aiplatform.v1.SampledSha" - + "pleyAttributionH\000\022f\n integrated_gradient" - + "s_attribution\030\002 \001(\0132:.google.cloud.aipla" - + "tform.v1.IntegratedGradientsAttributionH" - + "\000\022G\n\020xrai_attribution\030\003 \001(\0132+.google.clo" - + "ud.aiplatform.v1.XraiAttributionH\000\022\r\n\005to" - + "p_k\030\004 \001(\005\0222\n\016output_indices\030\005 \001(\0132\032.goog" - + "le.protobuf.ListValueB\010\n\006method\"4\n\031Sampl" - + "edShapleyAttribution\022\027\n\npath_count\030\001 \001(\005" - + "B\003\340A\002\"\321\001\n\036IntegratedGradientsAttribution" - + "\022\027\n\nstep_count\030\001 \001(\005B\003\340A\002\022H\n\022smooth_grad" - + "_config\030\002 \001(\0132,.google.cloud.aiplatform." - + "v1.SmoothGradConfig\022L\n\024blur_baseline_con" - + "fig\030\003 \001(\0132..google.cloud.aiplatform.v1.B" - + "lurBaselineConfig\"\302\001\n\017XraiAttribution\022\027\n" - + "\nstep_count\030\001 \001(\005B\003\340A\002\022H\n\022smooth_grad_co" - + "nfig\030\002 \001(\0132,.google.cloud.aiplatform.v1." - + "SmoothGradConfig\022L\n\024blur_baseline_config" - + "\030\003 \001(\0132..google.cloud.aiplatform.v1.Blur" - + "BaselineConfig\"\251\001\n\020SmoothGradConfig\022\025\n\013n" - + "oise_sigma\030\001 \001(\002H\000\022L\n\023feature_noise_sigm" - + "a\030\002 \001(\0132-.google.cloud.aiplatform.v1.Fea" - + "tureNoiseSigmaH\000\022\032\n\022noisy_sample_count\030\003" - + " \001(\005B\024\n\022GradientNoiseSigma\"\241\001\n\021FeatureNo" - + "iseSigma\022W\n\013noise_sigma\030\001 \003(\0132B.google.c" - + "loud.aiplatform.v1.FeatureNoiseSigma.Noi" - + "seSigmaForFeature\0323\n\024NoiseSigmaForFeatur" - + "e\022\014\n\004name\030\001 \001(\t\022\r\n\005sigma\030\002 \001(\002\",\n\022BlurBa" - + "selineConfig\022\026\n\016max_blur_sigma\030\001 \001(\002\"\364\001\n" - + "\027ExplanationSpecOverride\022E\n\nparameters\030\001" - + " \001(\01321.google.cloud.aiplatform.v1.Explan" - + "ationParameters\022I\n\010metadata\030\002 \001(\01327.goog" - + "le.cloud.aiplatform.v1.ExplanationMetada" - + "taOverride\022G\n\021examples_override\030\003 \001(\0132,." - + "google.cloud.aiplatform.v1.ExamplesOverr" - + "ide\"\277\002\n\033ExplanationMetadataOverride\022X\n\006i" - + "nputs\030\001 \003(\0132C.google.cloud.aiplatform.v1" - + ".ExplanationMetadataOverride.InputsEntry" - + "B\003\340A\002\032H\n\025InputMetadataOverride\022/\n\017input_" - + "baselines\030\001 \003(\0132\026.google.protobuf.Value\032" - + "|\n\013InputsEntry\022\013\n\003key\030\001 \001(\t\022\\\n\005value\030\002 \001" - + "(\0132M.google.cloud.aiplatform.v1.Explanat" - + "ionMetadataOverride.InputMetadataOverrid" - + "e:\0028\001\"\306\002\n\020ExamplesOverride\022\026\n\016neighbor_c" - + "ount\030\001 \001(\005\022\026\n\016crowding_count\030\002 \001(\005\022O\n\014re" - + "strictions\030\003 \003(\01329.google.cloud.aiplatfo" - + "rm.v1.ExamplesRestrictionsNamespace\022\031\n\021r" - + "eturn_embeddings\030\004 \001(\010\022L\n\013data_format\030\005 " - + "\001(\01627.google.cloud.aiplatform.v1.Example" - + "sOverride.DataFormat\"H\n\nDataFormat\022\033\n\027DA" - + "TA_FORMAT_UNSPECIFIED\020\000\022\r\n\tINSTANCES\020\001\022\016" - + "\n\nEMBEDDINGS\020\002\"T\n\035ExamplesRestrictionsNa" - + "mespace\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\316\001\n\036com.google.clou" - + "d.aiplatform.v1B\020ExplanationProtoP\001Z>clo" - + "ud.google.com/go/aiplatform/apiv1/aiplat" - + "formpb;aiplatformpb\252\002\032Google.Cloud.AIPla" - + "tform.V1\312\002\032Google\\Cloud\\AIPlatform\\V1\352\002\035" - + "Google::Cloud::AIPlatform::V1b\006proto3" + + "to\032#google/cloud/aiplatform/v1/io.proto\032" + + "\034google/protobuf/struct.proto\"\217\001\n\013Explan" + + "ation\022B\n\014attributions\030\001 \003(\0132\'.google.clo" + + "ud.aiplatform.v1.AttributionB\003\340A\003\022<\n\tnei" + + "ghbors\030\002 \003(\0132$.google.cloud.aiplatform.v" + + "1.NeighborB\003\340A\003\"[\n\020ModelExplanation\022G\n\021m" + + "ean_attributions\030\001 \003(\0132\'.google.cloud.ai" + + "platform.v1.AttributionB\003\340A\003\"\211\002\n\013Attribu" + + "tion\022\"\n\025baseline_output_value\030\001 \001(\001B\003\340A\003" + + "\022\"\n\025instance_output_value\030\002 \001(\001B\003\340A\003\0229\n\024" + + "feature_attributions\030\003 \001(\0132\026.google.prot" + + "obuf.ValueB\003\340A\003\022\031\n\014output_index\030\004 \003(\005B\003\340" + + "A\003\022 \n\023output_display_name\030\005 \001(\tB\003\340A\003\022 \n\023" + + "approximation_error\030\006 \001(\001B\003\340A\003\022\030\n\013output" + + "_name\030\007 \001(\tB\003\340A\003\"D\n\010Neighbor\022\030\n\013neighbor" + + "_id\030\001 \001(\tB\003\340A\003\022\036\n\021neighbor_distance\030\002 \001(" + + "\001B\003\340A\003\"\245\001\n\017ExplanationSpec\022J\n\nparameters" + + "\030\001 \001(\01321.google.cloud.aiplatform.v1.Expl" + + "anationParametersB\003\340A\002\022F\n\010metadata\030\002 \001(\013" + + "2/.google.cloud.aiplatform.v1.Explanatio" + + "nMetadataB\003\340A\001\"\255\003\n\025ExplanationParameters" + + "\022\\\n\033sampled_shapley_attribution\030\001 \001(\01325." + + "google.cloud.aiplatform.v1.SampledShaple" + + "yAttributionH\000\022f\n integrated_gradients_a" + + "ttribution\030\002 \001(\0132:.google.cloud.aiplatfo" + + "rm.v1.IntegratedGradientsAttributionH\000\022G" + + "\n\020xrai_attribution\030\003 \001(\0132+.google.cloud." + + "aiplatform.v1.XraiAttributionH\000\0228\n\010examp" + + "les\030\007 \001(\0132$.google.cloud.aiplatform.v1.E" + + "xamplesH\000\022\r\n\005top_k\030\004 \001(\005\0222\n\016output_indic" + + "es\030\005 \001(\0132\032.google.protobuf.ListValueB\010\n\006" + + "method\"4\n\031SampledShapleyAttribution\022\027\n\np" + + "ath_count\030\001 \001(\005B\003\340A\002\"\321\001\n\036IntegratedGradi" + + "entsAttribution\022\027\n\nstep_count\030\001 \001(\005B\003\340A\002" + + "\022H\n\022smooth_grad_config\030\002 \001(\0132,.google.cl" + + "oud.aiplatform.v1.SmoothGradConfig\022L\n\024bl" + + "ur_baseline_config\030\003 \001(\0132..google.cloud." + + "aiplatform.v1.BlurBaselineConfig\"\302\001\n\017Xra" + + "iAttribution\022\027\n\nstep_count\030\001 \001(\005B\003\340A\002\022H\n" + + "\022smooth_grad_config\030\002 \001(\0132,.google.cloud" + + ".aiplatform.v1.SmoothGradConfig\022L\n\024blur_" + + "baseline_config\030\003 \001(\0132..google.cloud.aip" + + "latform.v1.BlurBaselineConfig\"\251\001\n\020Smooth" + + "GradConfig\022\025\n\013noise_sigma\030\001 \001(\002H\000\022L\n\023fea" + + "ture_noise_sigma\030\002 \001(\0132-.google.cloud.ai" + + "platform.v1.FeatureNoiseSigmaH\000\022\032\n\022noisy" + + "_sample_count\030\003 \001(\005B\024\n\022GradientNoiseSigm" + + "a\"\241\001\n\021FeatureNoiseSigma\022W\n\013noise_sigma\030\001" + + " \003(\0132B.google.cloud.aiplatform.v1.Featur" + + "eNoiseSigma.NoiseSigmaForFeature\0323\n\024Nois" + + "eSigmaForFeature\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\"\342\003\n\010Examples\022S\n\022example_gcs_" + + "source\030\005 \001(\01325.google.cloud.aiplatform.v" + + "1.Examples.ExampleGcsSourceH\000\022@\n\036nearest" + + "_neighbor_search_config\030\002 \001(\0132\026.google.p" + + "rotobuf.ValueH\001\0226\n\007presets\030\004 \001(\0132#.googl" + + "e.cloud.aiplatform.v1.PresetsH\001\022\026\n\016neigh" + + "bor_count\030\003 \001(\005\032\332\001\n\020ExampleGcsSource\022U\n\013" + + "data_format\030\001 \001(\0162@.google.cloud.aiplatf" + + "orm.v1.Examples.ExampleGcsSource.DataFor" + + "mat\0229\n\ngcs_source\030\002 \001(\0132%.google.cloud.a" + + "iplatform.v1.GcsSource\"4\n\nDataFormat\022\033\n\027" + + "DATA_FORMAT_UNSPECIFIED\020\000\022\t\n\005JSONL\020\001B\010\n\006" + + "sourceB\010\n\006config\"\372\001\n\007Presets\022=\n\005query\030\001 " + + "\001(\0162).google.cloud.aiplatform.v1.Presets" + + ".QueryH\000\210\001\001\022>\n\010modality\030\002 \001(\0162,.google.c" + + "loud.aiplatform.v1.Presets.Modality\"\036\n\005Q" + + "uery\022\013\n\007PRECISE\020\000\022\010\n\004FAST\020\001\"F\n\010Modality\022" + + "\030\n\024MODALITY_UNSPECIFIED\020\000\022\t\n\005IMAGE\020\001\022\010\n\004" + + "TEXT\020\002\022\013\n\007TABULAR\020\003B\010\n\006_query\"\364\001\n\027Explan" + + "ationSpecOverride\022E\n\nparameters\030\001 \001(\01321." + + "google.cloud.aiplatform.v1.ExplanationPa" + + "rameters\022I\n\010metadata\030\002 \001(\01327.google.clou" + + "d.aiplatform.v1.ExplanationMetadataOverr" + + "ide\022G\n\021examples_override\030\003 \001(\0132,.google." + + "cloud.aiplatform.v1.ExamplesOverride\"\277\002\n" + + "\033ExplanationMetadataOverride\022X\n\006inputs\030\001" + + " \003(\0132C.google.cloud.aiplatform.v1.Explan" + + "ationMetadataOverride.InputsEntryB\003\340A\002\032H" + + "\n\025InputMetadataOverride\022/\n\017input_baselin" + + "es\030\001 \003(\0132\026.google.protobuf.Value\032|\n\013Inpu" + + "tsEntry\022\013\n\003key\030\001 \001(\t\022\\\n\005value\030\002 \001(\0132M.go" + + "ogle.cloud.aiplatform.v1.ExplanationMeta" + + "dataOverride.InputMetadataOverride:\0028\001\"\306" + + "\002\n\020ExamplesOverride\022\026\n\016neighbor_count\030\001 " + + "\001(\005\022\026\n\016crowding_count\030\002 \001(\005\022O\n\014restricti" + + "ons\030\003 \003(\01329.google.cloud.aiplatform.v1.E" + + "xamplesRestrictionsNamespace\022\031\n\021return_e" + + "mbeddings\030\004 \001(\010\022L\n\013data_format\030\005 \001(\01627.g" + + "oogle.cloud.aiplatform.v1.ExamplesOverri" + + "de.DataFormat\"H\n\nDataFormat\022\033\n\027DATA_FORM" + + "AT_UNSPECIFIED\020\000\022\r\n\tINSTANCES\020\001\022\016\n\nEMBED" + + "DINGS\020\002\"T\n\035ExamplesRestrictionsNamespace" + + "\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\316\001\n\036com.google.cloud.aipla" + + "tform.v1B\020ExplanationProtoP\001Z>cloud.goog" + + "le.com/go/aiplatform/apiv1/aiplatformpb;" + + "aiplatformpb\252\002\032Google.Cloud.AIPlatform.V" + + "1\312\002\032Google\\Cloud\\AIPlatform\\V1\352\002\035Google:" + + ":Cloud::AIPlatform::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -203,6 +236,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.cloud.aiplatform.v1.ExplanationMetadataProto.getDescriptor(), + com.google.cloud.aiplatform.v1.IoProto.getDescriptor(), com.google.protobuf.StructProto.getDescriptor(), }); internal_static_google_cloud_aiplatform_v1_Explanation_descriptor = @@ -260,6 +294,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SampledShapleyAttribution", "IntegratedGradientsAttribution", "XraiAttribution", + "Examples", "TopK", "OutputIndices", "Method", @@ -322,8 +357,37 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "MaxBlurSigma", }); - internal_static_google_cloud_aiplatform_v1_ExplanationSpecOverride_descriptor = + internal_static_google_cloud_aiplatform_v1_Examples_descriptor = getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_aiplatform_v1_Examples_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_Examples_descriptor, + new java.lang.String[] { + "ExampleGcsSource", + "NearestNeighborSearchConfig", + "Presets", + "NeighborCount", + "Source", + "Config", + }); + internal_static_google_cloud_aiplatform_v1_Examples_ExampleGcsSource_descriptor = + internal_static_google_cloud_aiplatform_v1_Examples_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_aiplatform_v1_Examples_ExampleGcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_Examples_ExampleGcsSource_descriptor, + new java.lang.String[] { + "DataFormat", "GcsSource", + }); + internal_static_google_cloud_aiplatform_v1_Presets_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_aiplatform_v1_Presets_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_Presets_descriptor, + new java.lang.String[] { + "Query", "Modality", "Query", + }); + internal_static_google_cloud_aiplatform_v1_ExplanationSpecOverride_descriptor = + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_aiplatform_v1_ExplanationSpecOverride_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1_ExplanationSpecOverride_descriptor, @@ -331,7 +395,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parameters", "Metadata", "ExamplesOverride", }); internal_static_google_cloud_aiplatform_v1_ExplanationMetadataOverride_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_aiplatform_v1_ExplanationMetadataOverride_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1_ExplanationMetadataOverride_descriptor, @@ -359,7 +423,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_aiplatform_v1_ExamplesOverride_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_aiplatform_v1_ExamplesOverride_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1_ExamplesOverride_descriptor, @@ -367,7 +431,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "NeighborCount", "CrowdingCount", "Restrictions", "ReturnEmbeddings", "DataFormat", }); internal_static_google_cloud_aiplatform_v1_ExamplesRestrictionsNamespace_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(17); internal_static_google_cloud_aiplatform_v1_ExamplesRestrictionsNamespace_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1_ExamplesRestrictionsNamespace_descriptor, @@ -381,6 +445,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.cloud.aiplatform.v1.ExplanationMetadataProto.getDescriptor(); + com.google.cloud.aiplatform.v1.IoProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); } diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsRequest.java new file mode 100644 index 000000000000..731ef7523d5c --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsRequest.java @@ -0,0 +1,2780 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/match_service.proto + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * The request message for
+ * [MatchService.FindNeighbors][google.cloud.aiplatform.v1.MatchService.FindNeighbors].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.FindNeighborsRequest} + */ +public final class FindNeighborsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.FindNeighborsRequest) + FindNeighborsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FindNeighborsRequest.newBuilder() to construct. + private FindNeighborsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FindNeighborsRequest() { + indexEndpoint_ = ""; + deployedIndexId_ = ""; + queries_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FindNeighborsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.FindNeighborsRequest.class, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Builder.class); + } + + public interface QueryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.FindNeighborsRequest.Query) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The datapoint/vector whose nearest neighbors should be searched
+     * for.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the datapoint field is set. + */ + boolean hasDatapoint(); + /** + * + * + *
+     * Required. The datapoint/vector whose nearest neighbors should be searched
+     * for.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The datapoint. + */ + com.google.cloud.aiplatform.v1.IndexDatapoint getDatapoint(); + /** + * + * + *
+     * Required. The datapoint/vector whose nearest neighbors should be searched
+     * for.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder getDatapointOrBuilder(); + + /** + * + * + *
+     * The number of nearest neighbors to be retrieved from database for each
+     * query. If not set, will use the default from the service configuration
+     * (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config).
+     * 
+ * + * int32 neighbor_count = 2; + * + * @return The neighborCount. + */ + int getNeighborCount(); + + /** + * + * + *
+     * Crowding is a constraint on a neighbor list produced by nearest neighbor
+     * search requiring that no more than some value k' of the k neighbors
+     * returned have the same value of crowding_attribute.
+     * It's used for improving result diversity.
+     * This field is the maximum number of matches with the same crowding tag.
+     * 
+ * + * int32 per_crowding_attribute_neighbor_count = 3; + * + * @return The perCrowdingAttributeNeighborCount. + */ + int getPerCrowdingAttributeNeighborCount(); + + /** + * + * + *
+     * The number of neighbors to find via approximate search before
+     * exact reordering is performed. If not set, the default value from scam
+     * config is used; if set, this value must be > 0.
+     * 
+ * + * int32 approximate_neighbor_count = 4; + * + * @return The approximateNeighborCount. + */ + int getApproximateNeighborCount(); + + /** + * + * + *
+     * The fraction of the number of leaves to search, set at query time allows
+     * user to tune search performance. This value increase result in both
+     * search accuracy and latency increase. The value should be between 0.0
+     * and 1.0. If not set or set to 0.0, query uses the default value specified
+     * in
+     * NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search.
+     * 
+ * + * double fraction_leaf_nodes_to_search_override = 5; + * + * @return The fractionLeafNodesToSearchOverride. + */ + double getFractionLeafNodesToSearchOverride(); + } + /** + * + * + *
+   * A query to find a number of the nearest neighbors (most similar vectors)
+   * of a vector.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.FindNeighborsRequest.Query} + */ + public static final class Query extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.FindNeighborsRequest.Query) + QueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use Query.newBuilder() to construct. + private Query(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Query() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Query(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_Query_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_Query_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.class, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder.class); + } + + public static final int DATAPOINT_FIELD_NUMBER = 1; + private com.google.cloud.aiplatform.v1.IndexDatapoint datapoint_; + /** + * + * + *
+     * Required. The datapoint/vector whose nearest neighbors should be searched
+     * for.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the datapoint field is set. + */ + @java.lang.Override + public boolean hasDatapoint() { + return datapoint_ != null; + } + /** + * + * + *
+     * Required. The datapoint/vector whose nearest neighbors should be searched
+     * for.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The datapoint. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.IndexDatapoint getDatapoint() { + return datapoint_ == null + ? com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance() + : datapoint_; + } + /** + * + * + *
+     * Required. The datapoint/vector whose nearest neighbors should be searched
+     * for.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder getDatapointOrBuilder() { + return datapoint_ == null + ? com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance() + : datapoint_; + } + + public static final int NEIGHBOR_COUNT_FIELD_NUMBER = 2; + private int neighborCount_ = 0; + /** + * + * + *
+     * The number of nearest neighbors to be retrieved from database for each
+     * query. If not set, will use the default from the service configuration
+     * (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config).
+     * 
+ * + * int32 neighbor_count = 2; + * + * @return The neighborCount. + */ + @java.lang.Override + public int getNeighborCount() { + return neighborCount_; + } + + public static final int PER_CROWDING_ATTRIBUTE_NEIGHBOR_COUNT_FIELD_NUMBER = 3; + private int perCrowdingAttributeNeighborCount_ = 0; + /** + * + * + *
+     * Crowding is a constraint on a neighbor list produced by nearest neighbor
+     * search requiring that no more than some value k' of the k neighbors
+     * returned have the same value of crowding_attribute.
+     * It's used for improving result diversity.
+     * This field is the maximum number of matches with the same crowding tag.
+     * 
+ * + * int32 per_crowding_attribute_neighbor_count = 3; + * + * @return The perCrowdingAttributeNeighborCount. + */ + @java.lang.Override + public int getPerCrowdingAttributeNeighborCount() { + return perCrowdingAttributeNeighborCount_; + } + + public static final int APPROXIMATE_NEIGHBOR_COUNT_FIELD_NUMBER = 4; + private int approximateNeighborCount_ = 0; + /** + * + * + *
+     * The number of neighbors to find via approximate search before
+     * exact reordering is performed. If not set, the default value from scam
+     * config is used; if set, this value must be > 0.
+     * 
+ * + * int32 approximate_neighbor_count = 4; + * + * @return The approximateNeighborCount. + */ + @java.lang.Override + public int getApproximateNeighborCount() { + return approximateNeighborCount_; + } + + public static final int FRACTION_LEAF_NODES_TO_SEARCH_OVERRIDE_FIELD_NUMBER = 5; + private double fractionLeafNodesToSearchOverride_ = 0D; + /** + * + * + *
+     * The fraction of the number of leaves to search, set at query time allows
+     * user to tune search performance. This value increase result in both
+     * search accuracy and latency increase. The value should be between 0.0
+     * and 1.0. If not set or set to 0.0, query uses the default value specified
+     * in
+     * NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search.
+     * 
+ * + * double fraction_leaf_nodes_to_search_override = 5; + * + * @return The fractionLeafNodesToSearchOverride. + */ + @java.lang.Override + public double getFractionLeafNodesToSearchOverride() { + return fractionLeafNodesToSearchOverride_; + } + + 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 (datapoint_ != null) { + output.writeMessage(1, getDatapoint()); + } + if (neighborCount_ != 0) { + output.writeInt32(2, neighborCount_); + } + if (perCrowdingAttributeNeighborCount_ != 0) { + output.writeInt32(3, perCrowdingAttributeNeighborCount_); + } + if (approximateNeighborCount_ != 0) { + output.writeInt32(4, approximateNeighborCount_); + } + if (java.lang.Double.doubleToRawLongBits(fractionLeafNodesToSearchOverride_) != 0) { + output.writeDouble(5, fractionLeafNodesToSearchOverride_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (datapoint_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDatapoint()); + } + if (neighborCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, neighborCount_); + } + if (perCrowdingAttributeNeighborCount_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 3, perCrowdingAttributeNeighborCount_); + } + if (approximateNeighborCount_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(4, approximateNeighborCount_); + } + if (java.lang.Double.doubleToRawLongBits(fractionLeafNodesToSearchOverride_) != 0) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 5, fractionLeafNodesToSearchOverride_); + } + 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.aiplatform.v1.FindNeighborsRequest.Query)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query other = + (com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query) obj; + + if (hasDatapoint() != other.hasDatapoint()) return false; + if (hasDatapoint()) { + if (!getDatapoint().equals(other.getDatapoint())) return false; + } + if (getNeighborCount() != other.getNeighborCount()) return false; + if (getPerCrowdingAttributeNeighborCount() != other.getPerCrowdingAttributeNeighborCount()) + return false; + if (getApproximateNeighborCount() != other.getApproximateNeighborCount()) return false; + if (java.lang.Double.doubleToLongBits(getFractionLeafNodesToSearchOverride()) + != java.lang.Double.doubleToLongBits(other.getFractionLeafNodesToSearchOverride())) + 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 (hasDatapoint()) { + hash = (37 * hash) + DATAPOINT_FIELD_NUMBER; + hash = (53 * hash) + getDatapoint().hashCode(); + } + hash = (37 * hash) + NEIGHBOR_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNeighborCount(); + hash = (37 * hash) + PER_CROWDING_ATTRIBUTE_NEIGHBOR_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPerCrowdingAttributeNeighborCount(); + hash = (37 * hash) + APPROXIMATE_NEIGHBOR_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getApproximateNeighborCount(); + hash = (37 * hash) + FRACTION_LEAF_NODES_TO_SEARCH_OVERRIDE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFractionLeafNodesToSearchOverride())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query 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.aiplatform.v1.FindNeighborsRequest.Query parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query 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.aiplatform.v1.FindNeighborsRequest.Query parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query 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.aiplatform.v1.FindNeighborsRequest.Query parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query 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.aiplatform.v1.FindNeighborsRequest.Query parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query 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.aiplatform.v1.FindNeighborsRequest.Query 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 query to find a number of the nearest neighbors (most similar vectors)
+     * of a vector.
+     * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.FindNeighborsRequest.Query} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.FindNeighborsRequest.Query) + com.google.cloud.aiplatform.v1.FindNeighborsRequest.QueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_Query_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_Query_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.class, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + datapoint_ = null; + if (datapointBuilder_ != null) { + datapointBuilder_.dispose(); + datapointBuilder_ = null; + } + neighborCount_ = 0; + perCrowdingAttributeNeighborCount_ = 0; + approximateNeighborCount_ = 0; + fractionLeafNodesToSearchOverride_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_Query_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query build() { + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query buildPartial() { + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query result = + new com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.datapoint_ = datapointBuilder_ == null ? datapoint_ : datapointBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.neighborCount_ = neighborCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.perCrowdingAttributeNeighborCount_ = perCrowdingAttributeNeighborCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.approximateNeighborCount_ = approximateNeighborCount_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.fractionLeafNodesToSearchOverride_ = fractionLeafNodesToSearchOverride_; + } + } + + @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.aiplatform.v1.FindNeighborsRequest.Query) { + return mergeFrom((com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query other) { + if (other == com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.getDefaultInstance()) + return this; + if (other.hasDatapoint()) { + mergeDatapoint(other.getDatapoint()); + } + if (other.getNeighborCount() != 0) { + setNeighborCount(other.getNeighborCount()); + } + if (other.getPerCrowdingAttributeNeighborCount() != 0) { + setPerCrowdingAttributeNeighborCount(other.getPerCrowdingAttributeNeighborCount()); + } + if (other.getApproximateNeighborCount() != 0) { + setApproximateNeighborCount(other.getApproximateNeighborCount()); + } + if (other.getFractionLeafNodesToSearchOverride() != 0D) { + setFractionLeafNodesToSearchOverride(other.getFractionLeafNodesToSearchOverride()); + } + 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(getDatapointFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + neighborCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + perCrowdingAttributeNeighborCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + approximateNeighborCount_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 41: + { + fractionLeafNodesToSearchOverride_ = input.readDouble(); + bitField0_ |= 0x00000010; + break; + } // case 41 + 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.aiplatform.v1.IndexDatapoint datapoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.IndexDatapoint, + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder, + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder> + datapointBuilder_; + /** + * + * + *
+       * Required. The datapoint/vector whose nearest neighbors should be searched
+       * for.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the datapoint field is set. + */ + public boolean hasDatapoint() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Required. The datapoint/vector whose nearest neighbors should be searched
+       * for.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The datapoint. + */ + public com.google.cloud.aiplatform.v1.IndexDatapoint getDatapoint() { + if (datapointBuilder_ == null) { + return datapoint_ == null + ? com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance() + : datapoint_; + } else { + return datapointBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. The datapoint/vector whose nearest neighbors should be searched
+       * for.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDatapoint(com.google.cloud.aiplatform.v1.IndexDatapoint value) { + if (datapointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datapoint_ = value; + } else { + datapointBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The datapoint/vector whose nearest neighbors should be searched
+       * for.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDatapoint( + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder builderForValue) { + if (datapointBuilder_ == null) { + datapoint_ = builderForValue.build(); + } else { + datapointBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The datapoint/vector whose nearest neighbors should be searched
+       * for.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDatapoint(com.google.cloud.aiplatform.v1.IndexDatapoint value) { + if (datapointBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && datapoint_ != null + && datapoint_ != com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance()) { + getDatapointBuilder().mergeFrom(value); + } else { + datapoint_ = value; + } + } else { + datapointBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The datapoint/vector whose nearest neighbors should be searched
+       * for.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDatapoint() { + bitField0_ = (bitField0_ & ~0x00000001); + datapoint_ = null; + if (datapointBuilder_ != null) { + datapointBuilder_.dispose(); + datapointBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The datapoint/vector whose nearest neighbors should be searched
+       * for.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1.IndexDatapoint.Builder getDatapointBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDatapointFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. The datapoint/vector whose nearest neighbors should be searched
+       * for.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder getDatapointOrBuilder() { + if (datapointBuilder_ != null) { + return datapointBuilder_.getMessageOrBuilder(); + } else { + return datapoint_ == null + ? com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance() + : datapoint_; + } + } + /** + * + * + *
+       * Required. The datapoint/vector whose nearest neighbors should be searched
+       * for.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.IndexDatapoint, + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder, + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder> + getDatapointFieldBuilder() { + if (datapointBuilder_ == null) { + datapointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.IndexDatapoint, + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder, + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder>( + getDatapoint(), getParentForChildren(), isClean()); + datapoint_ = null; + } + return datapointBuilder_; + } + + private int neighborCount_; + /** + * + * + *
+       * The number of nearest neighbors to be retrieved from database for each
+       * query. If not set, will use the default from the service configuration
+       * (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config).
+       * 
+ * + * int32 neighbor_count = 2; + * + * @return The neighborCount. + */ + @java.lang.Override + public int getNeighborCount() { + return neighborCount_; + } + /** + * + * + *
+       * The number of nearest neighbors to be retrieved from database for each
+       * query. If not set, will use the default from the service configuration
+       * (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config).
+       * 
+ * + * int32 neighbor_count = 2; + * + * @param value The neighborCount to set. + * @return This builder for chaining. + */ + public Builder setNeighborCount(int value) { + + neighborCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of nearest neighbors to be retrieved from database for each
+       * query. If not set, will use the default from the service configuration
+       * (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config).
+       * 
+ * + * int32 neighbor_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearNeighborCount() { + bitField0_ = (bitField0_ & ~0x00000002); + neighborCount_ = 0; + onChanged(); + return this; + } + + private int perCrowdingAttributeNeighborCount_; + /** + * + * + *
+       * Crowding is a constraint on a neighbor list produced by nearest neighbor
+       * search requiring that no more than some value k' of the k neighbors
+       * returned have the same value of crowding_attribute.
+       * It's used for improving result diversity.
+       * This field is the maximum number of matches with the same crowding tag.
+       * 
+ * + * int32 per_crowding_attribute_neighbor_count = 3; + * + * @return The perCrowdingAttributeNeighborCount. + */ + @java.lang.Override + public int getPerCrowdingAttributeNeighborCount() { + return perCrowdingAttributeNeighborCount_; + } + /** + * + * + *
+       * Crowding is a constraint on a neighbor list produced by nearest neighbor
+       * search requiring that no more than some value k' of the k neighbors
+       * returned have the same value of crowding_attribute.
+       * It's used for improving result diversity.
+       * This field is the maximum number of matches with the same crowding tag.
+       * 
+ * + * int32 per_crowding_attribute_neighbor_count = 3; + * + * @param value The perCrowdingAttributeNeighborCount to set. + * @return This builder for chaining. + */ + public Builder setPerCrowdingAttributeNeighborCount(int value) { + + perCrowdingAttributeNeighborCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Crowding is a constraint on a neighbor list produced by nearest neighbor
+       * search requiring that no more than some value k' of the k neighbors
+       * returned have the same value of crowding_attribute.
+       * It's used for improving result diversity.
+       * This field is the maximum number of matches with the same crowding tag.
+       * 
+ * + * int32 per_crowding_attribute_neighbor_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearPerCrowdingAttributeNeighborCount() { + bitField0_ = (bitField0_ & ~0x00000004); + perCrowdingAttributeNeighborCount_ = 0; + onChanged(); + return this; + } + + private int approximateNeighborCount_; + /** + * + * + *
+       * The number of neighbors to find via approximate search before
+       * exact reordering is performed. If not set, the default value from scam
+       * config is used; if set, this value must be > 0.
+       * 
+ * + * int32 approximate_neighbor_count = 4; + * + * @return The approximateNeighborCount. + */ + @java.lang.Override + public int getApproximateNeighborCount() { + return approximateNeighborCount_; + } + /** + * + * + *
+       * The number of neighbors to find via approximate search before
+       * exact reordering is performed. If not set, the default value from scam
+       * config is used; if set, this value must be > 0.
+       * 
+ * + * int32 approximate_neighbor_count = 4; + * + * @param value The approximateNeighborCount to set. + * @return This builder for chaining. + */ + public Builder setApproximateNeighborCount(int value) { + + approximateNeighborCount_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The number of neighbors to find via approximate search before
+       * exact reordering is performed. If not set, the default value from scam
+       * config is used; if set, this value must be > 0.
+       * 
+ * + * int32 approximate_neighbor_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearApproximateNeighborCount() { + bitField0_ = (bitField0_ & ~0x00000008); + approximateNeighborCount_ = 0; + onChanged(); + return this; + } + + private double fractionLeafNodesToSearchOverride_; + /** + * + * + *
+       * The fraction of the number of leaves to search, set at query time allows
+       * user to tune search performance. This value increase result in both
+       * search accuracy and latency increase. The value should be between 0.0
+       * and 1.0. If not set or set to 0.0, query uses the default value specified
+       * in
+       * NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search.
+       * 
+ * + * double fraction_leaf_nodes_to_search_override = 5; + * + * @return The fractionLeafNodesToSearchOverride. + */ + @java.lang.Override + public double getFractionLeafNodesToSearchOverride() { + return fractionLeafNodesToSearchOverride_; + } + /** + * + * + *
+       * The fraction of the number of leaves to search, set at query time allows
+       * user to tune search performance. This value increase result in both
+       * search accuracy and latency increase. The value should be between 0.0
+       * and 1.0. If not set or set to 0.0, query uses the default value specified
+       * in
+       * NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search.
+       * 
+ * + * double fraction_leaf_nodes_to_search_override = 5; + * + * @param value The fractionLeafNodesToSearchOverride to set. + * @return This builder for chaining. + */ + public Builder setFractionLeafNodesToSearchOverride(double value) { + + fractionLeafNodesToSearchOverride_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The fraction of the number of leaves to search, set at query time allows
+       * user to tune search performance. This value increase result in both
+       * search accuracy and latency increase. The value should be between 0.0
+       * and 1.0. If not set or set to 0.0, query uses the default value specified
+       * in
+       * NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search.
+       * 
+ * + * double fraction_leaf_nodes_to_search_override = 5; + * + * @return This builder for chaining. + */ + public Builder clearFractionLeafNodesToSearchOverride() { + bitField0_ = (bitField0_ & ~0x00000010); + fractionLeafNodesToSearchOverride_ = 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.aiplatform.v1.FindNeighborsRequest.Query) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.FindNeighborsRequest.Query) + private static final com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query(); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Query 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.aiplatform.v1.FindNeighborsRequest.Query getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int INDEX_ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object indexEndpoint_ = ""; + /** + * + * + *
+   * Required. The name of the index endpoint.
+   * Format:
+   * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+   * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The indexEndpoint. + */ + @java.lang.Override + public java.lang.String getIndexEndpoint() { + java.lang.Object ref = indexEndpoint_; + 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(); + indexEndpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the index endpoint.
+   * Format:
+   * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+   * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for indexEndpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIndexEndpointBytes() { + java.lang.Object ref = indexEndpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPLOYED_INDEX_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object deployedIndexId_ = ""; + /** + * + * + *
+   * The ID of the DeployedIndex that will serve the request. This request is
+   * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That
+   * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index
+   * has a DeployedIndex.id field.
+   * The value of the field below must equal one of the DeployedIndex.id
+   * fields of the IndexEndpoint that is being called for this request.
+   * 
+ * + * string deployed_index_id = 2; + * + * @return The deployedIndexId. + */ + @java.lang.Override + public java.lang.String getDeployedIndexId() { + java.lang.Object ref = deployedIndexId_; + 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(); + deployedIndexId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the DeployedIndex that will serve the request. This request is
+   * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That
+   * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index
+   * has a DeployedIndex.id field.
+   * The value of the field below must equal one of the DeployedIndex.id
+   * fields of the IndexEndpoint that is being called for this request.
+   * 
+ * + * string deployed_index_id = 2; + * + * @return The bytes for deployedIndexId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeployedIndexIdBytes() { + java.lang.Object ref = deployedIndexId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedIndexId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERIES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List queries_; + /** + * + * + *
+   * The list of queries.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + @java.lang.Override + public java.util.List + getQueriesList() { + return queries_; + } + /** + * + * + *
+   * The list of queries.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.aiplatform.v1.FindNeighborsRequest.QueryOrBuilder> + getQueriesOrBuilderList() { + return queries_; + } + /** + * + * + *
+   * The list of queries.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + @java.lang.Override + public int getQueriesCount() { + return queries_.size(); + } + /** + * + * + *
+   * The list of queries.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query getQueries(int index) { + return queries_.get(index); + } + /** + * + * + *
+   * The list of queries.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsRequest.QueryOrBuilder getQueriesOrBuilder( + int index) { + return queries_.get(index); + } + + public static final int RETURN_FULL_DATAPOINT_FIELD_NUMBER = 4; + private boolean returnFullDatapoint_ = false; + /** + * + * + *
+   * If set to true, the full datapoints (including all vector values and
+   * restricts) of the nearest neighbors are returned.
+   * Note that returning full datapoint will significantly increase the
+   * latency and cost of the query.
+   * 
+ * + * bool return_full_datapoint = 4; + * + * @return The returnFullDatapoint. + */ + @java.lang.Override + public boolean getReturnFullDatapoint() { + return returnFullDatapoint_; + } + + 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(indexEndpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, indexEndpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedIndexId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deployedIndexId_); + } + for (int i = 0; i < queries_.size(); i++) { + output.writeMessage(3, queries_.get(i)); + } + if (returnFullDatapoint_ != false) { + output.writeBool(4, returnFullDatapoint_); + } + 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(indexEndpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, indexEndpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedIndexId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deployedIndexId_); + } + for (int i = 0; i < queries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, queries_.get(i)); + } + if (returnFullDatapoint_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, returnFullDatapoint_); + } + 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.aiplatform.v1.FindNeighborsRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.FindNeighborsRequest other = + (com.google.cloud.aiplatform.v1.FindNeighborsRequest) obj; + + if (!getIndexEndpoint().equals(other.getIndexEndpoint())) return false; + if (!getDeployedIndexId().equals(other.getDeployedIndexId())) return false; + if (!getQueriesList().equals(other.getQueriesList())) return false; + if (getReturnFullDatapoint() != other.getReturnFullDatapoint()) 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_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getIndexEndpoint().hashCode(); + hash = (37 * hash) + DEPLOYED_INDEX_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeployedIndexId().hashCode(); + if (getQueriesCount() > 0) { + hash = (37 * hash) + QUERIES_FIELD_NUMBER; + hash = (53 * hash) + getQueriesList().hashCode(); + } + hash = (37 * hash) + RETURN_FULL_DATAPOINT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReturnFullDatapoint()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest 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.aiplatform.v1.FindNeighborsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest 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.aiplatform.v1.FindNeighborsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest 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.aiplatform.v1.FindNeighborsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest 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.aiplatform.v1.FindNeighborsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest 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.aiplatform.v1.FindNeighborsRequest 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 request message for
+   * [MatchService.FindNeighbors][google.cloud.aiplatform.v1.MatchService.FindNeighbors].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.FindNeighborsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.FindNeighborsRequest) + com.google.cloud.aiplatform.v1.FindNeighborsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.FindNeighborsRequest.class, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.FindNeighborsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + indexEndpoint_ = ""; + deployedIndexId_ = ""; + if (queriesBuilder_ == null) { + queries_ = java.util.Collections.emptyList(); + } else { + queries_ = null; + queriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + returnFullDatapoint_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsRequest getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.FindNeighborsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsRequest build() { + com.google.cloud.aiplatform.v1.FindNeighborsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsRequest buildPartial() { + com.google.cloud.aiplatform.v1.FindNeighborsRequest result = + new com.google.cloud.aiplatform.v1.FindNeighborsRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.aiplatform.v1.FindNeighborsRequest result) { + if (queriesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + queries_ = java.util.Collections.unmodifiableList(queries_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.queries_ = queries_; + } else { + result.queries_ = queriesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.FindNeighborsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.indexEndpoint_ = indexEndpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deployedIndexId_ = deployedIndexId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.returnFullDatapoint_ = returnFullDatapoint_; + } + } + + @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.aiplatform.v1.FindNeighborsRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1.FindNeighborsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.FindNeighborsRequest other) { + if (other == com.google.cloud.aiplatform.v1.FindNeighborsRequest.getDefaultInstance()) + return this; + if (!other.getIndexEndpoint().isEmpty()) { + indexEndpoint_ = other.indexEndpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDeployedIndexId().isEmpty()) { + deployedIndexId_ = other.deployedIndexId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (queriesBuilder_ == null) { + if (!other.queries_.isEmpty()) { + if (queries_.isEmpty()) { + queries_ = other.queries_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureQueriesIsMutable(); + queries_.addAll(other.queries_); + } + onChanged(); + } + } else { + if (!other.queries_.isEmpty()) { + if (queriesBuilder_.isEmpty()) { + queriesBuilder_.dispose(); + queriesBuilder_ = null; + queries_ = other.queries_; + bitField0_ = (bitField0_ & ~0x00000004); + queriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQueriesFieldBuilder() + : null; + } else { + queriesBuilder_.addAllMessages(other.queries_); + } + } + } + if (other.getReturnFullDatapoint() != false) { + setReturnFullDatapoint(other.getReturnFullDatapoint()); + } + 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: + { + indexEndpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + deployedIndexId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query m = + input.readMessage( + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.parser(), + extensionRegistry); + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + queries_.add(m); + } else { + queriesBuilder_.addMessage(m); + } + break; + } // case 26 + case 32: + { + returnFullDatapoint_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + 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 indexEndpoint_ = ""; + /** + * + * + *
+     * Required. The name of the index endpoint.
+     * Format:
+     * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+     * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The indexEndpoint. + */ + public java.lang.String getIndexEndpoint() { + java.lang.Object ref = indexEndpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + indexEndpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the index endpoint.
+     * Format:
+     * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+     * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for indexEndpoint. + */ + public com.google.protobuf.ByteString getIndexEndpointBytes() { + java.lang.Object ref = indexEndpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the index endpoint.
+     * Format:
+     * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+     * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The indexEndpoint to set. + * @return This builder for chaining. + */ + public Builder setIndexEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + indexEndpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the index endpoint.
+     * Format:
+     * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+     * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearIndexEndpoint() { + indexEndpoint_ = getDefaultInstance().getIndexEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the index endpoint.
+     * Format:
+     * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+     * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for indexEndpoint to set. + * @return This builder for chaining. + */ + public Builder setIndexEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + indexEndpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object deployedIndexId_ = ""; + /** + * + * + *
+     * The ID of the DeployedIndex that will serve the request. This request is
+     * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That
+     * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index
+     * has a DeployedIndex.id field.
+     * The value of the field below must equal one of the DeployedIndex.id
+     * fields of the IndexEndpoint that is being called for this request.
+     * 
+ * + * string deployed_index_id = 2; + * + * @return The deployedIndexId. + */ + public java.lang.String getDeployedIndexId() { + java.lang.Object ref = deployedIndexId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedIndexId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the DeployedIndex that will serve the request. This request is
+     * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That
+     * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index
+     * has a DeployedIndex.id field.
+     * The value of the field below must equal one of the DeployedIndex.id
+     * fields of the IndexEndpoint that is being called for this request.
+     * 
+ * + * string deployed_index_id = 2; + * + * @return The bytes for deployedIndexId. + */ + public com.google.protobuf.ByteString getDeployedIndexIdBytes() { + java.lang.Object ref = deployedIndexId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedIndexId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the DeployedIndex that will serve the request. This request is
+     * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That
+     * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index
+     * has a DeployedIndex.id field.
+     * The value of the field below must equal one of the DeployedIndex.id
+     * fields of the IndexEndpoint that is being called for this request.
+     * 
+ * + * string deployed_index_id = 2; + * + * @param value The deployedIndexId to set. + * @return This builder for chaining. + */ + public Builder setDeployedIndexId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + deployedIndexId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the DeployedIndex that will serve the request. This request is
+     * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That
+     * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index
+     * has a DeployedIndex.id field.
+     * The value of the field below must equal one of the DeployedIndex.id
+     * fields of the IndexEndpoint that is being called for this request.
+     * 
+ * + * string deployed_index_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearDeployedIndexId() { + deployedIndexId_ = getDefaultInstance().getDeployedIndexId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the DeployedIndex that will serve the request. This request is
+     * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That
+     * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index
+     * has a DeployedIndex.id field.
+     * The value of the field below must equal one of the DeployedIndex.id
+     * fields of the IndexEndpoint that is being called for this request.
+     * 
+ * + * string deployed_index_id = 2; + * + * @param value The bytes for deployedIndexId to set. + * @return This builder for chaining. + */ + public Builder setDeployedIndexIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + deployedIndexId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List queries_ = + java.util.Collections.emptyList(); + + private void ensureQueriesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + queries_ = + new java.util.ArrayList( + queries_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.QueryOrBuilder> + queriesBuilder_; + + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public java.util.List + getQueriesList() { + if (queriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(queries_); + } else { + return queriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public int getQueriesCount() { + if (queriesBuilder_ == null) { + return queries_.size(); + } else { + return queriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query getQueries(int index) { + if (queriesBuilder_ == null) { + return queries_.get(index); + } else { + return queriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public Builder setQueries( + int index, com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query value) { + if (queriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueriesIsMutable(); + queries_.set(index, value); + onChanged(); + } else { + queriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public Builder setQueries( + int index, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder builderForValue) { + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + queries_.set(index, builderForValue.build()); + onChanged(); + } else { + queriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public Builder addQueries(com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query value) { + if (queriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueriesIsMutable(); + queries_.add(value); + onChanged(); + } else { + queriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public Builder addQueries( + int index, com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query value) { + if (queriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueriesIsMutable(); + queries_.add(index, value); + onChanged(); + } else { + queriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public Builder addQueries( + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder builderForValue) { + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + queries_.add(builderForValue.build()); + onChanged(); + } else { + queriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public Builder addQueries( + int index, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder builderForValue) { + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + queries_.add(index, builderForValue.build()); + onChanged(); + } else { + queriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public Builder addAllQueries( + java.lang.Iterable + values) { + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queries_); + onChanged(); + } else { + queriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public Builder clearQueries() { + if (queriesBuilder_ == null) { + queries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + queriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public Builder removeQueries(int index) { + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + queries_.remove(index); + onChanged(); + } else { + queriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder getQueriesBuilder( + int index) { + return getQueriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public com.google.cloud.aiplatform.v1.FindNeighborsRequest.QueryOrBuilder getQueriesOrBuilder( + int index) { + if (queriesBuilder_ == null) { + return queries_.get(index); + } else { + return queriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public java.util.List< + ? extends com.google.cloud.aiplatform.v1.FindNeighborsRequest.QueryOrBuilder> + getQueriesOrBuilderList() { + if (queriesBuilder_ != null) { + return queriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(queries_); + } + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder addQueriesBuilder() { + return getQueriesFieldBuilder() + .addBuilder( + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.getDefaultInstance()); + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder addQueriesBuilder( + int index) { + return getQueriesFieldBuilder() + .addBuilder( + index, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.getDefaultInstance()); + } + /** + * + * + *
+     * The list of queries.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + public java.util.List + getQueriesBuilderList() { + return getQueriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.QueryOrBuilder> + getQueriesFieldBuilder() { + if (queriesBuilder_ == null) { + queriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.Builder, + com.google.cloud.aiplatform.v1.FindNeighborsRequest.QueryOrBuilder>( + queries_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + queries_ = null; + } + return queriesBuilder_; + } + + private boolean returnFullDatapoint_; + /** + * + * + *
+     * If set to true, the full datapoints (including all vector values and
+     * restricts) of the nearest neighbors are returned.
+     * Note that returning full datapoint will significantly increase the
+     * latency and cost of the query.
+     * 
+ * + * bool return_full_datapoint = 4; + * + * @return The returnFullDatapoint. + */ + @java.lang.Override + public boolean getReturnFullDatapoint() { + return returnFullDatapoint_; + } + /** + * + * + *
+     * If set to true, the full datapoints (including all vector values and
+     * restricts) of the nearest neighbors are returned.
+     * Note that returning full datapoint will significantly increase the
+     * latency and cost of the query.
+     * 
+ * + * bool return_full_datapoint = 4; + * + * @param value The returnFullDatapoint to set. + * @return This builder for chaining. + */ + public Builder setReturnFullDatapoint(boolean value) { + + returnFullDatapoint_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, the full datapoints (including all vector values and
+     * restricts) of the nearest neighbors are returned.
+     * Note that returning full datapoint will significantly increase the
+     * latency and cost of the query.
+     * 
+ * + * bool return_full_datapoint = 4; + * + * @return This builder for chaining. + */ + public Builder clearReturnFullDatapoint() { + bitField0_ = (bitField0_ & ~0x00000008); + returnFullDatapoint_ = 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.aiplatform.v1.FindNeighborsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.FindNeighborsRequest) + private static final com.google.cloud.aiplatform.v1.FindNeighborsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.FindNeighborsRequest(); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FindNeighborsRequest 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.aiplatform.v1.FindNeighborsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsRequestOrBuilder.java new file mode 100644 index 000000000000..033057bb5130 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsRequestOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/match_service.proto + +package com.google.cloud.aiplatform.v1; + +public interface FindNeighborsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.FindNeighborsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the index endpoint.
+   * Format:
+   * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+   * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The indexEndpoint. + */ + java.lang.String getIndexEndpoint(); + /** + * + * + *
+   * Required. The name of the index endpoint.
+   * Format:
+   * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+   * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for indexEndpoint. + */ + com.google.protobuf.ByteString getIndexEndpointBytes(); + + /** + * + * + *
+   * The ID of the DeployedIndex that will serve the request. This request is
+   * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That
+   * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index
+   * has a DeployedIndex.id field.
+   * The value of the field below must equal one of the DeployedIndex.id
+   * fields of the IndexEndpoint that is being called for this request.
+   * 
+ * + * string deployed_index_id = 2; + * + * @return The deployedIndexId. + */ + java.lang.String getDeployedIndexId(); + /** + * + * + *
+   * The ID of the DeployedIndex that will serve the request. This request is
+   * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That
+   * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index
+   * has a DeployedIndex.id field.
+   * The value of the field below must equal one of the DeployedIndex.id
+   * fields of the IndexEndpoint that is being called for this request.
+   * 
+ * + * string deployed_index_id = 2; + * + * @return The bytes for deployedIndexId. + */ + com.google.protobuf.ByteString getDeployedIndexIdBytes(); + + /** + * + * + *
+   * The list of queries.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + java.util.List getQueriesList(); + /** + * + * + *
+   * The list of queries.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + com.google.cloud.aiplatform.v1.FindNeighborsRequest.Query getQueries(int index); + /** + * + * + *
+   * The list of queries.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + int getQueriesCount(); + /** + * + * + *
+   * The list of queries.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + java.util.List + getQueriesOrBuilderList(); + /** + * + * + *
+   * The list of queries.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsRequest.Query queries = 3; + */ + com.google.cloud.aiplatform.v1.FindNeighborsRequest.QueryOrBuilder getQueriesOrBuilder(int index); + + /** + * + * + *
+   * If set to true, the full datapoints (including all vector values and
+   * restricts) of the nearest neighbors are returned.
+   * Note that returning full datapoint will significantly increase the
+   * latency and cost of the query.
+   * 
+ * + * bool return_full_datapoint = 4; + * + * @return The returnFullDatapoint. + */ + boolean getReturnFullDatapoint(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsResponse.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsResponse.java new file mode 100644 index 000000000000..bf51e5af71ea --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsResponse.java @@ -0,0 +1,3188 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/match_service.proto + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * The response message for
+ * [MatchService.FindNeighbors][google.cloud.aiplatform.v1.MatchService.FindNeighbors].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.FindNeighborsResponse} + */ +public final class FindNeighborsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.FindNeighborsResponse) + FindNeighborsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use FindNeighborsResponse.newBuilder() to construct. + private FindNeighborsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FindNeighborsResponse() { + nearestNeighbors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FindNeighborsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.class, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Builder.class); + } + + public interface NeighborOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The datapoint of the neighbor.
+     * Note that full datapoints are returned only when "return_full_datapoint"
+     * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+     * fields are populated.
+     * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + * + * @return Whether the datapoint field is set. + */ + boolean hasDatapoint(); + /** + * + * + *
+     * The datapoint of the neighbor.
+     * Note that full datapoints are returned only when "return_full_datapoint"
+     * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+     * fields are populated.
+     * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + * + * @return The datapoint. + */ + com.google.cloud.aiplatform.v1.IndexDatapoint getDatapoint(); + /** + * + * + *
+     * The datapoint of the neighbor.
+     * Note that full datapoints are returned only when "return_full_datapoint"
+     * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+     * fields are populated.
+     * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + */ + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder getDatapointOrBuilder(); + + /** + * + * + *
+     * The distance between the neighbor and the query vector.
+     * 
+ * + * double distance = 2; + * + * @return The distance. + */ + double getDistance(); + } + /** + * + * + *
+   * A neighbor of the query vector.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor} + */ + public static final class Neighbor extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.FindNeighborsResponse.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() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Neighbor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_Neighbor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_Neighbor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.class, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder.class); + } + + public static final int DATAPOINT_FIELD_NUMBER = 1; + private com.google.cloud.aiplatform.v1.IndexDatapoint datapoint_; + /** + * + * + *
+     * The datapoint of the neighbor.
+     * Note that full datapoints are returned only when "return_full_datapoint"
+     * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+     * fields are populated.
+     * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + * + * @return Whether the datapoint field is set. + */ + @java.lang.Override + public boolean hasDatapoint() { + return datapoint_ != null; + } + /** + * + * + *
+     * The datapoint of the neighbor.
+     * Note that full datapoints are returned only when "return_full_datapoint"
+     * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+     * fields are populated.
+     * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + * + * @return The datapoint. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.IndexDatapoint getDatapoint() { + return datapoint_ == null + ? com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance() + : datapoint_; + } + /** + * + * + *
+     * The datapoint of the neighbor.
+     * Note that full datapoints are returned only when "return_full_datapoint"
+     * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+     * fields are populated.
+     * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder getDatapointOrBuilder() { + return datapoint_ == null + ? com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance() + : datapoint_; + } + + public static final int DISTANCE_FIELD_NUMBER = 2; + private double distance_ = 0D; + /** + * + * + *
+     * The distance between the neighbor and the query vector.
+     * 
+ * + * double distance = 2; + * + * @return The distance. + */ + @java.lang.Override + public double getDistance() { + return distance_; + } + + 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 (datapoint_ != null) { + output.writeMessage(1, getDatapoint()); + } + if (java.lang.Double.doubleToRawLongBits(distance_) != 0) { + output.writeDouble(2, distance_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (datapoint_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDatapoint()); + } + if (java.lang.Double.doubleToRawLongBits(distance_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, distance_); + } + 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.aiplatform.v1.FindNeighborsResponse.Neighbor)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor other = + (com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor) obj; + + if (hasDatapoint() != other.hasDatapoint()) return false; + if (hasDatapoint()) { + if (!getDatapoint().equals(other.getDatapoint())) return false; + } + if (java.lang.Double.doubleToLongBits(getDistance()) + != java.lang.Double.doubleToLongBits(other.getDistance())) 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 (hasDatapoint()) { + hash = (37 * hash) + DATAPOINT_FIELD_NUMBER; + hash = (53 * hash) + getDatapoint().hashCode(); + } + hash = (37 * hash) + DISTANCE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getDistance())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.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.aiplatform.v1.FindNeighborsResponse.Neighbor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.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.aiplatform.v1.FindNeighborsResponse.Neighbor parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.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.aiplatform.v1.FindNeighborsResponse.Neighbor parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.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.aiplatform.v1.FindNeighborsResponse.Neighbor parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.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.aiplatform.v1.FindNeighborsResponse.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; + } + /** + * + * + *
+     * A neighbor of the query vector.
+     * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor) + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NeighborOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_Neighbor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_Neighbor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.class, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + datapoint_ = null; + if (datapointBuilder_ != null) { + datapointBuilder_.dispose(); + datapointBuilder_ = null; + } + distance_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_Neighbor_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor build() { + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor buildPartial() { + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor result = + new com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.datapoint_ = datapointBuilder_ == null ? datapoint_ : datapointBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.distance_ = distance_; + } + } + + @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.aiplatform.v1.FindNeighborsResponse.Neighbor) { + return mergeFrom((com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor other) { + if (other + == com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.getDefaultInstance()) + return this; + if (other.hasDatapoint()) { + mergeDatapoint(other.getDatapoint()); + } + if (other.getDistance() != 0D) { + setDistance(other.getDistance()); + } + 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(getDatapointFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 17: + { + distance_ = 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 com.google.cloud.aiplatform.v1.IndexDatapoint datapoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.IndexDatapoint, + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder, + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder> + datapointBuilder_; + /** + * + * + *
+       * The datapoint of the neighbor.
+       * Note that full datapoints are returned only when "return_full_datapoint"
+       * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+       * fields are populated.
+       * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + * + * @return Whether the datapoint field is set. + */ + public boolean hasDatapoint() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The datapoint of the neighbor.
+       * Note that full datapoints are returned only when "return_full_datapoint"
+       * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+       * fields are populated.
+       * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + * + * @return The datapoint. + */ + public com.google.cloud.aiplatform.v1.IndexDatapoint getDatapoint() { + if (datapointBuilder_ == null) { + return datapoint_ == null + ? com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance() + : datapoint_; + } else { + return datapointBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The datapoint of the neighbor.
+       * Note that full datapoints are returned only when "return_full_datapoint"
+       * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+       * fields are populated.
+       * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + */ + public Builder setDatapoint(com.google.cloud.aiplatform.v1.IndexDatapoint value) { + if (datapointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + datapoint_ = value; + } else { + datapointBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The datapoint of the neighbor.
+       * Note that full datapoints are returned only when "return_full_datapoint"
+       * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+       * fields are populated.
+       * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + */ + public Builder setDatapoint( + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder builderForValue) { + if (datapointBuilder_ == null) { + datapoint_ = builderForValue.build(); + } else { + datapointBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The datapoint of the neighbor.
+       * Note that full datapoints are returned only when "return_full_datapoint"
+       * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+       * fields are populated.
+       * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + */ + public Builder mergeDatapoint(com.google.cloud.aiplatform.v1.IndexDatapoint value) { + if (datapointBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && datapoint_ != null + && datapoint_ != com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance()) { + getDatapointBuilder().mergeFrom(value); + } else { + datapoint_ = value; + } + } else { + datapointBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The datapoint of the neighbor.
+       * Note that full datapoints are returned only when "return_full_datapoint"
+       * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+       * fields are populated.
+       * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + */ + public Builder clearDatapoint() { + bitField0_ = (bitField0_ & ~0x00000001); + datapoint_ = null; + if (datapointBuilder_ != null) { + datapointBuilder_.dispose(); + datapointBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The datapoint of the neighbor.
+       * Note that full datapoints are returned only when "return_full_datapoint"
+       * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+       * fields are populated.
+       * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + */ + public com.google.cloud.aiplatform.v1.IndexDatapoint.Builder getDatapointBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDatapointFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The datapoint of the neighbor.
+       * Note that full datapoints are returned only when "return_full_datapoint"
+       * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+       * fields are populated.
+       * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + */ + public com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder getDatapointOrBuilder() { + if (datapointBuilder_ != null) { + return datapointBuilder_.getMessageOrBuilder(); + } else { + return datapoint_ == null + ? com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance() + : datapoint_; + } + } + /** + * + * + *
+       * The datapoint of the neighbor.
+       * Note that full datapoints are returned only when "return_full_datapoint"
+       * is set to true. Otherwise, only the "datapoint_id" and "crowding_tag"
+       * fields are populated.
+       * 
+ * + * .google.cloud.aiplatform.v1.IndexDatapoint datapoint = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.IndexDatapoint, + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder, + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder> + getDatapointFieldBuilder() { + if (datapointBuilder_ == null) { + datapointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1.IndexDatapoint, + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder, + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder>( + getDatapoint(), getParentForChildren(), isClean()); + datapoint_ = null; + } + return datapointBuilder_; + } + + private double distance_; + /** + * + * + *
+       * The distance between the neighbor and the query vector.
+       * 
+ * + * double distance = 2; + * + * @return The distance. + */ + @java.lang.Override + public double getDistance() { + return distance_; + } + /** + * + * + *
+       * The distance between the neighbor and the query vector.
+       * 
+ * + * double distance = 2; + * + * @param value The distance to set. + * @return This builder for chaining. + */ + public Builder setDistance(double value) { + + distance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The distance between the neighbor and the query vector.
+       * 
+ * + * double distance = 2; + * + * @return This builder for chaining. + */ + public Builder clearDistance() { + bitField0_ = (bitField0_ & ~0x00000002); + distance_ = 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.aiplatform.v1.FindNeighborsResponse.Neighbor) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor) + private static final com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor(); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.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.aiplatform.v1.FindNeighborsResponse.Neighbor + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface NearestNeighborsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The ID of the query datapoint.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * The ID of the query datapoint.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * All its neighbors.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + java.util.List + getNeighborsList(); + /** + * + * + *
+     * All its neighbors.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor getNeighbors(int index); + /** + * + * + *
+     * All its neighbors.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + int getNeighborsCount(); + /** + * + * + *
+     * All its neighbors.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + java.util.List + getNeighborsOrBuilderList(); + /** + * + * + *
+     * All its neighbors.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NeighborOrBuilder getNeighborsOrBuilder( + int index); + } + /** + * + * + *
+   * Nearest neighbors for one query.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors} + */ + public static final class NearestNeighbors extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors) + NearestNeighborsOrBuilder { + private static final long serialVersionUID = 0L; + // Use NearestNeighbors.newBuilder() to construct. + private NearestNeighbors(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NearestNeighbors() { + id_ = ""; + neighbors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NearestNeighbors(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_NearestNeighbors_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_NearestNeighbors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.class, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * The ID of the query datapoint.
+     * 
+ * + * string id = 1; + * + * @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; + } + } + /** + * + * + *
+     * The ID of the query datapoint.
+     * 
+ * + * string id = 1; + * + * @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 NEIGHBORS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + neighbors_; + /** + * + * + *
+     * All its neighbors.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + @java.lang.Override + public java.util.List + getNeighborsList() { + return neighbors_; + } + /** + * + * + *
+     * All its neighbors.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.aiplatform.v1.FindNeighborsResponse.NeighborOrBuilder> + getNeighborsOrBuilderList() { + return neighbors_; + } + /** + * + * + *
+     * All its neighbors.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + @java.lang.Override + public int getNeighborsCount() { + return neighbors_.size(); + } + /** + * + * + *
+     * All its neighbors.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor getNeighbors(int index) { + return neighbors_.get(index); + } + /** + * + * + *
+     * All its neighbors.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.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 { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + 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; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + 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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors other = + (com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors) obj; + + if (!getId().equals(other.getId())) 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(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors 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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors 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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors 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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + 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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors 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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors 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; + } + /** + * + * + *
+     * Nearest neighbors for one query.
+     * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors) + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighborsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_NearestNeighbors_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_NearestNeighbors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.class, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder + .class); + } + + // Construct using + // com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + 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.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_NearestNeighbors_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors build() { + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors buildPartial() { + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors result = + new com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors result) { + 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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + } + + @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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors) { + return mergeFrom( + (com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors other) { + if (other + == com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + 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: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor m = + input.readMessage( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.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.lang.Object id_ = ""; + /** + * + * + *
+       * The ID of the query datapoint.
+       * 
+ * + * string id = 1; + * + * @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; + } + } + /** + * + * + *
+       * The ID of the query datapoint.
+       * 
+ * + * string id = 1; + * + * @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; + } + } + /** + * + * + *
+       * The ID of the query datapoint.
+       * 
+ * + * string id = 1; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The ID of the query datapoint.
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The ID of the query datapoint.
+       * 
+ * + * string id = 1; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List + neighbors_ = java.util.Collections.emptyList(); + + private void ensureNeighborsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + neighbors_ = + new java.util.ArrayList< + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor>(neighbors_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NeighborOrBuilder> + neighborsBuilder_; + + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public java.util.List + getNeighborsList() { + if (neighborsBuilder_ == null) { + return java.util.Collections.unmodifiableList(neighbors_); + } else { + return neighborsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public int getNeighborsCount() { + if (neighborsBuilder_ == null) { + return neighbors_.size(); + } else { + return neighborsBuilder_.getCount(); + } + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor getNeighbors(int index) { + if (neighborsBuilder_ == null) { + return neighbors_.get(index); + } else { + return neighborsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public Builder setNeighbors( + int index, com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor value) { + if (neighborsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNeighborsIsMutable(); + neighbors_.set(index, value); + onChanged(); + } else { + neighborsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public Builder setNeighbors( + int index, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder builderForValue) { + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + neighbors_.set(index, builderForValue.build()); + onChanged(); + } else { + neighborsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public Builder addNeighbors( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor value) { + if (neighborsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNeighborsIsMutable(); + neighbors_.add(value); + onChanged(); + } else { + neighborsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public Builder addNeighbors( + int index, com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor value) { + if (neighborsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNeighborsIsMutable(); + neighbors_.add(index, value); + onChanged(); + } else { + neighborsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public Builder addNeighbors( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder builderForValue) { + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + neighbors_.add(builderForValue.build()); + onChanged(); + } else { + neighborsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public Builder addNeighbors( + int index, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder builderForValue) { + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + neighbors_.add(index, builderForValue.build()); + onChanged(); + } else { + neighborsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public Builder addAllNeighbors( + java.lang.Iterable< + ? extends com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor> + values) { + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, neighbors_); + onChanged(); + } else { + neighborsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public Builder clearNeighbors() { + if (neighborsBuilder_ == null) { + neighbors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + neighborsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public Builder removeNeighbors(int index) { + if (neighborsBuilder_ == null) { + ensureNeighborsIsMutable(); + neighbors_.remove(index); + onChanged(); + } else { + neighborsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder + getNeighborsBuilder(int index) { + return getNeighborsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NeighborOrBuilder + getNeighborsOrBuilder(int index) { + if (neighborsBuilder_ == null) { + return neighbors_.get(index); + } else { + return neighborsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.aiplatform.v1.FindNeighborsResponse.NeighborOrBuilder> + getNeighborsOrBuilderList() { + if (neighborsBuilder_ != null) { + return neighborsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(neighbors_); + } + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder + addNeighborsBuilder() { + return getNeighborsFieldBuilder() + .addBuilder( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.getDefaultInstance()); + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder + addNeighborsBuilder(int index) { + return getNeighborsFieldBuilder() + .addBuilder( + index, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.getDefaultInstance()); + } + /** + * + * + *
+       * All its neighbors.
+       * 
+ * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor neighbors = 2; + * + */ + public java.util.List + getNeighborsBuilderList() { + return getNeighborsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NeighborOrBuilder> + getNeighborsFieldBuilder() { + if (neighborsBuilder_ == null) { + neighborsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.Builder, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors) + private static final com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors(); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NearestNeighbors 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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NEAREST_NEIGHBORS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + nearestNeighbors_; + /** + * + * + *
+   * The nearest neighbors of the query datapoints.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + @java.lang.Override + public java.util.List + getNearestNeighborsList() { + return nearestNeighbors_; + } + /** + * + * + *
+   * The nearest neighbors of the query datapoints.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighborsOrBuilder> + getNearestNeighborsOrBuilderList() { + return nearestNeighbors_; + } + /** + * + * + *
+   * The nearest neighbors of the query datapoints.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + @java.lang.Override + public int getNearestNeighborsCount() { + return nearestNeighbors_.size(); + } + /** + * + * + *
+   * The nearest neighbors of the query datapoints.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors getNearestNeighbors( + int index) { + return nearestNeighbors_.get(index); + } + /** + * + * + *
+   * The nearest neighbors of the query datapoints.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighborsOrBuilder + getNearestNeighborsOrBuilder(int index) { + return nearestNeighbors_.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 < nearestNeighbors_.size(); i++) { + output.writeMessage(1, nearestNeighbors_.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 < nearestNeighbors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, nearestNeighbors_.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.aiplatform.v1.FindNeighborsResponse)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.FindNeighborsResponse other = + (com.google.cloud.aiplatform.v1.FindNeighborsResponse) obj; + + if (!getNearestNeighborsList().equals(other.getNearestNeighborsList())) 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 (getNearestNeighborsCount() > 0) { + hash = (37 * hash) + NEAREST_NEIGHBORS_FIELD_NUMBER; + hash = (53 * hash) + getNearestNeighborsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse 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.aiplatform.v1.FindNeighborsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse 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.aiplatform.v1.FindNeighborsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse 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.aiplatform.v1.FindNeighborsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse 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.aiplatform.v1.FindNeighborsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse 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.aiplatform.v1.FindNeighborsResponse 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 response message for
+   * [MatchService.FindNeighbors][google.cloud.aiplatform.v1.MatchService.FindNeighbors].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.FindNeighborsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.FindNeighborsResponse) + com.google.cloud.aiplatform.v1.FindNeighborsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.class, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.FindNeighborsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (nearestNeighborsBuilder_ == null) { + nearestNeighbors_ = java.util.Collections.emptyList(); + } else { + nearestNeighbors_ = null; + nearestNeighborsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.FindNeighborsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse build() { + com.google.cloud.aiplatform.v1.FindNeighborsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.FindNeighborsResponse buildPartial() { + com.google.cloud.aiplatform.v1.FindNeighborsResponse result = + new com.google.cloud.aiplatform.v1.FindNeighborsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.aiplatform.v1.FindNeighborsResponse result) { + if (nearestNeighborsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + nearestNeighbors_ = java.util.Collections.unmodifiableList(nearestNeighbors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.nearestNeighbors_ = nearestNeighbors_; + } else { + result.nearestNeighbors_ = nearestNeighborsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.FindNeighborsResponse 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.aiplatform.v1.FindNeighborsResponse) { + return mergeFrom((com.google.cloud.aiplatform.v1.FindNeighborsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.FindNeighborsResponse other) { + if (other == com.google.cloud.aiplatform.v1.FindNeighborsResponse.getDefaultInstance()) + return this; + if (nearestNeighborsBuilder_ == null) { + if (!other.nearestNeighbors_.isEmpty()) { + if (nearestNeighbors_.isEmpty()) { + nearestNeighbors_ = other.nearestNeighbors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNearestNeighborsIsMutable(); + nearestNeighbors_.addAll(other.nearestNeighbors_); + } + onChanged(); + } + } else { + if (!other.nearestNeighbors_.isEmpty()) { + if (nearestNeighborsBuilder_.isEmpty()) { + nearestNeighborsBuilder_.dispose(); + nearestNeighborsBuilder_ = null; + nearestNeighbors_ = other.nearestNeighbors_; + bitField0_ = (bitField0_ & ~0x00000001); + nearestNeighborsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNearestNeighborsFieldBuilder() + : null; + } else { + nearestNeighborsBuilder_.addAllMessages(other.nearestNeighbors_); + } + } + } + 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.aiplatform.v1.FindNeighborsResponse.NearestNeighbors m = + input.readMessage( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + .parser(), + extensionRegistry); + if (nearestNeighborsBuilder_ == null) { + ensureNearestNeighborsIsMutable(); + nearestNeighbors_.add(m); + } else { + nearestNeighborsBuilder_.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 + nearestNeighbors_ = java.util.Collections.emptyList(); + + private void ensureNearestNeighborsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + nearestNeighbors_ = + new java.util.ArrayList< + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors>( + nearestNeighbors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighborsOrBuilder> + nearestNeighborsBuilder_; + + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public java.util.List + getNearestNeighborsList() { + if (nearestNeighborsBuilder_ == null) { + return java.util.Collections.unmodifiableList(nearestNeighbors_); + } else { + return nearestNeighborsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public int getNearestNeighborsCount() { + if (nearestNeighborsBuilder_ == null) { + return nearestNeighbors_.size(); + } else { + return nearestNeighborsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + getNearestNeighbors(int index) { + if (nearestNeighborsBuilder_ == null) { + return nearestNeighbors_.get(index); + } else { + return nearestNeighborsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public Builder setNearestNeighbors( + int index, com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors value) { + if (nearestNeighborsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNearestNeighborsIsMutable(); + nearestNeighbors_.set(index, value); + onChanged(); + } else { + nearestNeighborsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public Builder setNearestNeighbors( + int index, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder + builderForValue) { + if (nearestNeighborsBuilder_ == null) { + ensureNearestNeighborsIsMutable(); + nearestNeighbors_.set(index, builderForValue.build()); + onChanged(); + } else { + nearestNeighborsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public Builder addNearestNeighbors( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors value) { + if (nearestNeighborsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNearestNeighborsIsMutable(); + nearestNeighbors_.add(value); + onChanged(); + } else { + nearestNeighborsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public Builder addNearestNeighbors( + int index, com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors value) { + if (nearestNeighborsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNearestNeighborsIsMutable(); + nearestNeighbors_.add(index, value); + onChanged(); + } else { + nearestNeighborsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public Builder addNearestNeighbors( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder + builderForValue) { + if (nearestNeighborsBuilder_ == null) { + ensureNearestNeighborsIsMutable(); + nearestNeighbors_.add(builderForValue.build()); + onChanged(); + } else { + nearestNeighborsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public Builder addNearestNeighbors( + int index, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder + builderForValue) { + if (nearestNeighborsBuilder_ == null) { + ensureNearestNeighborsIsMutable(); + nearestNeighbors_.add(index, builderForValue.build()); + onChanged(); + } else { + nearestNeighborsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public Builder addAllNearestNeighbors( + java.lang.Iterable< + ? extends com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors> + values) { + if (nearestNeighborsBuilder_ == null) { + ensureNearestNeighborsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nearestNeighbors_); + onChanged(); + } else { + nearestNeighborsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public Builder clearNearestNeighbors() { + if (nearestNeighborsBuilder_ == null) { + nearestNeighbors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nearestNeighborsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public Builder removeNearestNeighbors(int index) { + if (nearestNeighborsBuilder_ == null) { + ensureNearestNeighborsIsMutable(); + nearestNeighbors_.remove(index); + onChanged(); + } else { + nearestNeighborsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder + getNearestNeighborsBuilder(int index) { + return getNearestNeighborsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighborsOrBuilder + getNearestNeighborsOrBuilder(int index) { + if (nearestNeighborsBuilder_ == null) { + return nearestNeighbors_.get(index); + } else { + return nearestNeighborsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighborsOrBuilder> + getNearestNeighborsOrBuilderList() { + if (nearestNeighborsBuilder_ != null) { + return nearestNeighborsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nearestNeighbors_); + } + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder + addNearestNeighborsBuilder() { + return getNearestNeighborsFieldBuilder() + .addBuilder( + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + .getDefaultInstance()); + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder + addNearestNeighborsBuilder(int index) { + return getNearestNeighborsFieldBuilder() + .addBuilder( + index, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + .getDefaultInstance()); + } + /** + * + * + *
+     * The nearest neighbors of the query datapoints.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + public java.util.List< + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder> + getNearestNeighborsBuilderList() { + return getNearestNeighborsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighborsOrBuilder> + getNearestNeighborsFieldBuilder() { + if (nearestNeighborsBuilder_ == null) { + nearestNeighborsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.Builder, + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighborsOrBuilder>( + nearestNeighbors_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + nearestNeighbors_ = null; + } + return nearestNeighborsBuilder_; + } + + @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.aiplatform.v1.FindNeighborsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.FindNeighborsResponse) + private static final com.google.cloud.aiplatform.v1.FindNeighborsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.FindNeighborsResponse(); + } + + public static com.google.cloud.aiplatform.v1.FindNeighborsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FindNeighborsResponse 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.aiplatform.v1.FindNeighborsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsResponseOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsResponseOrBuilder.java new file mode 100644 index 000000000000..df80077556aa --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/FindNeighborsResponseOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/match_service.proto + +package com.google.cloud.aiplatform.v1; + +public interface FindNeighborsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.FindNeighborsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The nearest neighbors of the query datapoints.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + java.util.List + getNearestNeighborsList(); + /** + * + * + *
+   * The nearest neighbors of the query datapoints.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors getNearestNeighbors( + int index); + /** + * + * + *
+   * The nearest neighbors of the query datapoints.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + int getNearestNeighborsCount(); + /** + * + * + *
+   * The nearest neighbors of the query datapoints.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + java.util.List< + ? extends com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighborsOrBuilder> + getNearestNeighborsOrBuilderList(); + /** + * + * + *
+   * The nearest neighbors of the query datapoints.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors nearest_neighbors = 1; + * + */ + com.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighborsOrBuilder + getNearestNeighborsOrBuilder(int index); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceProto.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceProto.java new file mode 100644 index 000000000000..274f2b20e2cd --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceProto.java @@ -0,0 +1,212 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/match_service.proto + +package com.google.cloud.aiplatform.v1; + +public final class MatchServiceProto { + private MatchServiceProto() {} + + 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_aiplatform_v1_FindNeighborsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_Query_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_Query_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_Neighbor_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_Neighbor_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_NearestNeighbors_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_NearestNeighbors_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsResponse_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/aiplatform/v1/match_servi" + + "ce.proto\022\032google.cloud.aiplatform.v1\032\034go" + + "ogle/api/annotations.proto\032\027google/api/c" + + "lient.proto\032\037google/api/field_behavior.p" + + "roto\032\031google/api/resource.proto\032&google/" + + "cloud/aiplatform/v1/index.proto\"\313\003\n\024Find" + + "NeighborsRequest\022G\n\016index_endpoint\030\001 \001(\t" + + "B/\340A\002\372A)\n\'aiplatform.googleapis.com/Inde" + + "xEndpoint\022\031\n\021deployed_index_id\030\002 \001(\t\022G\n\007" + + "queries\030\003 \003(\01326.google.cloud.aiplatform." + + "v1.FindNeighborsRequest.Query\022\035\n\025return_" + + "full_datapoint\030\004 \001(\010\032\346\001\n\005Query\022B\n\tdatapo" + + "int\030\001 \001(\0132*.google.cloud.aiplatform.v1.I" + + "ndexDatapointB\003\340A\002\022\026\n\016neighbor_count\030\002 \001" + + "(\005\022-\n%per_crowding_attribute_neighbor_co" + + "unt\030\003 \001(\005\022\"\n\032approximate_neighbor_count\030" + + "\004 \001(\005\022.\n&fraction_leaf_nodes_to_search_o" + + "verride\030\005 \001(\001\"\302\002\n\025FindNeighborsResponse\022" + + "]\n\021nearest_neighbors\030\001 \003(\0132B.google.clou" + + "d.aiplatform.v1.FindNeighborsResponse.Ne" + + "arestNeighbors\032[\n\010Neighbor\022=\n\tdatapoint\030" + + "\001 \001(\0132*.google.cloud.aiplatform.v1.Index" + + "Datapoint\022\020\n\010distance\030\002 \001(\001\032m\n\020NearestNe" + + "ighbors\022\n\n\002id\030\001 \001(\t\022M\n\tneighbors\030\002 \003(\0132:" + + ".google.cloud.aiplatform.v1.FindNeighbor" + + "sResponse.Neighbor\"\215\001\n\032ReadIndexDatapoin" + + "tsRequest\022G\n\016index_endpoint\030\001 \001(\tB/\340A\002\372A" + + ")\n\'aiplatform.googleapis.com/IndexEndpoi" + + "nt\022\031\n\021deployed_index_id\030\002 \001(\t\022\013\n\003ids\030\003 \003" + + "(\t\"]\n\033ReadIndexDatapointsResponse\022>\n\ndat" + + "apoints\030\001 \003(\0132*.google.cloud.aiplatform." + + "v1.IndexDatapoint2\221\004\n\014MatchService\022\313\001\n\rF" + + "indNeighbors\0220.google.cloud.aiplatform.v" + + "1.FindNeighborsRequest\0321.google.cloud.ai" + + "platform.v1.FindNeighborsResponse\"U\202\323\344\223\002" + + "O\"J/v1/{index_endpoint=projects/*/locati" + + "ons/*/indexEndpoints/*}:findNeighbors:\001*" + + "\022\343\001\n\023ReadIndexDatapoints\0226.google.cloud." + + "aiplatform.v1.ReadIndexDatapointsRequest" + + "\0327.google.cloud.aiplatform.v1.ReadIndexD" + + "atapointsResponse\"[\202\323\344\223\002U\"P/v1/{index_en" + + "dpoint=projects/*/locations/*/indexEndpo" + + "ints/*}:readIndexDatapoints:\001*\032M\312A\031aipla" + + "tform.googleapis.com\322A.https://www.googl" + + "eapis.com/auth/cloud-platformB\317\001\n\036com.go" + + "ogle.cloud.aiplatform.v1B\021MatchServicePr" + + "otoP\001Z>cloud.google.com/go/aiplatform/ap" + + "iv1/aiplatformpb;aiplatformpb\252\002\032Google.C" + + "loud.AIPlatform.V1\312\002\032Google\\Cloud\\AIPlat" + + "form\\V1\352\002\035Google::Cloud::AIPlatform::V1b" + + "\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.ResourceProto.getDescriptor(), + com.google.cloud.aiplatform.v1.IndexProto.getDescriptor(), + }); + internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_descriptor, + new java.lang.String[] { + "IndexEndpoint", "DeployedIndexId", "Queries", "ReturnFullDatapoint", + }); + internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_Query_descriptor = + internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_Query_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_FindNeighborsRequest_Query_descriptor, + new java.lang.String[] { + "Datapoint", + "NeighborCount", + "PerCrowdingAttributeNeighborCount", + "ApproximateNeighborCount", + "FractionLeafNodesToSearchOverride", + }); + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_descriptor, + new java.lang.String[] { + "NearestNeighbors", + }); + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_Neighbor_descriptor = + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_Neighbor_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_Neighbor_descriptor, + new java.lang.String[] { + "Datapoint", "Distance", + }); + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_NearestNeighbors_descriptor = + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_NearestNeighbors_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_FindNeighborsResponse_NearestNeighbors_descriptor, + new java.lang.String[] { + "Id", "Neighbors", + }); + internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsRequest_descriptor, + new java.lang.String[] { + "IndexEndpoint", "DeployedIndexId", "Ids", + }); + internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsResponse_descriptor, + new java.lang.String[] { + "Datapoints", + }); + 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.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.ResourceProto.getDescriptor(); + com.google.cloud.aiplatform.v1.IndexProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Presets.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Presets.java new file mode 100644 index 000000000000..4870b6e1032d --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Presets.java @@ -0,0 +1,1126 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/explanation.proto + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Preset configuration for example-based explanations
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.Presets} + */ +public final class Presets extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.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(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Presets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Presets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.Presets.class, + com.google.cloud.aiplatform.v1.Presets.Builder.class); + } + + /** + * + * + *
+   * Preset option controlling parameters for query speed-precision trade-off
+   * 
+ * + * Protobuf enum {@code google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets.Query) + } + + /** + * + * + *
+   * Preset option controlling parameters for different modalities
+   * 
+ * + * Protobuf enum {@code google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets.Query query = 1; + * + * @return The query. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Presets.Query getQuery() { + com.google.cloud.aiplatform.v1.Presets.Query result = + com.google.cloud.aiplatform.v1.Presets.Query.forNumber(query_); + return result == null ? com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets.Modality modality = 2; + * + * @return The modality. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Presets.Modality getModality() { + com.google.cloud.aiplatform.v1.Presets.Modality result = + com.google.cloud.aiplatform.v1.Presets.Modality.forNumber(modality_); + return result == null ? com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.Presets other = (com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.Presets parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Presets parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.Presets) + com.google.cloud.aiplatform.v1.PresetsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Presets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Presets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.Presets.class, + com.google.cloud.aiplatform.v1.Presets.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.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.aiplatform.v1.ExplanationProto + .internal_static_google_cloud_aiplatform_v1_Presets_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Presets getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.Presets.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Presets build() { + com.google.cloud.aiplatform.v1.Presets result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Presets buildPartial() { + com.google.cloud.aiplatform.v1.Presets result = + new com.google.cloud.aiplatform.v1.Presets(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets) { + return mergeFrom((com.google.cloud.aiplatform.v1.Presets) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.Presets other) { + if (other == com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets.Query query = 1; + * + * @return The query. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Presets.Query getQuery() { + com.google.cloud.aiplatform.v1.Presets.Query result = + com.google.cloud.aiplatform.v1.Presets.Query.forNumber(query_); + return result == null ? com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets.Query query = 1; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets.Modality modality = 2; + * + * @return The modality. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Presets.Modality getModality() { + com.google.cloud.aiplatform.v1.Presets.Modality result = + com.google.cloud.aiplatform.v1.Presets.Modality.forNumber(modality_); + return result == null ? com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets.Modality modality = 2; + * + * @param value The modality to set. + * @return This builder for chaining. + */ + public Builder setModality(com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.Presets) + private static final com.google.cloud.aiplatform.v1.Presets DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.Presets(); + } + + public static com.google.cloud.aiplatform.v1.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.aiplatform.v1.Presets getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/PresetsOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/PresetsOrBuilder.java new file mode 100644 index 000000000000..095a116a8f62 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/PresetsOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/explanation.proto + +package com.google.cloud.aiplatform.v1; + +public interface PresetsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets.Query query = 1; + * + * @return The query. + */ + com.google.cloud.aiplatform.v1.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.aiplatform.v1.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.aiplatform.v1.Presets.Modality modality = 2; + * + * @return The modality. + */ + com.google.cloud.aiplatform.v1.Presets.Modality getModality(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsRequest.java new file mode 100644 index 000000000000..facf252cf22c --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsRequest.java @@ -0,0 +1,1118 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/match_service.proto + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * The request message for
+ * [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1.MatchService.ReadIndexDatapoints].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ReadIndexDatapointsRequest} + */ +public final class ReadIndexDatapointsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.ReadIndexDatapointsRequest) + ReadIndexDatapointsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadIndexDatapointsRequest.newBuilder() to construct. + private ReadIndexDatapointsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadIndexDatapointsRequest() { + indexEndpoint_ = ""; + deployedIndexId_ = ""; + ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadIndexDatapointsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.class, + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.Builder.class); + } + + public static final int INDEX_ENDPOINT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object indexEndpoint_ = ""; + /** + * + * + *
+   * Required. The name of the index endpoint.
+   * Format:
+   * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+   * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The indexEndpoint. + */ + @java.lang.Override + public java.lang.String getIndexEndpoint() { + java.lang.Object ref = indexEndpoint_; + 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(); + indexEndpoint_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the index endpoint.
+   * Format:
+   * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+   * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for indexEndpoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIndexEndpointBytes() { + java.lang.Object ref = indexEndpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPLOYED_INDEX_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object deployedIndexId_ = ""; + /** + * + * + *
+   * The ID of the DeployedIndex that will serve the request.
+   * 
+ * + * string deployed_index_id = 2; + * + * @return The deployedIndexId. + */ + @java.lang.Override + public java.lang.String getDeployedIndexId() { + java.lang.Object ref = deployedIndexId_; + 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(); + deployedIndexId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the DeployedIndex that will serve the request.
+   * 
+ * + * string deployed_index_id = 2; + * + * @return The bytes for deployedIndexId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeployedIndexIdBytes() { + java.lang.Object ref = deployedIndexId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedIndexId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IDS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList ids_; + /** + * + * + *
+   * IDs of the datapoints to be searched for.
+   * 
+ * + * repeated string ids = 3; + * + * @return A list containing the ids. + */ + public com.google.protobuf.ProtocolStringList getIdsList() { + return ids_; + } + /** + * + * + *
+   * IDs of the datapoints to be searched for.
+   * 
+ * + * repeated string ids = 3; + * + * @return The count of ids. + */ + public int getIdsCount() { + return ids_.size(); + } + /** + * + * + *
+   * IDs of the datapoints to be searched for.
+   * 
+ * + * repeated string ids = 3; + * + * @param index The index of the element to return. + * @return The ids at the given index. + */ + public java.lang.String getIds(int index) { + return ids_.get(index); + } + /** + * + * + *
+   * IDs of the datapoints to be searched for.
+   * 
+ * + * repeated string ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the ids at the given index. + */ + public com.google.protobuf.ByteString getIdsBytes(int index) { + return ids_.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(indexEndpoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, indexEndpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedIndexId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deployedIndexId_); + } + for (int i = 0; i < ids_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ids_.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(indexEndpoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, indexEndpoint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deployedIndexId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deployedIndexId_); + } + { + int dataSize = 0; + for (int i = 0; i < ids_.size(); i++) { + dataSize += computeStringSizeNoTag(ids_.getRaw(i)); + } + size += dataSize; + size += 1 * getIdsList().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.aiplatform.v1.ReadIndexDatapointsRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest other = + (com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest) obj; + + if (!getIndexEndpoint().equals(other.getIndexEndpoint())) return false; + if (!getDeployedIndexId().equals(other.getDeployedIndexId())) return false; + if (!getIdsList().equals(other.getIdsList())) 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_ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getIndexEndpoint().hashCode(); + hash = (37 * hash) + DEPLOYED_INDEX_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeployedIndexId().hashCode(); + if (getIdsCount() > 0) { + hash = (37 * hash) + IDS_FIELD_NUMBER; + hash = (53 * hash) + getIdsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest 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.aiplatform.v1.ReadIndexDatapointsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest 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.aiplatform.v1.ReadIndexDatapointsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest 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.aiplatform.v1.ReadIndexDatapointsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest 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.aiplatform.v1.ReadIndexDatapointsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest 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.aiplatform.v1.ReadIndexDatapointsRequest 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 request message for
+   * [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1.MatchService.ReadIndexDatapoints].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ReadIndexDatapointsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.ReadIndexDatapointsRequest) + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.class, + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + indexEndpoint_ = ""; + deployedIndexId_ = ""; + ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest build() { + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest buildPartial() { + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest result = + new com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest result) { + if (((bitField0_ & 0x00000004) != 0)) { + ids_ = ids_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.ids_ = ids_; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.indexEndpoint_ = indexEndpoint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deployedIndexId_ = deployedIndexId_; + } + } + + @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.aiplatform.v1.ReadIndexDatapointsRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest other) { + if (other == com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.getDefaultInstance()) + return this; + if (!other.getIndexEndpoint().isEmpty()) { + indexEndpoint_ = other.indexEndpoint_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDeployedIndexId().isEmpty()) { + deployedIndexId_ = other.deployedIndexId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.ids_.isEmpty()) { + if (ids_.isEmpty()) { + ids_ = other.ids_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureIdsIsMutable(); + ids_.addAll(other.ids_); + } + 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: + { + indexEndpoint_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + deployedIndexId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureIdsIsMutable(); + ids_.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 indexEndpoint_ = ""; + /** + * + * + *
+     * Required. The name of the index endpoint.
+     * Format:
+     * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+     * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The indexEndpoint. + */ + public java.lang.String getIndexEndpoint() { + java.lang.Object ref = indexEndpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + indexEndpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the index endpoint.
+     * Format:
+     * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+     * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for indexEndpoint. + */ + public com.google.protobuf.ByteString getIndexEndpointBytes() { + java.lang.Object ref = indexEndpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the index endpoint.
+     * Format:
+     * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+     * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The indexEndpoint to set. + * @return This builder for chaining. + */ + public Builder setIndexEndpoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + indexEndpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the index endpoint.
+     * Format:
+     * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+     * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearIndexEndpoint() { + indexEndpoint_ = getDefaultInstance().getIndexEndpoint(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the index endpoint.
+     * Format:
+     * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+     * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for indexEndpoint to set. + * @return This builder for chaining. + */ + public Builder setIndexEndpointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + indexEndpoint_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object deployedIndexId_ = ""; + /** + * + * + *
+     * The ID of the DeployedIndex that will serve the request.
+     * 
+ * + * string deployed_index_id = 2; + * + * @return The deployedIndexId. + */ + public java.lang.String getDeployedIndexId() { + java.lang.Object ref = deployedIndexId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedIndexId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the DeployedIndex that will serve the request.
+     * 
+ * + * string deployed_index_id = 2; + * + * @return The bytes for deployedIndexId. + */ + public com.google.protobuf.ByteString getDeployedIndexIdBytes() { + java.lang.Object ref = deployedIndexId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedIndexId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the DeployedIndex that will serve the request.
+     * 
+ * + * string deployed_index_id = 2; + * + * @param value The deployedIndexId to set. + * @return This builder for chaining. + */ + public Builder setDeployedIndexId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + deployedIndexId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the DeployedIndex that will serve the request.
+     * 
+ * + * string deployed_index_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearDeployedIndexId() { + deployedIndexId_ = getDefaultInstance().getDeployedIndexId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the DeployedIndex that will serve the request.
+     * 
+ * + * string deployed_index_id = 2; + * + * @param value The bytes for deployedIndexId to set. + * @return This builder for chaining. + */ + public Builder setDeployedIndexIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + deployedIndexId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIdsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + ids_ = new com.google.protobuf.LazyStringArrayList(ids_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * IDs of the datapoints to be searched for.
+     * 
+ * + * repeated string ids = 3; + * + * @return A list containing the ids. + */ + public com.google.protobuf.ProtocolStringList getIdsList() { + return ids_.getUnmodifiableView(); + } + /** + * + * + *
+     * IDs of the datapoints to be searched for.
+     * 
+ * + * repeated string ids = 3; + * + * @return The count of ids. + */ + public int getIdsCount() { + return ids_.size(); + } + /** + * + * + *
+     * IDs of the datapoints to be searched for.
+     * 
+ * + * repeated string ids = 3; + * + * @param index The index of the element to return. + * @return The ids at the given index. + */ + public java.lang.String getIds(int index) { + return ids_.get(index); + } + /** + * + * + *
+     * IDs of the datapoints to be searched for.
+     * 
+ * + * repeated string ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the ids at the given index. + */ + public com.google.protobuf.ByteString getIdsBytes(int index) { + return ids_.getByteString(index); + } + /** + * + * + *
+     * IDs of the datapoints to be searched for.
+     * 
+ * + * repeated string ids = 3; + * + * @param index The index to set the value at. + * @param value The ids to set. + * @return This builder for chaining. + */ + public Builder setIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIdsIsMutable(); + ids_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of the datapoints to be searched for.
+     * 
+ * + * repeated string ids = 3; + * + * @param value The ids to add. + * @return This builder for chaining. + */ + public Builder addIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIdsIsMutable(); + ids_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of the datapoints to be searched for.
+     * 
+ * + * repeated string ids = 3; + * + * @param values The ids to add. + * @return This builder for chaining. + */ + public Builder addAllIds(java.lang.Iterable values) { + ensureIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ids_); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of the datapoints to be searched for.
+     * 
+ * + * repeated string ids = 3; + * + * @return This builder for chaining. + */ + public Builder clearIds() { + ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of the datapoints to be searched for.
+     * 
+ * + * repeated string ids = 3; + * + * @param value The bytes of the ids to add. + * @return This builder for chaining. + */ + public Builder addIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIdsIsMutable(); + ids_.add(value); + 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.aiplatform.v1.ReadIndexDatapointsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.ReadIndexDatapointsRequest) + private static final com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest(); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadIndexDatapointsRequest 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.aiplatform.v1.ReadIndexDatapointsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsRequestOrBuilder.java new file mode 100644 index 000000000000..f7063cb7af58 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/match_service.proto + +package com.google.cloud.aiplatform.v1; + +public interface ReadIndexDatapointsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.ReadIndexDatapointsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the index endpoint.
+   * Format:
+   * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+   * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The indexEndpoint. + */ + java.lang.String getIndexEndpoint(); + /** + * + * + *
+   * Required. The name of the index endpoint.
+   * Format:
+   * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
+   * 
+ * + * + * string index_endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for indexEndpoint. + */ + com.google.protobuf.ByteString getIndexEndpointBytes(); + + /** + * + * + *
+   * The ID of the DeployedIndex that will serve the request.
+   * 
+ * + * string deployed_index_id = 2; + * + * @return The deployedIndexId. + */ + java.lang.String getDeployedIndexId(); + /** + * + * + *
+   * The ID of the DeployedIndex that will serve the request.
+   * 
+ * + * string deployed_index_id = 2; + * + * @return The bytes for deployedIndexId. + */ + com.google.protobuf.ByteString getDeployedIndexIdBytes(); + + /** + * + * + *
+   * IDs of the datapoints to be searched for.
+   * 
+ * + * repeated string ids = 3; + * + * @return A list containing the ids. + */ + java.util.List getIdsList(); + /** + * + * + *
+   * IDs of the datapoints to be searched for.
+   * 
+ * + * repeated string ids = 3; + * + * @return The count of ids. + */ + int getIdsCount(); + /** + * + * + *
+   * IDs of the datapoints to be searched for.
+   * 
+ * + * repeated string ids = 3; + * + * @param index The index of the element to return. + * @return The ids at the given index. + */ + java.lang.String getIds(int index); + /** + * + * + *
+   * IDs of the datapoints to be searched for.
+   * 
+ * + * repeated string ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the ids at the given index. + */ + com.google.protobuf.ByteString getIdsBytes(int index); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsResponse.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsResponse.java new file mode 100644 index 000000000000..0184333bd65b --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsResponse.java @@ -0,0 +1,946 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/match_service.proto + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * The response message for
+ * [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1.MatchService.ReadIndexDatapoints].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ReadIndexDatapointsResponse} + */ +public final class ReadIndexDatapointsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.ReadIndexDatapointsResponse) + ReadIndexDatapointsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadIndexDatapointsResponse.newBuilder() to construct. + private ReadIndexDatapointsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadIndexDatapointsResponse() { + datapoints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadIndexDatapointsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.class, + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.Builder.class); + } + + public static final int DATAPOINTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List datapoints_; + /** + * + * + *
+   * The result list of datapoints.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + @java.lang.Override + public java.util.List getDatapointsList() { + return datapoints_; + } + /** + * + * + *
+   * The result list of datapoints.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + @java.lang.Override + public java.util.List + getDatapointsOrBuilderList() { + return datapoints_; + } + /** + * + * + *
+   * The result list of datapoints.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + @java.lang.Override + public int getDatapointsCount() { + return datapoints_.size(); + } + /** + * + * + *
+   * The result list of datapoints.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.IndexDatapoint getDatapoints(int index) { + return datapoints_.get(index); + } + /** + * + * + *
+   * The result list of datapoints.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder getDatapointsOrBuilder(int index) { + return datapoints_.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 < datapoints_.size(); i++) { + output.writeMessage(1, datapoints_.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 < datapoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, datapoints_.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.aiplatform.v1.ReadIndexDatapointsResponse)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse other = + (com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse) obj; + + if (!getDatapointsList().equals(other.getDatapointsList())) 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 (getDatapointsCount() > 0) { + hash = (37 * hash) + DATAPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getDatapointsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse 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.aiplatform.v1.ReadIndexDatapointsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse 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.aiplatform.v1.ReadIndexDatapointsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse 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.aiplatform.v1.ReadIndexDatapointsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse 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.aiplatform.v1.ReadIndexDatapointsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse 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.aiplatform.v1.ReadIndexDatapointsResponse 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 response message for
+   * [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1.MatchService.ReadIndexDatapoints].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ReadIndexDatapointsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.ReadIndexDatapointsResponse) + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.class, + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (datapointsBuilder_ == null) { + datapoints_ = java.util.Collections.emptyList(); + } else { + datapoints_ = null; + datapointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.MatchServiceProto + .internal_static_google_cloud_aiplatform_v1_ReadIndexDatapointsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse build() { + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse buildPartial() { + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse result = + new com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse result) { + if (datapointsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + datapoints_ = java.util.Collections.unmodifiableList(datapoints_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.datapoints_ = datapoints_; + } else { + result.datapoints_ = datapointsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse 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.aiplatform.v1.ReadIndexDatapointsResponse) { + return mergeFrom((com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse other) { + if (other == com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.getDefaultInstance()) + return this; + if (datapointsBuilder_ == null) { + if (!other.datapoints_.isEmpty()) { + if (datapoints_.isEmpty()) { + datapoints_ = other.datapoints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDatapointsIsMutable(); + datapoints_.addAll(other.datapoints_); + } + onChanged(); + } + } else { + if (!other.datapoints_.isEmpty()) { + if (datapointsBuilder_.isEmpty()) { + datapointsBuilder_.dispose(); + datapointsBuilder_ = null; + datapoints_ = other.datapoints_; + bitField0_ = (bitField0_ & ~0x00000001); + datapointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDatapointsFieldBuilder() + : null; + } else { + datapointsBuilder_.addAllMessages(other.datapoints_); + } + } + } + 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.aiplatform.v1.IndexDatapoint m = + input.readMessage( + com.google.cloud.aiplatform.v1.IndexDatapoint.parser(), extensionRegistry); + if (datapointsBuilder_ == null) { + ensureDatapointsIsMutable(); + datapoints_.add(m); + } else { + datapointsBuilder_.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 datapoints_ = + java.util.Collections.emptyList(); + + private void ensureDatapointsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + datapoints_ = + new java.util.ArrayList(datapoints_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.IndexDatapoint, + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder, + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder> + datapointsBuilder_; + + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public java.util.List getDatapointsList() { + if (datapointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(datapoints_); + } else { + return datapointsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public int getDatapointsCount() { + if (datapointsBuilder_ == null) { + return datapoints_.size(); + } else { + return datapointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public com.google.cloud.aiplatform.v1.IndexDatapoint getDatapoints(int index) { + if (datapointsBuilder_ == null) { + return datapoints_.get(index); + } else { + return datapointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public Builder setDatapoints(int index, com.google.cloud.aiplatform.v1.IndexDatapoint value) { + if (datapointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatapointsIsMutable(); + datapoints_.set(index, value); + onChanged(); + } else { + datapointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public Builder setDatapoints( + int index, com.google.cloud.aiplatform.v1.IndexDatapoint.Builder builderForValue) { + if (datapointsBuilder_ == null) { + ensureDatapointsIsMutable(); + datapoints_.set(index, builderForValue.build()); + onChanged(); + } else { + datapointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public Builder addDatapoints(com.google.cloud.aiplatform.v1.IndexDatapoint value) { + if (datapointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatapointsIsMutable(); + datapoints_.add(value); + onChanged(); + } else { + datapointsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public Builder addDatapoints(int index, com.google.cloud.aiplatform.v1.IndexDatapoint value) { + if (datapointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatapointsIsMutable(); + datapoints_.add(index, value); + onChanged(); + } else { + datapointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public Builder addDatapoints( + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder builderForValue) { + if (datapointsBuilder_ == null) { + ensureDatapointsIsMutable(); + datapoints_.add(builderForValue.build()); + onChanged(); + } else { + datapointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public Builder addDatapoints( + int index, com.google.cloud.aiplatform.v1.IndexDatapoint.Builder builderForValue) { + if (datapointsBuilder_ == null) { + ensureDatapointsIsMutable(); + datapoints_.add(index, builderForValue.build()); + onChanged(); + } else { + datapointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public Builder addAllDatapoints( + java.lang.Iterable values) { + if (datapointsBuilder_ == null) { + ensureDatapointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, datapoints_); + onChanged(); + } else { + datapointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public Builder clearDatapoints() { + if (datapointsBuilder_ == null) { + datapoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + datapointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public Builder removeDatapoints(int index) { + if (datapointsBuilder_ == null) { + ensureDatapointsIsMutable(); + datapoints_.remove(index); + onChanged(); + } else { + datapointsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public com.google.cloud.aiplatform.v1.IndexDatapoint.Builder getDatapointsBuilder(int index) { + return getDatapointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder getDatapointsOrBuilder( + int index) { + if (datapointsBuilder_ == null) { + return datapoints_.get(index); + } else { + return datapointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public java.util.List + getDatapointsOrBuilderList() { + if (datapointsBuilder_ != null) { + return datapointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(datapoints_); + } + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public com.google.cloud.aiplatform.v1.IndexDatapoint.Builder addDatapointsBuilder() { + return getDatapointsFieldBuilder() + .addBuilder(com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance()); + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public com.google.cloud.aiplatform.v1.IndexDatapoint.Builder addDatapointsBuilder(int index) { + return getDatapointsFieldBuilder() + .addBuilder(index, com.google.cloud.aiplatform.v1.IndexDatapoint.getDefaultInstance()); + } + /** + * + * + *
+     * The result list of datapoints.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + public java.util.List + getDatapointsBuilderList() { + return getDatapointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.IndexDatapoint, + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder, + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder> + getDatapointsFieldBuilder() { + if (datapointsBuilder_ == null) { + datapointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1.IndexDatapoint, + com.google.cloud.aiplatform.v1.IndexDatapoint.Builder, + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder>( + datapoints_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + datapoints_ = null; + } + return datapointsBuilder_; + } + + @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.aiplatform.v1.ReadIndexDatapointsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.ReadIndexDatapointsResponse) + private static final com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse(); + } + + public static com.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadIndexDatapointsResponse 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.aiplatform.v1.ReadIndexDatapointsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsResponseOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsResponseOrBuilder.java new file mode 100644 index 000000000000..a291ea1d6ed3 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReadIndexDatapointsResponseOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1/match_service.proto + +package com.google.cloud.aiplatform.v1; + +public interface ReadIndexDatapointsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.ReadIndexDatapointsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The result list of datapoints.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + java.util.List getDatapointsList(); + /** + * + * + *
+   * The result list of datapoints.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + com.google.cloud.aiplatform.v1.IndexDatapoint getDatapoints(int index); + /** + * + * + *
+   * The result list of datapoints.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + int getDatapointsCount(); + /** + * + * + *
+   * The result list of datapoints.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + java.util.List + getDatapointsOrBuilderList(); + /** + * + * + *
+   * The result list of datapoints.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.IndexDatapoint datapoints = 1; + */ + com.google.cloud.aiplatform.v1.IndexDatapointOrBuilder getDatapointsOrBuilder(int index); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/explanation.proto b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/explanation.proto index c1e3545c9c48..4b7b5c727258 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/explanation.proto +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/explanation.proto @@ -18,6 +18,7 @@ package google.cloud.aiplatform.v1; import "google/api/field_behavior.proto"; import "google/cloud/aiplatform/v1/explanation_metadata.proto"; +import "google/cloud/aiplatform/v1/io.proto"; import "google/protobuf/struct.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1"; @@ -241,6 +242,10 @@ message ExplanationParameters { // 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 @@ -415,6 +420,86 @@ message BlurBaselineConfig { 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.aiplatform.v1.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 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.aiplatform.v1.ExplanationSpec] entries // that can be overridden at [online // explanation][google.cloud.aiplatform.v1.PredictionService.Explain] time. diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/match_service.proto b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/match_service.proto new file mode 100644 index 000000000000..5b56a08b5a92 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/match_service.proto @@ -0,0 +1,176 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/index.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "MatchServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// MatchService is a Google managed service for efficient vector similarity +// search at scale. +service MatchService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Finds the nearest neighbors of each vector within the request. + rpc FindNeighbors(FindNeighborsRequest) returns (FindNeighborsResponse) { + option (google.api.http) = { + post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:findNeighbors" + body: "*" + }; + } + + // Reads the datapoints/vectors of the given IDs. + // A maximum of 1000 datapoints can be retrieved in a batch. + rpc ReadIndexDatapoints(ReadIndexDatapointsRequest) + returns (ReadIndexDatapointsResponse) { + option (google.api.http) = { + post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:readIndexDatapoints" + body: "*" + }; + } +} + +// The request message for +// [MatchService.FindNeighbors][google.cloud.aiplatform.v1.MatchService.FindNeighbors]. +message FindNeighborsRequest { + // A query to find a number of the nearest neighbors (most similar vectors) + // of a vector. + message Query { + // Required. The datapoint/vector whose nearest neighbors should be searched + // for. + IndexDatapoint datapoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of nearest neighbors to be retrieved from database for each + // query. If not set, will use the default from the service configuration + // (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config). + int32 neighbor_count = 2; + + // Crowding is a constraint on a neighbor list produced by nearest neighbor + // search requiring that no more than some value k' of the k neighbors + // returned have the same value of crowding_attribute. + // It's used for improving result diversity. + // This field is the maximum number of matches with the same crowding tag. + int32 per_crowding_attribute_neighbor_count = 3; + + // The number of neighbors to find via approximate search before + // exact reordering is performed. If not set, the default value from scam + // config is used; if set, this value must be > 0. + int32 approximate_neighbor_count = 4; + + // The fraction of the number of leaves to search, set at query time allows + // user to tune search performance. This value increase result in both + // search accuracy and latency increase. The value should be between 0.0 + // and 1.0. If not set or set to 0.0, query uses the default value specified + // in + // NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search. + double fraction_leaf_nodes_to_search_override = 5; + } + + // Required. The name of the index endpoint. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // The ID of the DeployedIndex that will serve the request. This request is + // sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That + // IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index + // has a DeployedIndex.id field. + // The value of the field below must equal one of the DeployedIndex.id + // fields of the IndexEndpoint that is being called for this request. + string deployed_index_id = 2; + + // The list of queries. + repeated Query queries = 3; + + // If set to true, the full datapoints (including all vector values and + // restricts) of the nearest neighbors are returned. + // Note that returning full datapoint will significantly increase the + // latency and cost of the query. + bool return_full_datapoint = 4; +} + +// The response message for +// [MatchService.FindNeighbors][google.cloud.aiplatform.v1.MatchService.FindNeighbors]. +message FindNeighborsResponse { + // A neighbor of the query vector. + message Neighbor { + // The datapoint of the neighbor. + // Note that full datapoints are returned only when "return_full_datapoint" + // is set to true. Otherwise, only the "datapoint_id" and "crowding_tag" + // fields are populated. + IndexDatapoint datapoint = 1; + + // The distance between the neighbor and the query vector. + double distance = 2; + } + + // Nearest neighbors for one query. + message NearestNeighbors { + // The ID of the query datapoint. + string id = 1; + + // All its neighbors. + repeated Neighbor neighbors = 2; + } + + // The nearest neighbors of the query datapoints. + repeated NearestNeighbors nearest_neighbors = 1; +} + +// The request message for +// [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1.MatchService.ReadIndexDatapoints]. +message ReadIndexDatapointsRequest { + // Required. The name of the index endpoint. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // The ID of the DeployedIndex that will serve the request. + string deployed_index_id = 2; + + // IDs of the datapoints to be searched for. + repeated string ids = 3; +} + +// The response message for +// [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1.MatchService.ReadIndexDatapoints]. +message ReadIndexDatapointsResponse { + // The result list of datapoints. + repeated IndexDatapoint datapoints = 1; +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceProto.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceProto.java index 66f65dbb528f..e81d146b394e 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceProto.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleServiceProto.java @@ -55,6 +55,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_aiplatform_v1beta1_ResumeScheduleRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_aiplatform_v1beta1_ResumeScheduleRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1beta1_UpdateScheduleRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1beta1_UpdateScheduleRequest_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -73,56 +77,66 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "eration.proto\032.google/cloud/aiplatform/v" + "1beta1/schedule.proto\032#google/longrunnin" + "g/operations.proto\032\033google/protobuf/empt" - + "y.proto\"\224\001\n\025CreateScheduleRequest\0229\n\006par" - + "ent\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapis." - + "com/Location\022@\n\010schedule\030\002 \001(\0132).google." - + "cloud.aiplatform.v1beta1.ScheduleB\003\340A\002\"N" - + "\n\022GetScheduleRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372" - + "A$\n\"aiplatform.googleapis.com/Schedule\"\232" - + "\001\n\024ListSchedulesRequest\0229\n\006parent\030\001 \001(\tB" - + ")\340A\002\372A#\n!locations.googleapis.com/Locati" - + "on\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n" - + "\npage_token\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"n\n\025L" - + "istSchedulesResponse\022<\n\tschedules\030\001 \003(\0132" - + ").google.cloud.aiplatform.v1beta1.Schedu" - + "le\022\027\n\017next_page_token\030\002 \001(\t\"Q\n\025DeleteSch" - + "eduleRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"aipl" - + "atform.googleapis.com/Schedule\"P\n\024PauseS" + + "y.proto\032 google/protobuf/field_mask.prot" + + "o\"\224\001\n\025CreateScheduleRequest\0229\n\006parent\030\001 " + + "\001(\tB)\340A\002\372A#\n!locations.googleapis.com/Lo" + + "cation\022@\n\010schedule\030\002 \001(\0132).google.cloud." + + "aiplatform.v1beta1.ScheduleB\003\340A\002\"N\n\022GetS" + "cheduleRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"ai" - + "platform.googleapis.com/Schedule\"h\n\025Resu" - + "meScheduleRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n" - + "\"aiplatform.googleapis.com/Schedule\022\025\n\010c" - + "atch_up\030\002 \001(\010B\003\340A\0012\364\t\n\017ScheduleService\022\313" - + "\001\n\016CreateSchedule\0226.google.cloud.aiplatf" - + "orm.v1beta1.CreateScheduleRequest\032).goog" - + "le.cloud.aiplatform.v1beta1.Schedule\"V\202\323" - + "\344\223\002>\"2/v1beta1/{parent=projects/*/locati" - + "ons/*}/schedules:\010schedule\332A\017parent,sche" - + "dule\022\335\001\n\016DeleteSchedule\0226.google.cloud.a" - + "iplatform.v1beta1.DeleteScheduleRequest\032" - + "\035.google.longrunning.Operation\"t\202\323\344\223\0024*2" - + "/v1beta1/{name=projects/*/locations/*/sc" - + "hedules/*}\332A\004name\312A0\n\025google.protobuf.Em" - + "pty\022\027DeleteOperationMetadata\022\260\001\n\013GetSche" - + "dule\0223.google.cloud.aiplatform.v1beta1.G" - + "etScheduleRequest\032).google.cloud.aiplatf" - + "orm.v1beta1.Schedule\"A\202\323\344\223\0024\0222/v1beta1/{" - + "name=projects/*/locations/*/schedules/*}" - + "\332A\004name\022\303\001\n\rListSchedules\0225.google.cloud" - + ".aiplatform.v1beta1.ListSchedulesRequest" - + "\0326.google.cloud.aiplatform.v1beta1.ListS" - + "chedulesResponse\"C\202\323\344\223\0024\0222/v1beta1/{pare" - + "nt=projects/*/locations/*}/schedules\332A\006p" - + "arent\022\252\001\n\rPauseSchedule\0225.google.cloud.a" - + "iplatform.v1beta1.PauseScheduleRequest\032\026" - + ".google.protobuf.Empty\"J\202\323\344\223\002=\"8/v1beta1" - + "/{name=projects/*/locations/*/schedules/" - + "*}:pause:\001*\332A\004name\022\275\001\n\016ResumeSchedule\0226." - + "google.cloud.aiplatform.v1beta1.ResumeSc" - + "heduleRequest\032\026.google.protobuf.Empty\"[\202" - + "\323\344\223\002>\"9/v1beta1/{name=projects/*/locatio" - + "ns/*/schedules/*}:resume:\001*\332A\004name\332A\rnam" - + "e,catch_up\032M\312A\031aiplatform.googleapis.com" + + "platform.googleapis.com/Schedule\"\232\001\n\024Lis" + + "tSchedulesRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A" + + "#\n!locations.googleapis.com/Location\022\016\n\006" + + "filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_" + + "token\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"n\n\025ListSch" + + "edulesResponse\022<\n\tschedules\030\001 \003(\0132).goog" + + "le.cloud.aiplatform.v1beta1.Schedule\022\027\n\017" + + "next_page_token\030\002 \001(\t\"Q\n\025DeleteScheduleR" + + "equest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"aiplatform" + + ".googleapis.com/Schedule\"P\n\024PauseSchedul" + + "eRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"aiplatfo" + + "rm.googleapis.com/Schedule\"h\n\025ResumeSche" + + "duleRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"aipla" + + "tform.googleapis.com/Schedule\022\025\n\010catch_u" + + "p\030\002 \001(\010B\003\340A\001\"\217\001\n\025UpdateScheduleRequest\022@" + + "\n\010schedule\030\001 \001(\0132).google.cloud.aiplatfo" + + "rm.v1beta1.ScheduleB\003\340A\002\0224\n\013update_mask\030" + + "\002 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\0022\320" + + "\013\n\017ScheduleService\022\313\001\n\016CreateSchedule\0226." + + "google.cloud.aiplatform.v1beta1.CreateSc" + + "heduleRequest\032).google.cloud.aiplatform." + + "v1beta1.Schedule\"V\202\323\344\223\002>\"2/v1beta1/{pare" + + "nt=projects/*/locations/*}/schedules:\010sc" + + "hedule\332A\017parent,schedule\022\335\001\n\016DeleteSched" + + "ule\0226.google.cloud.aiplatform.v1beta1.De" + + "leteScheduleRequest\032\035.google.longrunning" + + ".Operation\"t\202\323\344\223\0024*2/v1beta1/{name=proje" + + "cts/*/locations/*/schedules/*}\332A\004name\312A0" + + "\n\025google.protobuf.Empty\022\027DeleteOperation" + + "Metadata\022\260\001\n\013GetSchedule\0223.google.cloud." + + "aiplatform.v1beta1.GetScheduleRequest\032)." + + "google.cloud.aiplatform.v1beta1.Schedule" + + "\"A\202\323\344\223\0024\0222/v1beta1/{name=projects/*/loca" + + "tions/*/schedules/*}\332A\004name\022\303\001\n\rListSche" + + "dules\0225.google.cloud.aiplatform.v1beta1." + + "ListSchedulesRequest\0326.google.cloud.aipl" + + "atform.v1beta1.ListSchedulesResponse\"C\202\323" + + "\344\223\0024\0222/v1beta1/{parent=projects/*/locati" + + "ons/*}/schedules\332A\006parent\022\252\001\n\rPauseSched" + + "ule\0225.google.cloud.aiplatform.v1beta1.Pa" + + "useScheduleRequest\032\026.google.protobuf.Emp" + + "ty\"J\202\323\344\223\002=\"8/v1beta1/{name=projects/*/lo" + + "cations/*/schedules/*}:pause:\001*\332A\004name\022\275" + + "\001\n\016ResumeSchedule\0226.google.cloud.aiplatf" + + "orm.v1beta1.ResumeScheduleRequest\032\026.goog" + + "le.protobuf.Empty\"[\202\323\344\223\002>\"9/v1beta1/{nam" + + "e=projects/*/locations/*/schedules/*}:re" + + "sume:\001*\332A\004name\332A\rname,catch_up\022\331\001\n\016Updat" + + "eSchedule\0226.google.cloud.aiplatform.v1be" + + "ta1.UpdateScheduleRequest\032).google.cloud" + + ".aiplatform.v1beta1.Schedule\"d\202\323\344\223\002G2;/v" + + "1beta1/{schedule.name=projects/*/locatio" + + "ns/*/schedules/*}:\010schedule\332A\024schedule,u" + + "pdate_mask\032M\312A\031aiplatform.googleapis.com" + "\322A.https://www.googleapis.com/auth/cloud" + "-platformB\353\001\n#com.google.cloud.aiplatfor" + "m.v1beta1B\024ScheduleServiceProtoP\001ZCcloud" @@ -144,6 +158,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.aiplatform.v1beta1.ScheduleProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), }); internal_static_google_cloud_aiplatform_v1beta1_CreateScheduleRequest_descriptor = getDescriptor().getMessageTypes().get(0); @@ -201,6 +216,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "CatchUp", }); + internal_static_google_cloud_aiplatform_v1beta1_UpdateScheduleRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_aiplatform_v1beta1_UpdateScheduleRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1beta1_UpdateScheduleRequest_descriptor, + new java.lang.String[] { + "Schedule", "UpdateMask", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -220,6 +243,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.aiplatform.v1beta1.ScheduleProto.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-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/UpdateScheduleRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/UpdateScheduleRequest.java new file mode 100644 index 000000000000..8be5c8e591ad --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/UpdateScheduleRequest.java @@ -0,0 +1,1058 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1beta1/schedule_service.proto + +package com.google.cloud.aiplatform.v1beta1; + +/** + * + * + *
+ * Request message for
+ * [ScheduleService.UpdateSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.UpdateSchedule].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1beta1.UpdateScheduleRequest} + */ +public final class UpdateScheduleRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1beta1.UpdateScheduleRequest) + UpdateScheduleRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateScheduleRequest.newBuilder() to construct. + private UpdateScheduleRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateScheduleRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateScheduleRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.ScheduleServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_UpdateScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.ScheduleServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_UpdateScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest.class, + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest.Builder.class); + } + + public static final int SCHEDULE_FIELD_NUMBER = 1; + private com.google.cloud.aiplatform.v1beta1.Schedule schedule_; + /** + * + * + *
+   * Required. The Schedule which replaces the resource on the server.
+   * The following restrictions will be applied:
+   *   * The scheduled request type cannot be changed.
+   *   * The output_only fields will be ignored if specified.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schedule field is set. + */ + @java.lang.Override + public boolean hasSchedule() { + return schedule_ != null; + } + /** + * + * + *
+   * Required. The Schedule which replaces the resource on the server.
+   * The following restrictions will be applied:
+   *   * The scheduled request type cannot be changed.
+   *   * The output_only fields will be ignored if specified.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schedule. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.Schedule getSchedule() { + return schedule_ == null + ? com.google.cloud.aiplatform.v1beta1.Schedule.getDefaultInstance() + : schedule_; + } + /** + * + * + *
+   * Required. The Schedule which replaces the resource on the server.
+   * The following restrictions will be applied:
+   *   * The scheduled request type cannot be changed.
+   *   * The output_only fields will be ignored if specified.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.ScheduleOrBuilder getScheduleOrBuilder() { + return schedule_ == null + ? com.google.cloud.aiplatform.v1beta1.Schedule.getDefaultInstance() + : schedule_; + } + + 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 (schedule_ != null) { + output.writeMessage(1, getSchedule()); + } + 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 (schedule_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSchedule()); + } + 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.aiplatform.v1beta1.UpdateScheduleRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest other = + (com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest) obj; + + if (hasSchedule() != other.hasSchedule()) return false; + if (hasSchedule()) { + if (!getSchedule().equals(other.getSchedule())) 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 (hasSchedule()) { + hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getSchedule().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.aiplatform.v1beta1.UpdateScheduleRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest 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.aiplatform.v1beta1.UpdateScheduleRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest 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.aiplatform.v1beta1.UpdateScheduleRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest 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.aiplatform.v1beta1.UpdateScheduleRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest 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.aiplatform.v1beta1.UpdateScheduleRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest 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.aiplatform.v1beta1.UpdateScheduleRequest 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
+   * [ScheduleService.UpdateSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.UpdateSchedule].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1beta1.UpdateScheduleRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1beta1.UpdateScheduleRequest) + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.ScheduleServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_UpdateScheduleRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.ScheduleServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_UpdateScheduleRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest.class, + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + schedule_ = null; + if (scheduleBuilder_ != null) { + scheduleBuilder_.dispose(); + scheduleBuilder_ = 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.aiplatform.v1beta1.ScheduleServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_UpdateScheduleRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest build() { + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest buildPartial() { + com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest result = + new com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.schedule_ = scheduleBuilder_ == null ? schedule_ : scheduleBuilder_.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.aiplatform.v1beta1.UpdateScheduleRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest other) { + if (other == com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest.getDefaultInstance()) + return this; + if (other.hasSchedule()) { + mergeSchedule(other.getSchedule()); + } + 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(getScheduleFieldBuilder().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.aiplatform.v1beta1.Schedule schedule_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1beta1.Schedule, + com.google.cloud.aiplatform.v1beta1.Schedule.Builder, + com.google.cloud.aiplatform.v1beta1.ScheduleOrBuilder> + scheduleBuilder_; + /** + * + * + *
+     * Required. The Schedule which replaces the resource on the server.
+     * The following restrictions will be applied:
+     *   * The scheduled request type cannot be changed.
+     *   * The output_only fields will be ignored if specified.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schedule field is set. + */ + public boolean hasSchedule() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The Schedule which replaces the resource on the server.
+     * The following restrictions will be applied:
+     *   * The scheduled request type cannot be changed.
+     *   * The output_only fields will be ignored if specified.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schedule. + */ + public com.google.cloud.aiplatform.v1beta1.Schedule getSchedule() { + if (scheduleBuilder_ == null) { + return schedule_ == null + ? com.google.cloud.aiplatform.v1beta1.Schedule.getDefaultInstance() + : schedule_; + } else { + return scheduleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Schedule which replaces the resource on the server.
+     * The following restrictions will be applied:
+     *   * The scheduled request type cannot be changed.
+     *   * The output_only fields will be ignored if specified.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSchedule(com.google.cloud.aiplatform.v1beta1.Schedule value) { + if (scheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schedule_ = value; + } else { + scheduleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Schedule which replaces the resource on the server.
+     * The following restrictions will be applied:
+     *   * The scheduled request type cannot be changed.
+     *   * The output_only fields will be ignored if specified.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSchedule( + com.google.cloud.aiplatform.v1beta1.Schedule.Builder builderForValue) { + if (scheduleBuilder_ == null) { + schedule_ = builderForValue.build(); + } else { + scheduleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Schedule which replaces the resource on the server.
+     * The following restrictions will be applied:
+     *   * The scheduled request type cannot be changed.
+     *   * The output_only fields will be ignored if specified.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSchedule(com.google.cloud.aiplatform.v1beta1.Schedule value) { + if (scheduleBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && schedule_ != null + && schedule_ != com.google.cloud.aiplatform.v1beta1.Schedule.getDefaultInstance()) { + getScheduleBuilder().mergeFrom(value); + } else { + schedule_ = value; + } + } else { + scheduleBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Schedule which replaces the resource on the server.
+     * The following restrictions will be applied:
+     *   * The scheduled request type cannot be changed.
+     *   * The output_only fields will be ignored if specified.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSchedule() { + bitField0_ = (bitField0_ & ~0x00000001); + schedule_ = null; + if (scheduleBuilder_ != null) { + scheduleBuilder_.dispose(); + scheduleBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Schedule which replaces the resource on the server.
+     * The following restrictions will be applied:
+     *   * The scheduled request type cannot be changed.
+     *   * The output_only fields will be ignored if specified.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1beta1.Schedule.Builder getScheduleBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getScheduleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Schedule which replaces the resource on the server.
+     * The following restrictions will be applied:
+     *   * The scheduled request type cannot be changed.
+     *   * The output_only fields will be ignored if specified.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1beta1.ScheduleOrBuilder getScheduleOrBuilder() { + if (scheduleBuilder_ != null) { + return scheduleBuilder_.getMessageOrBuilder(); + } else { + return schedule_ == null + ? com.google.cloud.aiplatform.v1beta1.Schedule.getDefaultInstance() + : schedule_; + } + } + /** + * + * + *
+     * Required. The Schedule which replaces the resource on the server.
+     * The following restrictions will be applied:
+     *   * The scheduled request type cannot be changed.
+     *   * The output_only fields will be ignored if specified.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1beta1.Schedule, + com.google.cloud.aiplatform.v1beta1.Schedule.Builder, + com.google.cloud.aiplatform.v1beta1.ScheduleOrBuilder> + getScheduleFieldBuilder() { + if (scheduleBuilder_ == null) { + scheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.aiplatform.v1beta1.Schedule, + com.google.cloud.aiplatform.v1beta1.Schedule.Builder, + com.google.cloud.aiplatform.v1beta1.ScheduleOrBuilder>( + getSchedule(), getParentForChildren(), isClean()); + schedule_ = null; + } + return scheduleBuilder_; + } + + 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.aiplatform.v1beta1.UpdateScheduleRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1beta1.UpdateScheduleRequest) + private static final com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest(); + } + + public static com.google.cloud.aiplatform.v1beta1.UpdateScheduleRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateScheduleRequest 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.aiplatform.v1beta1.UpdateScheduleRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/UpdateScheduleRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/UpdateScheduleRequestOrBuilder.java new file mode 100644 index 000000000000..43ec20a7736a --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/UpdateScheduleRequestOrBuilder.java @@ -0,0 +1,116 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/aiplatform/v1beta1/schedule_service.proto + +package com.google.cloud.aiplatform.v1beta1; + +public interface UpdateScheduleRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1beta1.UpdateScheduleRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Schedule which replaces the resource on the server.
+   * The following restrictions will be applied:
+   *   * The scheduled request type cannot be changed.
+   *   * The output_only fields will be ignored if specified.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schedule field is set. + */ + boolean hasSchedule(); + /** + * + * + *
+   * Required. The Schedule which replaces the resource on the server.
+   * The following restrictions will be applied:
+   *   * The scheduled request type cannot be changed.
+   *   * The output_only fields will be ignored if specified.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schedule. + */ + com.google.cloud.aiplatform.v1beta1.Schedule getSchedule(); + /** + * + * + *
+   * Required. The Schedule which replaces the resource on the server.
+   * The following restrictions will be applied:
+   *   * The scheduled request type cannot be changed.
+   *   * The output_only fields will be ignored if specified.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Schedule schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.aiplatform.v1beta1.ScheduleOrBuilder getScheduleOrBuilder(); + + /** + * + * + *
+   * 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-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/schedule_service.proto b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/schedule_service.proto index 234dcece3c22..f71ea0f85e0e 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/schedule_service.proto +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/schedule_service.proto @@ -24,6 +24,7 @@ import "google/cloud/aiplatform/v1beta1/operation.proto"; import "google/cloud/aiplatform/v1beta1/schedule.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; @@ -106,6 +107,21 @@ service ScheduleService { option (google.api.method_signature) = "name"; option (google.api.method_signature) = "name,catch_up"; } + + // Updates an active or paused Schedule. + // + // When the Schedule is updated, new runs will be scheduled starting from the + // updated next execution time after the update time based on the + // time_specification in the updated Schedule. All unstarted runs before the + // update time will be skipped while already created runs will NOT be paused + // or canceled. + rpc UpdateSchedule(UpdateScheduleRequest) returns (Schedule) { + option (google.api.http) = { + patch: "/v1beta1/{schedule.name=projects/*/locations/*/schedules/*}" + body: "schedule" + }; + option (google.api.method_signature) = "schedule,update_mask"; + } } // Request message for @@ -274,3 +290,18 @@ message ResumeScheduleRequest { // field. Default to false. bool catch_up = 2 [(google.api.field_behavior) = OPTIONAL]; } + +// Request message for +// [ScheduleService.UpdateSchedule][google.cloud.aiplatform.v1beta1.ScheduleService.UpdateSchedule]. +message UpdateScheduleRequest { + // Required. The Schedule which replaces the resource on the server. + // The following restrictions will be applied: + // * The scheduled request type cannot be changed. + // * The output_only fields will be ignored if specified. + Schedule schedule = 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]; +}