diff --git a/java-discoveryengine/README.md b/java-discoveryengine/README.md index 41248e2f90c4..7e9ab6478ff9 100644 --- a/java-discoveryengine/README.md +++ b/java-discoveryengine/README.md @@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.19.0 + 26.22.0 pom import @@ -201,7 +201,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-preview-yellow [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-discoveryengine.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-discoveryengine/0.18.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-discoveryengine/0.19.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-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/CompletionServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/CompletionServiceClient.java index b57d08fdc625..0fcd05db059a 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/CompletionServiceClient.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/CompletionServiceClient.java @@ -47,6 +47,7 @@ * .setQuery("query107944136") * .setQueryModel("queryModel-184930495") * .setUserPseudoId("userPseudoId-1155274652") + * .setIncludeTailSuggestions(true) * .build(); * CompleteQueryResponse response = completionServiceClient.completeQuery(request); * } @@ -198,6 +199,7 @@ public CompletionServiceStub getStub() { * .setQuery("query107944136") * .setQueryModel("queryModel-184930495") * .setUserPseudoId("userPseudoId-1155274652") + * .setIncludeTailSuggestions(true) * .build(); * CompleteQueryResponse response = completionServiceClient.completeQuery(request); * } @@ -232,6 +234,7 @@ public final CompleteQueryResponse completeQuery(CompleteQueryRequest request) { * .setQuery("query107944136") * .setQueryModel("queryModel-184930495") * .setUserPseudoId("userPseudoId-1155274652") + * .setIncludeTailSuggestions(true) * .build(); * ApiFuture future = * completionServiceClient.completeQueryCallable().futureCall(request); diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceClient.java new file mode 100644 index 000000000000..17d352a2eeec --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceClient.java @@ -0,0 +1,1186 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.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.discoveryengine.v1.stub.ConversationalSearchServiceStub; +import com.google.cloud.discoveryengine.v1.stub.ConversationalSearchServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for conversational search. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+ *     ConversationalSearchServiceClient.create()) {
+ *   ConversationName name =
+ *       ConversationName.ofProjectLocationDataStoreConversationName(
+ *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]");
+ *   TextInput query = TextInput.newBuilder().build();
+ *   ConverseConversationResponse response =
+ *       conversationalSearchServiceClient.converseConversation(name, query);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ConversationalSearchServiceClient 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 + * ConversationalSearchServiceSettings 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
+ * ConversationalSearchServiceSettings conversationalSearchServiceSettings =
+ *     ConversationalSearchServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ConversationalSearchServiceClient conversationalSearchServiceClient =
+ *     ConversationalSearchServiceClient.create(conversationalSearchServiceSettings);
+ * }
+ * + *

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
+ * ConversationalSearchServiceSettings conversationalSearchServiceSettings =
+ *     ConversationalSearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ConversationalSearchServiceClient conversationalSearchServiceClient =
+ *     ConversationalSearchServiceClient.create(conversationalSearchServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConversationalSearchServiceSettings conversationalSearchServiceSettings =
+ *     ConversationalSearchServiceSettings.newHttpJsonBuilder().build();
+ * ConversationalSearchServiceClient conversationalSearchServiceClient =
+ *     ConversationalSearchServiceClient.create(conversationalSearchServiceSettings);
+ * }
+ * + *

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

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ConversationName name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]");
+   *   TextInput query = TextInput.newBuilder().build();
+   *   ConverseConversationResponse response =
+   *       conversationalSearchServiceClient.converseConversation(name, query);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + * Use + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + * to activate auto session mode, which automatically creates a new conversation inside a + * ConverseConversation session. + * @param query Required. Current user input. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConverseConversationResponse converseConversation( + ConversationName name, TextInput query) { + ConverseConversationRequest request = + ConverseConversationRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setQuery(query) + .build(); + return converseConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Converses a conversation. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   String name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *           .toString();
+   *   TextInput query = TextInput.newBuilder().build();
+   *   ConverseConversationResponse response =
+   *       conversationalSearchServiceClient.converseConversation(name, query);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + * Use + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + * to activate auto session mode, which automatically creates a new conversation inside a + * ConverseConversation session. + * @param query Required. Current user input. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConverseConversationResponse converseConversation(String name, TextInput query) { + ConverseConversationRequest request = + ConverseConversationRequest.newBuilder().setName(name).setQuery(query).build(); + return converseConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Converses a conversation. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ConverseConversationRequest request =
+   *       ConverseConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .setQuery(TextInput.newBuilder().build())
+   *           .setServingConfig(
+   *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .setSafeSearch(true)
+   *           .putAllUserLabels(new HashMap())
+   *           .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build())
+   *           .build();
+   *   ConverseConversationResponse response =
+   *       conversationalSearchServiceClient.converseConversation(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 ConverseConversationResponse converseConversation( + ConverseConversationRequest request) { + return converseConversationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Converses a conversation. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ConverseConversationRequest request =
+   *       ConverseConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .setQuery(TextInput.newBuilder().build())
+   *           .setServingConfig(
+   *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .setSafeSearch(true)
+   *           .putAllUserLabels(new HashMap())
+   *           .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.converseConversationCallable().futureCall(request);
+   *   // Do something.
+   *   ConverseConversationResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + converseConversationCallable() { + return stub.converseConversationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to create already + * exists, an ALREADY_EXISTS error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   DataStoreName parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
+   *   Conversation conversation = Conversation.newBuilder().build();
+   *   Conversation response =
+   *       conversationalSearchServiceClient.createConversation(parent, conversation);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * @param conversation Required. The conversation to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Conversation createConversation(DataStoreName parent, Conversation conversation) { + CreateConversationRequest request = + CreateConversationRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setConversation(conversation) + .build(); + return createConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to create already + * exists, an ALREADY_EXISTS error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   String parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *           .toString();
+   *   Conversation conversation = Conversation.newBuilder().build();
+   *   Conversation response =
+   *       conversationalSearchServiceClient.createConversation(parent, conversation);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * @param conversation Required. The conversation to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Conversation createConversation(String parent, Conversation conversation) { + CreateConversationRequest request = + CreateConversationRequest.newBuilder() + .setParent(parent) + .setConversation(conversation) + .build(); + return createConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to create already + * exists, an ALREADY_EXISTS error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   CreateConversationRequest request =
+   *       CreateConversationRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .build();
+   *   Conversation response = conversationalSearchServiceClient.createConversation(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 Conversation createConversation(CreateConversationRequest request) { + return createConversationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to create already + * exists, an ALREADY_EXISTS error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   CreateConversationRequest request =
+   *       CreateConversationRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.createConversationCallable().futureCall(request);
+   *   // Do something.
+   *   Conversation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createConversationCallable() { + return stub.createConversationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to delete does not + * exist, a NOT_FOUND error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ConversationName name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]");
+   *   conversationalSearchServiceClient.deleteConversation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteConversation(ConversationName name) { + DeleteConversationRequest request = + DeleteConversationRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to delete does not + * exist, a NOT_FOUND error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   String name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *           .toString();
+   *   conversationalSearchServiceClient.deleteConversation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteConversation(String name) { + DeleteConversationRequest request = + DeleteConversationRequest.newBuilder().setName(name).build(); + deleteConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to delete does not + * exist, a NOT_FOUND error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   DeleteConversationRequest request =
+   *       DeleteConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .build();
+   *   conversationalSearchServiceClient.deleteConversation(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 void deleteConversation(DeleteConversationRequest request) { + deleteConversationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to delete does not + * exist, a NOT_FOUND error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   DeleteConversationRequest request =
+   *       DeleteConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.deleteConversationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteConversationCallable() { + return stub.deleteConversationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a Conversation. + * + *

[Conversation][google.cloud.discoveryengine.v1.Conversation] action type cannot be changed. + * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to update does not exist, a + * NOT_FOUND error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   Conversation conversation = Conversation.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Conversation response =
+   *       conversationalSearchServiceClient.updateConversation(conversation, updateMask);
+   * }
+   * }
+ * + * @param conversation Required. The Conversation to update. + * @param updateMask Indicates which fields in the provided + * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The following are + * NOT supported: + *
    + *
  • [conversation.name][] + *
+ *

If not set or empty, all supported fields are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Conversation updateConversation(Conversation conversation, FieldMask updateMask) { + UpdateConversationRequest request = + UpdateConversationRequest.newBuilder() + .setConversation(conversation) + .setUpdateMask(updateMask) + .build(); + return updateConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a Conversation. + * + *

[Conversation][google.cloud.discoveryengine.v1.Conversation] action type cannot be changed. + * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to update does not exist, a + * NOT_FOUND error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   UpdateConversationRequest request =
+   *       UpdateConversationRequest.newBuilder()
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Conversation response = conversationalSearchServiceClient.updateConversation(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 Conversation updateConversation(UpdateConversationRequest request) { + return updateConversationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a Conversation. + * + *

[Conversation][google.cloud.discoveryengine.v1.Conversation] action type cannot be changed. + * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to update does not exist, a + * NOT_FOUND error is returned. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   UpdateConversationRequest request =
+   *       UpdateConversationRequest.newBuilder()
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.updateConversationCallable().futureCall(request);
+   *   // Do something.
+   *   Conversation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateConversationCallable() { + return stub.updateConversationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Conversation. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ConversationName name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]");
+   *   Conversation response = conversationalSearchServiceClient.getConversation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Conversation getConversation(ConversationName name) { + GetConversationRequest request = + GetConversationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Conversation. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   String name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *           .toString();
+   *   Conversation response = conversationalSearchServiceClient.getConversation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Conversation getConversation(String name) { + GetConversationRequest request = GetConversationRequest.newBuilder().setName(name).build(); + return getConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Conversation. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   GetConversationRequest request =
+   *       GetConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .build();
+   *   Conversation response = conversationalSearchServiceClient.getConversation(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 Conversation getConversation(GetConversationRequest request) { + return getConversationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Conversation. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   GetConversationRequest request =
+   *       GetConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.getConversationCallable().futureCall(request);
+   *   // Do something.
+   *   Conversation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getConversationCallable() { + return stub.getConversationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Conversations by their parent [DataStore][google.cloud.discoveryengine.v1.DataStore]. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   DataStoreName parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
+   *   for (Conversation element :
+   *       conversationalSearchServiceClient.listConversations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConversationsPagedResponse listConversations(DataStoreName parent) { + ListConversationsRequest request = + ListConversationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listConversations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Conversations by their parent [DataStore][google.cloud.discoveryengine.v1.DataStore]. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   String parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *           .toString();
+   *   for (Conversation element :
+   *       conversationalSearchServiceClient.listConversations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConversationsPagedResponse listConversations(String parent) { + ListConversationsRequest request = + ListConversationsRequest.newBuilder().setParent(parent).build(); + return listConversations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Conversations by their parent [DataStore][google.cloud.discoveryengine.v1.DataStore]. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ListConversationsRequest request =
+   *       ListConversationsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Conversation element :
+   *       conversationalSearchServiceClient.listConversations(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 ListConversationsPagedResponse listConversations(ListConversationsRequest request) { + return listConversationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Conversations by their parent [DataStore][google.cloud.discoveryengine.v1.DataStore]. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ListConversationsRequest request =
+   *       ListConversationsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.listConversationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Conversation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listConversationsPagedCallable() { + return stub.listConversationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Conversations by their parent [DataStore][google.cloud.discoveryengine.v1.DataStore]. + * + *

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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ListConversationsRequest request =
+   *       ListConversationsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListConversationsResponse response =
+   *         conversationalSearchServiceClient.listConversationsCallable().call(request);
+   *     for (Conversation element : response.getConversationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listConversationsCallable() { + return stub.listConversationsCallable(); + } + + @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 ListConversationsPagedResponse + extends AbstractPagedListResponse< + ListConversationsRequest, + ListConversationsResponse, + Conversation, + ListConversationsPage, + ListConversationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListConversationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListConversationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListConversationsPagedResponse(ListConversationsPage page) { + super(page, ListConversationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListConversationsPage + extends AbstractPage< + ListConversationsRequest, + ListConversationsResponse, + Conversation, + ListConversationsPage> { + + private ListConversationsPage( + PageContext context, + ListConversationsResponse response) { + super(context, response); + } + + private static ListConversationsPage createEmptyPage() { + return new ListConversationsPage(null, null); + } + + @Override + protected ListConversationsPage createPage( + PageContext context, + ListConversationsResponse response) { + return new ListConversationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListConversationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListConversationsRequest, + ListConversationsResponse, + Conversation, + ListConversationsPage, + ListConversationsFixedSizeCollection> { + + private ListConversationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListConversationsFixedSizeCollection createEmptyCollection() { + return new ListConversationsFixedSizeCollection(null, 0); + } + + @Override + protected ListConversationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListConversationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceSettings.java new file mode 100644 index 000000000000..8aef0f972443 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceSettings.java @@ -0,0 +1,278 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1; + +import static com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1.stub.ConversationalSearchServiceStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ConversationalSearchServiceClient}. + * + *

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

    + *
  • The default service address (discoveryengine.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 converseConversation 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
+ * ConversationalSearchServiceSettings.Builder conversationalSearchServiceSettingsBuilder =
+ *     ConversationalSearchServiceSettings.newBuilder();
+ * conversationalSearchServiceSettingsBuilder
+ *     .converseConversationSettings()
+ *     .setRetrySettings(
+ *         conversationalSearchServiceSettingsBuilder
+ *             .converseConversationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConversationalSearchServiceSettings conversationalSearchServiceSettings =
+ *     conversationalSearchServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ConversationalSearchServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to converseConversation. */ + public UnaryCallSettings + converseConversationSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()) + .converseConversationSettings(); + } + + /** Returns the object with the settings used for calls to createConversation. */ + public UnaryCallSettings createConversationSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()) + .createConversationSettings(); + } + + /** Returns the object with the settings used for calls to deleteConversation. */ + public UnaryCallSettings deleteConversationSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()) + .deleteConversationSettings(); + } + + /** Returns the object with the settings used for calls to updateConversation. */ + public UnaryCallSettings updateConversationSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()) + .updateConversationSettings(); + } + + /** Returns the object with the settings used for calls to getConversation. */ + public UnaryCallSettings getConversationSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()).getConversationSettings(); + } + + /** Returns the object with the settings used for calls to listConversations. */ + public PagedCallSettings< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()) + .listConversationsSettings(); + } + + public static final ConversationalSearchServiceSettings create( + ConversationalSearchServiceStubSettings stub) throws IOException { + return new ConversationalSearchServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ConversationalSearchServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ConversationalSearchServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ConversationalSearchServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ConversationalSearchServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ConversationalSearchServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ConversationalSearchServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ConversationalSearchServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ConversationalSearchServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ConversationalSearchServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(ConversationalSearchServiceStubSettings.newHttpJsonBuilder()); + } + + public ConversationalSearchServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ConversationalSearchServiceStubSettings.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 converseConversation. */ + public UnaryCallSettings.Builder + converseConversationSettings() { + return getStubSettingsBuilder().converseConversationSettings(); + } + + /** Returns the builder for the settings used for calls to createConversation. */ + public UnaryCallSettings.Builder + createConversationSettings() { + return getStubSettingsBuilder().createConversationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteConversation. */ + public UnaryCallSettings.Builder + deleteConversationSettings() { + return getStubSettingsBuilder().deleteConversationSettings(); + } + + /** Returns the builder for the settings used for calls to updateConversation. */ + public UnaryCallSettings.Builder + updateConversationSettings() { + return getStubSettingsBuilder().updateConversationSettings(); + } + + /** Returns the builder for the settings used for calls to getConversation. */ + public UnaryCallSettings.Builder + getConversationSettings() { + return getStubSettingsBuilder().getConversationSettings(); + } + + /** Returns the builder for the settings used for calls to listConversations. */ + public PagedCallSettings.Builder< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings() { + return getStubSettingsBuilder().listConversationsSettings(); + } + + @Override + public ConversationalSearchServiceSettings build() throws IOException { + return new ConversationalSearchServiceSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/DocumentServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/DocumentServiceClient.java index a789251e9f7a..8df248207207 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/DocumentServiceClient.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/DocumentServiceClient.java @@ -367,8 +367,9 @@ public final UnaryCallable getDocumentCallable() { * @param parent Required. The parent branch resource name, such as * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. * Use `default_branch` as the branch ID, to list documents under the default branch. - *

If the caller does not have permission to list [Documents][]s under this branch, - * regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned. + *

If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, regardless of + * whether or not this branch exists, a `PERMISSION_DENIED` error is returned. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListDocumentsPagedResponse listDocuments(BranchName parent) { @@ -405,8 +406,9 @@ public final ListDocumentsPagedResponse listDocuments(BranchName parent) { * @param parent Required. The parent branch resource name, such as * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. * Use `default_branch` as the branch ID, to list documents under the default branch. - *

If the caller does not have permission to list [Documents][]s under this branch, - * regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned. + *

If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, regardless of + * whether or not this branch exists, a `PERMISSION_DENIED` error is returned. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListDocumentsPagedResponse listDocuments(String parent) { diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/SearchServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/SearchServiceClient.java index ba53e6def7a4..6c134915e51e 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/SearchServiceClient.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/SearchServiceClient.java @@ -57,10 +57,15 @@ * "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") * .toString()) * .setQuery("query107944136") + * .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOffset(-1019779949) + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") * .setUserInfo(UserInfo.newBuilder().build()) + * .addAllFacetSpecs(new ArrayList()) + * .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) * .putAllParams(new HashMap()) * .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) * .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) @@ -219,10 +224,15 @@ public SearchServiceStub getStub() { * "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") * .toString()) * .setQuery("query107944136") + * .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOffset(-1019779949) + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") * .setUserInfo(UserInfo.newBuilder().build()) + * .addAllFacetSpecs(new ArrayList()) + * .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) * .putAllParams(new HashMap()) * .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) * .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) @@ -268,10 +278,15 @@ public final SearchPagedResponse search(SearchRequest request) { * "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") * .toString()) * .setQuery("query107944136") + * .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOffset(-1019779949) + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") * .setUserInfo(UserInfo.newBuilder().build()) + * .addAllFacetSpecs(new ArrayList()) + * .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) * .putAllParams(new HashMap()) * .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) * .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) @@ -317,10 +332,15 @@ public final UnaryCallable searchPagedCallab * "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") * .toString()) * .setQuery("query107944136") + * .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOffset(-1019779949) + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") * .setUserInfo(UserInfo.newBuilder().build()) + * .addAllFacetSpecs(new ArrayList()) + * .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) * .putAllParams(new HashMap()) * .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) * .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/UserEventServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/UserEventServiceClient.java index d5a69e8813e0..d33bda765427 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/UserEventServiceClient.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/UserEventServiceClient.java @@ -272,7 +272,7 @@ public final UnaryCallable writeUserEventCalla // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Writes a single user event from the browser. This uses a GET request to due to browser - * restriction of POST-ing to a 3rd party domain. + * restriction of POST-ing to a third-party domain. * *

This method is used only by the Discovery Engine API JavaScript pixel and Google Tag * Manager. Users should not call this method directly. @@ -310,7 +310,7 @@ public final HttpBody collectUserEvent(CollectUserEventRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Writes a single user event from the browser. This uses a GET request to due to browser - * restriction of POST-ing to a 3rd party domain. + * restriction of POST-ing to a third-party domain. * *

This method is used only by the Discovery Engine API JavaScript pixel and Google Tag * Manager. Users should not call this method directly. diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/gapic_metadata.json b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/gapic_metadata.json index 07b306ce2c0a..4fb8e738cf19 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/gapic_metadata.json +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/gapic_metadata.json @@ -17,6 +17,33 @@ } } }, + "ConversationalSearchService": { + "clients": { + "grpc": { + "libraryClient": "ConversationalSearchServiceClient", + "rpcs": { + "ConverseConversation": { + "methods": ["converseConversation", "converseConversation", "converseConversation", "converseConversationCallable"] + }, + "CreateConversation": { + "methods": ["createConversation", "createConversation", "createConversation", "createConversationCallable"] + }, + "DeleteConversation": { + "methods": ["deleteConversation", "deleteConversation", "deleteConversation", "deleteConversationCallable"] + }, + "GetConversation": { + "methods": ["getConversation", "getConversation", "getConversation", "getConversationCallable"] + }, + "ListConversations": { + "methods": ["listConversations", "listConversations", "listConversations", "listConversationsPagedCallable", "listConversationsCallable"] + }, + "UpdateConversation": { + "methods": ["updateConversation", "updateConversation", "updateConversationCallable"] + } + } + } + } + }, "DocumentService": { "clients": { "grpc": { diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/package-info.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/package-info.java index 011db3d84b21..1fe403cbeb05 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/package-info.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/package-info.java @@ -41,11 +41,35 @@ * .setQuery("query107944136") * .setQueryModel("queryModel-184930495") * .setUserPseudoId("userPseudoId-1155274652") + * .setIncludeTailSuggestions(true) * .build(); * CompleteQueryResponse response = completionServiceClient.completeQuery(request); * } * } * + *

======================= ConversationalSearchServiceClient ======================= + * + *

Service Description: Service for conversational search. + * + *

Sample for ConversationalSearchServiceClient: + * + *

{@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 (ConversationalSearchServiceClient conversationalSearchServiceClient =
+ *     ConversationalSearchServiceClient.create()) {
+ *   ConversationName name =
+ *       ConversationName.ofProjectLocationDataStoreConversationName(
+ *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]");
+ *   TextInput query = TextInput.newBuilder().build();
+ *   ConverseConversationResponse response =
+ *       conversationalSearchServiceClient.converseConversation(name, query);
+ * }
+ * }
+ * *

======================= DocumentServiceClient ======================= * *

Service Description: Service for ingesting @@ -111,10 +135,15 @@ * "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") * .toString()) * .setQuery("query107944136") + * .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setOffset(-1019779949) + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") * .setUserInfo(UserInfo.newBuilder().build()) + * .addAllFacetSpecs(new ArrayList()) + * .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) * .putAllParams(new HashMap()) * .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) * .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/ConversationalSearchServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/ConversationalSearchServiceStub.java new file mode 100644 index 000000000000..95255db1597c --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/ConversationalSearchServiceStub.java @@ -0,0 +1,77 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.stub; + +import static com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1.DeleteConversationRequest; +import com.google.cloud.discoveryengine.v1.GetConversationRequest; +import com.google.cloud.discoveryengine.v1.ListConversationsRequest; +import com.google.cloud.discoveryengine.v1.ListConversationsResponse; +import com.google.cloud.discoveryengine.v1.UpdateConversationRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ConversationalSearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ConversationalSearchServiceStub implements BackgroundResource { + + public UnaryCallable + converseConversationCallable() { + throw new UnsupportedOperationException("Not implemented: converseConversationCallable()"); + } + + public UnaryCallable createConversationCallable() { + throw new UnsupportedOperationException("Not implemented: createConversationCallable()"); + } + + public UnaryCallable deleteConversationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteConversationCallable()"); + } + + public UnaryCallable updateConversationCallable() { + throw new UnsupportedOperationException("Not implemented: updateConversationCallable()"); + } + + public UnaryCallable getConversationCallable() { + throw new UnsupportedOperationException("Not implemented: getConversationCallable()"); + } + + public UnaryCallable + listConversationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listConversationsPagedCallable()"); + } + + public UnaryCallable + listConversationsCallable() { + throw new UnsupportedOperationException("Not implemented: listConversationsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/ConversationalSearchServiceStubSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/ConversationalSearchServiceStubSettings.java new file mode 100644 index 000000000000..df9a2c405d3f --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/ConversationalSearchServiceStubSettings.java @@ -0,0 +1,542 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.stub; + +import static com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.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.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1.DeleteConversationRequest; +import com.google.cloud.discoveryengine.v1.GetConversationRequest; +import com.google.cloud.discoveryengine.v1.ListConversationsRequest; +import com.google.cloud.discoveryengine.v1.ListConversationsResponse; +import com.google.cloud.discoveryengine.v1.UpdateConversationRequest; +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.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ConversationalSearchServiceStub}. + * + *

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

    + *
  • The default service address (discoveryengine.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 converseConversation 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
+ * ConversationalSearchServiceStubSettings.Builder conversationalSearchServiceSettingsBuilder =
+ *     ConversationalSearchServiceStubSettings.newBuilder();
+ * conversationalSearchServiceSettingsBuilder
+ *     .converseConversationSettings()
+ *     .setRetrySettings(
+ *         conversationalSearchServiceSettingsBuilder
+ *             .converseConversationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConversationalSearchServiceStubSettings conversationalSearchServiceSettings =
+ *     conversationalSearchServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ConversationalSearchServiceStubSettings + 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 + converseConversationSettings; + private final UnaryCallSettings + createConversationSettings; + private final UnaryCallSettings deleteConversationSettings; + private final UnaryCallSettings + updateConversationSettings; + private final UnaryCallSettings getConversationSettings; + private final PagedCallSettings< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings; + + private static final PagedListDescriptor< + ListConversationsRequest, ListConversationsResponse, Conversation> + LIST_CONVERSATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListConversationsRequest, ListConversationsResponse, Conversation>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListConversationsRequest injectToken( + ListConversationsRequest payload, String token) { + return ListConversationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListConversationsRequest injectPageSize( + ListConversationsRequest payload, int pageSize) { + return ListConversationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListConversationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListConversationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListConversationsResponse payload) { + return payload.getConversationsList() == null + ? ImmutableList.of() + : payload.getConversationsList(); + } + }; + + private static final PagedListResponseFactory< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + LIST_CONVERSATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListConversationsRequest, + ListConversationsResponse, + ListConversationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListConversationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_CONVERSATIONS_PAGE_STR_DESC, request, context); + return ListConversationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to converseConversation. */ + public UnaryCallSettings + converseConversationSettings() { + return converseConversationSettings; + } + + /** Returns the object with the settings used for calls to createConversation. */ + public UnaryCallSettings createConversationSettings() { + return createConversationSettings; + } + + /** Returns the object with the settings used for calls to deleteConversation. */ + public UnaryCallSettings deleteConversationSettings() { + return deleteConversationSettings; + } + + /** Returns the object with the settings used for calls to updateConversation. */ + public UnaryCallSettings updateConversationSettings() { + return updateConversationSettings; + } + + /** Returns the object with the settings used for calls to getConversation. */ + public UnaryCallSettings getConversationSettings() { + return getConversationSettings; + } + + /** Returns the object with the settings used for calls to listConversations. */ + public PagedCallSettings< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings() { + return listConversationsSettings; + } + + public ConversationalSearchServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcConversationalSearchServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonConversationalSearchServiceStub.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 "discoveryengine.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "discoveryengine.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ConversationalSearchServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ConversationalSearchServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ConversationalSearchServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + converseConversationSettings = settingsBuilder.converseConversationSettings().build(); + createConversationSettings = settingsBuilder.createConversationSettings().build(); + deleteConversationSettings = settingsBuilder.deleteConversationSettings().build(); + updateConversationSettings = settingsBuilder.updateConversationSettings().build(); + getConversationSettings = settingsBuilder.getConversationSettings().build(); + listConversationsSettings = settingsBuilder.listConversationsSettings().build(); + } + + /** Builder for ConversationalSearchServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder< + ConverseConversationRequest, ConverseConversationResponse> + converseConversationSettings; + private final UnaryCallSettings.Builder + createConversationSettings; + private final UnaryCallSettings.Builder + deleteConversationSettings; + private final UnaryCallSettings.Builder + updateConversationSettings; + private final UnaryCallSettings.Builder + getConversationSettings; + private final PagedCallSettings.Builder< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(30000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + converseConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listConversationsSettings = PagedCallSettings.newBuilder(LIST_CONVERSATIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + converseConversationSettings, + createConversationSettings, + deleteConversationSettings, + updateConversationSettings, + getConversationSettings, + listConversationsSettings); + initDefaults(this); + } + + protected Builder(ConversationalSearchServiceStubSettings settings) { + super(settings); + + converseConversationSettings = settings.converseConversationSettings.toBuilder(); + createConversationSettings = settings.createConversationSettings.toBuilder(); + deleteConversationSettings = settings.deleteConversationSettings.toBuilder(); + updateConversationSettings = settings.updateConversationSettings.toBuilder(); + getConversationSettings = settings.getConversationSettings.toBuilder(); + listConversationsSettings = settings.listConversationsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + converseConversationSettings, + createConversationSettings, + deleteConversationSettings, + updateConversationSettings, + getConversationSettings, + listConversationsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .converseConversationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createConversationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteConversationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateConversationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getConversationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listConversationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_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 converseConversation. */ + public UnaryCallSettings.Builder + converseConversationSettings() { + return converseConversationSettings; + } + + /** Returns the builder for the settings used for calls to createConversation. */ + public UnaryCallSettings.Builder + createConversationSettings() { + return createConversationSettings; + } + + /** Returns the builder for the settings used for calls to deleteConversation. */ + public UnaryCallSettings.Builder + deleteConversationSettings() { + return deleteConversationSettings; + } + + /** Returns the builder for the settings used for calls to updateConversation. */ + public UnaryCallSettings.Builder + updateConversationSettings() { + return updateConversationSettings; + } + + /** Returns the builder for the settings used for calls to getConversation. */ + public UnaryCallSettings.Builder + getConversationSettings() { + return getConversationSettings; + } + + /** Returns the builder for the settings used for calls to listConversations. */ + public PagedCallSettings.Builder< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings() { + return listConversationsSettings; + } + + @Override + public ConversationalSearchServiceStubSettings build() throws IOException { + return new ConversationalSearchServiceStubSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/GrpcConversationalSearchServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/GrpcConversationalSearchServiceCallableFactory.java new file mode 100644 index 000000000000..4df5265a7c0c --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/GrpcConversationalSearchServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.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 ConversationalSearchService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcConversationalSearchServiceCallableFactory 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-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/GrpcConversationalSearchServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/GrpcConversationalSearchServiceStub.java new file mode 100644 index 000000000000..5bbb8117ba04 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/GrpcConversationalSearchServiceStub.java @@ -0,0 +1,358 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.stub; + +import static com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1.DeleteConversationRequest; +import com.google.cloud.discoveryengine.v1.GetConversationRequest; +import com.google.cloud.discoveryengine.v1.ListConversationsRequest; +import com.google.cloud.discoveryengine.v1.ListConversationsResponse; +import com.google.cloud.discoveryengine.v1.UpdateConversationRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the ConversationalSearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcConversationalSearchServiceStub extends ConversationalSearchServiceStub { + private static final MethodDescriptor + converseConversationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/ConverseConversation") + .setRequestMarshaller( + ProtoUtils.marshaller(ConverseConversationRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ConverseConversationResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createConversationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/CreateConversation") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateConversationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Conversation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteConversationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/DeleteConversation") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteConversationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateConversationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/UpdateConversation") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateConversationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Conversation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getConversationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/GetConversation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConversationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Conversation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listConversationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/ListConversations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListConversationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListConversationsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + converseConversationCallable; + private final UnaryCallable createConversationCallable; + private final UnaryCallable deleteConversationCallable; + private final UnaryCallable updateConversationCallable; + private final UnaryCallable getConversationCallable; + private final UnaryCallable + listConversationsCallable; + private final UnaryCallable + listConversationsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcConversationalSearchServiceStub create( + ConversationalSearchServiceStubSettings settings) throws IOException { + return new GrpcConversationalSearchServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcConversationalSearchServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcConversationalSearchServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcConversationalSearchServiceStub, 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 GrpcConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcConversationalSearchServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcConversationalSearchServiceStub, 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 GrpcConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + converseConversationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(converseConversationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createConversationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createConversationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteConversationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteConversationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateConversationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateConversationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "conversation.name", String.valueOf(request.getConversation().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getConversationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConversationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listConversationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listConversationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.converseConversationCallable = + callableFactory.createUnaryCallable( + converseConversationTransportSettings, + settings.converseConversationSettings(), + clientContext); + this.createConversationCallable = + callableFactory.createUnaryCallable( + createConversationTransportSettings, + settings.createConversationSettings(), + clientContext); + this.deleteConversationCallable = + callableFactory.createUnaryCallable( + deleteConversationTransportSettings, + settings.deleteConversationSettings(), + clientContext); + this.updateConversationCallable = + callableFactory.createUnaryCallable( + updateConversationTransportSettings, + settings.updateConversationSettings(), + clientContext); + this.getConversationCallable = + callableFactory.createUnaryCallable( + getConversationTransportSettings, settings.getConversationSettings(), clientContext); + this.listConversationsCallable = + callableFactory.createUnaryCallable( + listConversationsTransportSettings, + settings.listConversationsSettings(), + clientContext); + this.listConversationsPagedCallable = + callableFactory.createPagedCallable( + listConversationsTransportSettings, + settings.listConversationsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + converseConversationCallable() { + return converseConversationCallable; + } + + @Override + public UnaryCallable createConversationCallable() { + return createConversationCallable; + } + + @Override + public UnaryCallable deleteConversationCallable() { + return deleteConversationCallable; + } + + @Override + public UnaryCallable updateConversationCallable() { + return updateConversationCallable; + } + + @Override + public UnaryCallable getConversationCallable() { + return getConversationCallable; + } + + @Override + public UnaryCallable + listConversationsCallable() { + return listConversationsCallable; + } + + @Override + public UnaryCallable + listConversationsPagedCallable() { + return listConversationsPagedCallable; + } + + @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-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonCompletionServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonCompletionServiceStub.java index c1f173cc50bd..cdeef2f1dcf1 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonCompletionServiceStub.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonCompletionServiceStub.java @@ -75,6 +75,10 @@ public class HttpJsonCompletionServiceStub extends CompletionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, + "includeTailSuggestions", + request.getIncludeTailSuggestions()); serializer.putQueryParam(fields, "query", request.getQuery()); serializer.putQueryParam(fields, "queryModel", request.getQueryModel()); serializer.putQueryParam( diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonConversationalSearchServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonConversationalSearchServiceCallableFactory.java new file mode 100644 index 000000000000..eca5951212d9 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonConversationalSearchServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the ConversationalSearchService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonConversationalSearchServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonConversationalSearchServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonConversationalSearchServiceStub.java new file mode 100644 index 000000000000..0c4ecc31e588 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonConversationalSearchServiceStub.java @@ -0,0 +1,555 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.stub; + +import static com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1.DeleteConversationRequest; +import com.google.cloud.discoveryengine.v1.GetConversationRequest; +import com.google.cloud.discoveryengine.v1.ListConversationsRequest; +import com.google.cloud.discoveryengine.v1.ListConversationsResponse; +import com.google.cloud.discoveryengine.v1.UpdateConversationRequest; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the ConversationalSearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonConversationalSearchServiceStub extends ConversationalSearchServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor< + ConverseConversationRequest, ConverseConversationResponse> + converseConversationMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/ConverseConversation") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}:converse", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}:converse") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ConverseConversationResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createConversationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/CreateConversation") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/dataStores/*}/conversations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("conversation", request.getConversation(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Conversation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteConversationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/DeleteConversation") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateConversationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/UpdateConversation") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{conversation.name=projects/*/locations/*/dataStores/*/conversations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "conversation.name", request.getConversation().getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{conversation.name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("conversation", request.getConversation(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Conversation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getConversationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/GetConversation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Conversation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listConversationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1.ConversationalSearchService/ListConversations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/dataStores/*}/conversations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListConversationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + converseConversationCallable; + private final UnaryCallable createConversationCallable; + private final UnaryCallable deleteConversationCallable; + private final UnaryCallable updateConversationCallable; + private final UnaryCallable getConversationCallable; + private final UnaryCallable + listConversationsCallable; + private final UnaryCallable + listConversationsPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonConversationalSearchServiceStub create( + ConversationalSearchServiceStubSettings settings) throws IOException { + return new HttpJsonConversationalSearchServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonConversationalSearchServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonConversationalSearchServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonConversationalSearchServiceStub, 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 HttpJsonConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonConversationalSearchServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonConversationalSearchServiceStub, 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 HttpJsonConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + converseConversationTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(converseConversationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + createConversationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createConversationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteConversationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteConversationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + updateConversationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateConversationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "conversation.name", String.valueOf(request.getConversation().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getConversationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getConversationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listConversationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listConversationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.converseConversationCallable = + callableFactory.createUnaryCallable( + converseConversationTransportSettings, + settings.converseConversationSettings(), + clientContext); + this.createConversationCallable = + callableFactory.createUnaryCallable( + createConversationTransportSettings, + settings.createConversationSettings(), + clientContext); + this.deleteConversationCallable = + callableFactory.createUnaryCallable( + deleteConversationTransportSettings, + settings.deleteConversationSettings(), + clientContext); + this.updateConversationCallable = + callableFactory.createUnaryCallable( + updateConversationTransportSettings, + settings.updateConversationSettings(), + clientContext); + this.getConversationCallable = + callableFactory.createUnaryCallable( + getConversationTransportSettings, settings.getConversationSettings(), clientContext); + this.listConversationsCallable = + callableFactory.createUnaryCallable( + listConversationsTransportSettings, + settings.listConversationsSettings(), + clientContext); + this.listConversationsPagedCallable = + callableFactory.createPagedCallable( + listConversationsTransportSettings, + settings.listConversationsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(converseConversationMethodDescriptor); + methodDescriptors.add(createConversationMethodDescriptor); + methodDescriptors.add(deleteConversationMethodDescriptor); + methodDescriptors.add(updateConversationMethodDescriptor); + methodDescriptors.add(getConversationMethodDescriptor); + methodDescriptors.add(listConversationsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + converseConversationCallable() { + return converseConversationCallable; + } + + @Override + public UnaryCallable createConversationCallable() { + return createConversationCallable; + } + + @Override + public UnaryCallable deleteConversationCallable() { + return deleteConversationCallable; + } + + @Override + public UnaryCallable updateConversationCallable() { + return updateConversationCallable; + } + + @Override + public UnaryCallable getConversationCallable() { + return getConversationCallable; + } + + @Override + public UnaryCallable + listConversationsCallable() { + return listConversationsCallable; + } + + @Override + public UnaryCallable + listConversationsPagedCallable() { + return listConversationsPagedCallable; + } + + @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-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonDocumentServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonDocumentServiceStub.java index a15d26405843..1165b4e1e325 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonDocumentServiceStub.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonDocumentServiceStub.java @@ -441,6 +441,21 @@ protected HttpJsonDocumentServiceStub( .setGet( "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet( @@ -489,11 +504,26 @@ protected HttpJsonDocumentServiceStub( .setGet( "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet( "/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet( diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonSchemaServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonSchemaServiceStub.java index f44b48fd266d..ea9240cc5e49 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonSchemaServiceStub.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonSchemaServiceStub.java @@ -361,6 +361,21 @@ protected HttpJsonSchemaServiceStub( .setGet( "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet( @@ -409,11 +424,26 @@ protected HttpJsonSchemaServiceStub( .setGet( "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet( "/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet( diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonUserEventServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonUserEventServiceStub.java index 378fc1f7e577..ce187ae768ef 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonUserEventServiceStub.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1/stub/HttpJsonUserEventServiceStub.java @@ -271,6 +271,21 @@ protected HttpJsonUserEventServiceStub( .setGet( "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/engines/*/operations/*}") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet( @@ -319,11 +334,26 @@ protected HttpJsonUserEventServiceStub( .setGet( "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet( "/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/collections/*/engines/*}/operations") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet( diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClient.java index b750b657951d..e517119424a0 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClient.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClient.java @@ -295,6 +295,8 @@ public final ConverseConversationResponse converseConversation(String name, Text * .toString()) * .setConversation(Conversation.newBuilder().build()) * .setSafeSearch(true) + * .putAllUserLabels(new HashMap()) + * .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build()) * .build(); * ConverseConversationResponse response = * conversationalSearchServiceClient.converseConversation(request); @@ -336,6 +338,8 @@ public final ConverseConversationResponse converseConversation( * .toString()) * .setConversation(Conversation.newBuilder().build()) * .setSafeSearch(true) + * .putAllUserLabels(new HashMap()) + * .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build()) * .build(); * ApiFuture future = * conversationalSearchServiceClient.converseConversationCallable().futureCall(request); diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClient.java index 3354a1923c57..2dcad246bfe8 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClient.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClient.java @@ -72,6 +72,8 @@ * .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) * .setUserPseudoId("userPseudoId-1155274652") * .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + * .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + * .setRankingExpression("rankingExpression2110320494") * .setSafeSearch(true) * .putAllUserLabels(new HashMap()) * .build(); @@ -240,6 +242,8 @@ public SearchServiceStub getStub() { * .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) * .setUserPseudoId("userPseudoId-1155274652") * .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + * .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + * .setRankingExpression("rankingExpression2110320494") * .setSafeSearch(true) * .putAllUserLabels(new HashMap()) * .build(); @@ -294,6 +298,8 @@ public final SearchPagedResponse search(SearchRequest request) { * .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) * .setUserPseudoId("userPseudoId-1155274652") * .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + * .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + * .setRankingExpression("rankingExpression2110320494") * .setSafeSearch(true) * .putAllUserLabels(new HashMap()) * .build(); @@ -348,6 +354,8 @@ public final UnaryCallable searchPagedCallab * .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) * .setUserPseudoId("userPseudoId-1155274652") * .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + * .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + * .setRankingExpression("rankingExpression2110320494") * .setSafeSearch(true) * .putAllUserLabels(new HashMap()) * .build(); diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/package-info.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/package-info.java index 5cc41a567b97..d689a5836bf8 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/package-info.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1beta/package-info.java @@ -181,6 +181,8 @@ * .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) * .setUserPseudoId("userPseudoId-1155274652") * .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + * .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + * .setRankingExpression("rankingExpression2110320494") * .setSafeSearch(true) * .putAllUserLabels(new HashMap()) * .build(); diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1/reflect-config.json b/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1/reflect-config.json index 540910dada13..6f942913ca6f 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1/reflect-config.json +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1/reflect-config.json @@ -503,6 +503,123 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1.Conversation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.Conversation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.Conversation$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ConversationContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ConversationContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ConversationMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ConversationMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ConverseConversationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ConverseConversationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ConverseConversationResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ConverseConversationResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.CreateConversationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.CreateConversationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1.CreateDocumentRequest", "queryAllDeclaredConstructors": true, @@ -575,6 +692,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1.DeleteConversationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.DeleteConversationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1.DeleteDocumentRequest", "queryAllDeclaredConstructors": true, @@ -701,6 +836,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1.GetConversationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.GetConversationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1.GetDocumentRequest", "queryAllDeclaredConstructors": true, @@ -908,6 +1061,60 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1.Interval", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.Interval$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ListConversationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ListConversationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ListConversationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.ListConversationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1.ListDocumentsRequest", "queryAllDeclaredConstructors": true, @@ -1088,6 +1295,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1.Reply", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.Reply$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1.Schema", "queryAllDeclaredConstructors": true, @@ -1133,6 +1358,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$BoostSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$BoostSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$BoostSpec$ConditionBoostSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$BoostSpec$ConditionBoostSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1.SearchRequest$Builder", "queryAllDeclaredConstructors": true, @@ -1178,6 +1439,78 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$ContentSearchSpec$SummarySpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$ContentSearchSpec$SummarySpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$FacetSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$FacetSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$FacetSpec$FacetKey", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$FacetSpec$FacetKey$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$ImageQuery", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchRequest$ImageQuery$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1.SearchRequest$QueryExpansionSpec", "queryAllDeclaredConstructors": true, @@ -1250,6 +1583,60 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$Facet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$Facet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$Facet$FacetValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$Facet$FacetValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$QueryExpansionInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$QueryExpansionInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1.SearchResponse$SearchResult", "queryAllDeclaredConstructors": true, @@ -1268,6 +1655,69 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$Summary", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$Summary$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$Summary$SafetyAttributes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$Summary$SafetyAttributes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.SearchResponse$Summary$SummarySkippedReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.TextInput", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.TextInput$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1.TransactionInfo", "queryAllDeclaredConstructors": true, @@ -1286,6 +1736,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1.UpdateConversationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1.UpdateConversationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1.UpdateDocumentRequest", "queryAllDeclaredConstructors": true, @@ -2186,6 +2654,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.protobuf.ListValue", "queryAllDeclaredConstructors": true, diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1beta/reflect-config.json b/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1beta/reflect-config.json index 25f642f1094a..d0003003a411 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1beta/reflect-config.json +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1beta/reflect-config.json @@ -818,6 +818,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1beta.DoubleList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1beta.DoubleList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1beta.GcsSource", "queryAllDeclaredConstructors": true, @@ -1547,6 +1565,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1beta.SearchRequest$EmbeddingSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1beta.SearchRequest$EmbeddingSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1beta.SearchRequest$EmbeddingSpec$EmbeddingVector", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1beta.SearchRequest$EmbeddingSpec$EmbeddingVector$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1beta.SearchRequest$FacetSpec", "queryAllDeclaredConstructors": true, @@ -1745,6 +1799,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1beta.SearchResponse$QueryExpansionInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1beta.SearchResponse$QueryExpansionInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1beta.SearchResponse$SearchResult", "queryAllDeclaredConstructors": true, @@ -1781,6 +1853,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.discoveryengine.v1beta.SearchResponse$Summary$SafetyAttributes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1beta.SearchResponse$Summary$SafetyAttributes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.discoveryengine.v1beta.SearchResponse$Summary$SummarySkippedReason", "queryAllDeclaredConstructors": true, diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/CompletionServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/CompletionServiceClientHttpJsonTest.java index 328b807f3bf4..127b3e2fa7d4 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/CompletionServiceClientHttpJsonTest.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/CompletionServiceClientHttpJsonTest.java @@ -77,6 +77,7 @@ public void completeQueryTest() throws Exception { CompleteQueryResponse expectedResponse = CompleteQueryResponse.newBuilder() .addAllQuerySuggestions(new ArrayList()) + .setTailMatchTriggered(true) .build(); mockService.addResponse(expectedResponse); @@ -89,6 +90,7 @@ public void completeQueryTest() throws Exception { .setQuery("query107944136") .setQueryModel("queryModel-184930495") .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) .build(); CompleteQueryResponse actualResponse = client.completeQuery(request); @@ -126,6 +128,7 @@ public void completeQueryExceptionTest() throws Exception { .setQuery("query107944136") .setQueryModel("queryModel-184930495") .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) .build(); client.completeQuery(request); Assert.fail("No exception raised"); diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/CompletionServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/CompletionServiceClientTest.java index 7f991e645d8b..012f001da0eb 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/CompletionServiceClientTest.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/CompletionServiceClientTest.java @@ -81,6 +81,7 @@ public void completeQueryTest() throws Exception { CompleteQueryResponse expectedResponse = CompleteQueryResponse.newBuilder() .addAllQuerySuggestions(new ArrayList()) + .setTailMatchTriggered(true) .build(); mockCompletionService.addResponse(expectedResponse); @@ -93,6 +94,7 @@ public void completeQueryTest() throws Exception { .setQuery("query107944136") .setQueryModel("queryModel-184930495") .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) .build(); CompleteQueryResponse actualResponse = client.completeQuery(request); @@ -106,6 +108,8 @@ public void completeQueryTest() throws Exception { Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); Assert.assertEquals(request.getQueryModel(), actualRequest.getQueryModel()); Assert.assertEquals(request.getUserPseudoId(), actualRequest.getUserPseudoId()); + Assert.assertEquals( + request.getIncludeTailSuggestions(), actualRequest.getIncludeTailSuggestions()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -127,6 +131,7 @@ public void completeQueryExceptionTest() throws Exception { .setQuery("query107944136") .setQueryModel("queryModel-184930495") .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) .build(); client.completeQuery(request); Assert.fail("No exception raised"); diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..8210f52303b9 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceClientHttpJsonTest.java @@ -0,0 +1,660 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1; + +import static com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.discoveryengine.v1.stub.HttpJsonConversationalSearchServiceStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ConversationalSearchServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static ConversationalSearchServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonConversationalSearchServiceStub.getMethodDescriptors(), + ConversationalSearchServiceSettings.getDefaultEndpoint()); + ConversationalSearchServiceSettings settings = + ConversationalSearchServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ConversationalSearchServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConversationalSearchServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void converseConversationTest() throws Exception { + ConverseConversationResponse expectedResponse = + ConverseConversationResponse.newBuilder() + .setReply(Reply.newBuilder().build()) + .setConversation(Conversation.newBuilder().build()) + .addAllSearchResults(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + TextInput query = TextInput.newBuilder().build(); + + ConverseConversationResponse actualResponse = client.converseConversation(name, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void converseConversationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + TextInput query = TextInput.newBuilder().build(); + client.converseConversation(name, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void converseConversationTest2() throws Exception { + ConverseConversationResponse expectedResponse = + ConverseConversationResponse.newBuilder() + .setReply(Reply.newBuilder().build()) + .setConversation(Conversation.newBuilder().build()) + .addAllSearchResults(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + TextInput query = TextInput.newBuilder().build(); + + ConverseConversationResponse actualResponse = client.converseConversation(name, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void converseConversationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + TextInput query = TextInput.newBuilder().build(); + client.converseConversation(name, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Conversation conversation = Conversation.newBuilder().build(); + + Conversation actualResponse = client.createConversation(parent, conversation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createConversationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Conversation conversation = Conversation.newBuilder().build(); + client.createConversation(parent, conversation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createConversationTest2() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + Conversation conversation = Conversation.newBuilder().build(); + + Conversation actualResponse = client.createConversation(parent, conversation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createConversationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + Conversation conversation = Conversation.newBuilder().build(); + client.createConversation(parent, conversation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversationTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + + client.deleteConversation(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteConversationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + client.deleteConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversationTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + + client.deleteConversation(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteConversationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + client.deleteConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + Conversation conversation = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Conversation actualResponse = client.updateConversation(conversation, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateConversationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Conversation conversation = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateConversation(conversation, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + + Conversation actualResponse = client.getConversation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getConversationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + client.getConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversationTest2() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + + Conversation actualResponse = client.getConversation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getConversationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + client.getConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversationsTest() throws Exception { + Conversation responsesElement = Conversation.newBuilder().build(); + ListConversationsResponse expectedResponse = + ListConversationsResponse.newBuilder() + .setNextPageToken("") + .addAllConversations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + + ListConversationsPagedResponse pagedListResponse = client.listConversations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listConversationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + client.listConversations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversationsTest2() throws Exception { + Conversation responsesElement = Conversation.newBuilder().build(); + ListConversationsResponse expectedResponse = + ListConversationsResponse.newBuilder() + .setNextPageToken("") + .addAllConversations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + + ListConversationsPagedResponse pagedListResponse = client.listConversations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listConversationsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + client.listConversations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceClientTest.java new file mode 100644 index 000000000000..01fa068b34dd --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceClientTest.java @@ -0,0 +1,579 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1; + +import static com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.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 ConversationalSearchServiceClientTest { + private static MockConversationalSearchService mockConversationalSearchService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ConversationalSearchServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockConversationalSearchService = new MockConversationalSearchService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockConversationalSearchService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ConversationalSearchServiceSettings settings = + ConversationalSearchServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConversationalSearchServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void converseConversationTest() throws Exception { + ConverseConversationResponse expectedResponse = + ConverseConversationResponse.newBuilder() + .setReply(Reply.newBuilder().build()) + .setConversation(Conversation.newBuilder().build()) + .addAllSearchResults(new ArrayList()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + TextInput query = TextInput.newBuilder().build(); + + ConverseConversationResponse actualResponse = client.converseConversation(name, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ConverseConversationRequest actualRequest = + ((ConverseConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void converseConversationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + TextInput query = TextInput.newBuilder().build(); + client.converseConversation(name, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void converseConversationTest2() throws Exception { + ConverseConversationResponse expectedResponse = + ConverseConversationResponse.newBuilder() + .setReply(Reply.newBuilder().build()) + .setConversation(Conversation.newBuilder().build()) + .addAllSearchResults(new ArrayList()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + String name = "name3373707"; + TextInput query = TextInput.newBuilder().build(); + + ConverseConversationResponse actualResponse = client.converseConversation(name, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ConverseConversationRequest actualRequest = + ((ConverseConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void converseConversationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + String name = "name3373707"; + TextInput query = TextInput.newBuilder().build(); + client.converseConversation(name, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Conversation conversation = Conversation.newBuilder().build(); + + Conversation actualResponse = client.createConversation(parent, conversation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConversationRequest actualRequest = ((CreateConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(conversation, actualRequest.getConversation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createConversationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Conversation conversation = Conversation.newBuilder().build(); + client.createConversation(parent, conversation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createConversationTest2() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Conversation conversation = Conversation.newBuilder().build(); + + Conversation actualResponse = client.createConversation(parent, conversation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConversationRequest actualRequest = ((CreateConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(conversation, actualRequest.getConversation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createConversationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + String parent = "parent-995424086"; + Conversation conversation = Conversation.newBuilder().build(); + client.createConversation(parent, conversation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversationTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConversationalSearchService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + + client.deleteConversation(name); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConversationRequest actualRequest = ((DeleteConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteConversationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + client.deleteConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversationTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConversationalSearchService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteConversation(name); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConversationRequest actualRequest = ((DeleteConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteConversationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + String name = "name3373707"; + client.deleteConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + Conversation conversation = Conversation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Conversation actualResponse = client.updateConversation(conversation, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateConversationRequest actualRequest = ((UpdateConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(conversation, actualRequest.getConversation()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateConversationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + Conversation conversation = Conversation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateConversation(conversation, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + + Conversation actualResponse = client.getConversation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConversationRequest actualRequest = ((GetConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConversationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + client.getConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversationTest2() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + String name = "name3373707"; + + Conversation actualResponse = client.getConversation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConversationRequest actualRequest = ((GetConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConversationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + String name = "name3373707"; + client.getConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversationsTest() throws Exception { + Conversation responsesElement = Conversation.newBuilder().build(); + ListConversationsResponse expectedResponse = + ListConversationsResponse.newBuilder() + .setNextPageToken("") + .addAllConversations(Arrays.asList(responsesElement)) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + + ListConversationsPagedResponse pagedListResponse = client.listConversations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversationsList().get(0), resources.get(0)); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConversationsRequest actualRequest = ((ListConversationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listConversationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + client.listConversations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversationsTest2() throws Exception { + Conversation responsesElement = Conversation.newBuilder().build(); + ListConversationsResponse expectedResponse = + ListConversationsResponse.newBuilder() + .setNextPageToken("") + .addAllConversations(Arrays.asList(responsesElement)) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListConversationsPagedResponse pagedListResponse = client.listConversations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversationsList().get(0), resources.get(0)); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConversationsRequest actualRequest = ((ListConversationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listConversationsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listConversations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/MockConversationalSearchService.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/MockConversationalSearchService.java new file mode 100644 index 000000000000..ff41cdb105f5 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/MockConversationalSearchService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.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 MockConversationalSearchService implements MockGrpcService { + private final MockConversationalSearchServiceImpl serviceImpl; + + public MockConversationalSearchService() { + serviceImpl = new MockConversationalSearchServiceImpl(); + } + + @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-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/MockConversationalSearchServiceImpl.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/MockConversationalSearchServiceImpl.java new file mode 100644 index 000000000000..868959a791e9 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/MockConversationalSearchServiceImpl.java @@ -0,0 +1,189 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceGrpc.ConversationalSearchServiceImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +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 MockConversationalSearchServiceImpl extends ConversationalSearchServiceImplBase { + private List requests; + private Queue responses; + + public MockConversationalSearchServiceImpl() { + 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 converseConversation( + ConverseConversationRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConverseConversationResponse) { + requests.add(request); + responseObserver.onNext(((ConverseConversationResponse) 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 ConverseConversation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ConverseConversationResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createConversation( + CreateConversationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Conversation) { + requests.add(request); + responseObserver.onNext(((Conversation) 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 CreateConversation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Conversation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteConversation( + DeleteConversationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteConversation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateConversation( + UpdateConversationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Conversation) { + requests.add(request); + responseObserver.onNext(((Conversation) 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 UpdateConversation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Conversation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getConversation( + GetConversationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Conversation) { + requests.add(request); + responseObserver.onNext(((Conversation) 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 GetConversation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Conversation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listConversations( + ListConversationsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListConversationsResponse) { + requests.add(request); + responseObserver.onNext(((ListConversationsResponse) 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 ListConversations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListConversationsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/SearchServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/SearchServiceClientHttpJsonTest.java index 04fe2cf363ea..eb1ff47dc159 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/SearchServiceClientHttpJsonTest.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/SearchServiceClientHttpJsonTest.java @@ -31,6 +31,7 @@ import com.google.common.collect.Lists; import com.google.protobuf.Value; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -98,10 +99,15 @@ public void searchTest() throws Exception { "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") .toString()) .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) .putAllParams(new HashMap()) .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) @@ -153,10 +159,15 @@ public void searchExceptionTest() throws Exception { "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") .toString()) .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) .putAllParams(new HashMap()) .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/SearchServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/SearchServiceClientTest.java index 3f4a19f0bb99..fbe9cf86a451 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/SearchServiceClientTest.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1/SearchServiceClientTest.java @@ -30,6 +30,7 @@ import com.google.protobuf.Value; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -101,10 +102,15 @@ public void searchTest() throws Exception { "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") .toString()) .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) .putAllParams(new HashMap()) .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) @@ -129,10 +135,15 @@ public void searchTest() throws Exception { Assert.assertEquals(request.getServingConfig(), actualRequest.getServingConfig()); Assert.assertEquals(request.getBranch(), actualRequest.getBranch()); Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getImageQuery(), actualRequest.getImageQuery()); Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); Assert.assertEquals(request.getOffset(), actualRequest.getOffset()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getOrderBy(), actualRequest.getOrderBy()); Assert.assertEquals(request.getUserInfo(), actualRequest.getUserInfo()); + Assert.assertEquals(request.getFacetSpecsList(), actualRequest.getFacetSpecsList()); + Assert.assertEquals(request.getBoostSpec(), actualRequest.getBoostSpec()); Assert.assertEquals(request.getParamsMap(), actualRequest.getParamsMap()); Assert.assertEquals(request.getQueryExpansionSpec(), actualRequest.getQueryExpansionSpec()); Assert.assertEquals(request.getSpellCorrectionSpec(), actualRequest.getSpellCorrectionSpec()); @@ -163,10 +174,15 @@ public void searchExceptionTest() throws Exception { "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") .toString()) .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) .putAllParams(new HashMap()) .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClientHttpJsonTest.java index 93804f83da5f..2ed0953d7776 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClientHttpJsonTest.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClientHttpJsonTest.java @@ -85,6 +85,7 @@ public void converseConversationTest() throws Exception { ConverseConversationResponse.newBuilder() .setReply(Reply.newBuilder().build()) .setConversation(Conversation.newBuilder().build()) + .addAllRelatedQuestions(new ArrayList()) .addAllSearchResults(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -137,6 +138,7 @@ public void converseConversationTest2() throws Exception { ConverseConversationResponse.newBuilder() .setReply(Reply.newBuilder().build()) .setConversation(Conversation.newBuilder().build()) + .addAllRelatedQuestions(new ArrayList()) .addAllSearchResults(new ArrayList()) .build(); mockService.addResponse(expectedResponse); diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClientTest.java index 6bb1b15fefa0..fc1eb4a4c52b 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClientTest.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceClientTest.java @@ -89,6 +89,7 @@ public void converseConversationTest() throws Exception { ConverseConversationResponse.newBuilder() .setReply(Reply.newBuilder().build()) .setConversation(Conversation.newBuilder().build()) + .addAllRelatedQuestions(new ArrayList()) .addAllSearchResults(new ArrayList()) .build(); mockConversationalSearchService.addResponse(expectedResponse); @@ -137,6 +138,7 @@ public void converseConversationTest2() throws Exception { ConverseConversationResponse.newBuilder() .setReply(Reply.newBuilder().build()) .setConversation(Conversation.newBuilder().build()) + .addAllRelatedQuestions(new ArrayList()) .addAllSearchResults(new ArrayList()) .build(); mockConversationalSearchService.addResponse(expectedResponse); diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClientHttpJsonTest.java index ac5498da0153..72fccfec53fd 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClientHttpJsonTest.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClientHttpJsonTest.java @@ -113,6 +113,8 @@ public void searchTest() throws Exception { .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) .setUserPseudoId("userPseudoId-1155274652") .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") .setSafeSearch(true) .putAllUserLabels(new HashMap()) .build(); @@ -173,6 +175,8 @@ public void searchExceptionTest() throws Exception { .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) .setUserPseudoId("userPseudoId-1155274652") .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") .setSafeSearch(true) .putAllUserLabels(new HashMap()) .build(); diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClientTest.java index 996e22bd59c2..c5d12f5836d6 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClientTest.java +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1beta/SearchServiceClientTest.java @@ -116,6 +116,8 @@ public void searchTest() throws Exception { .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) .setUserPseudoId("userPseudoId-1155274652") .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") .setSafeSearch(true) .putAllUserLabels(new HashMap()) .build(); @@ -149,6 +151,8 @@ public void searchTest() throws Exception { Assert.assertEquals(request.getSpellCorrectionSpec(), actualRequest.getSpellCorrectionSpec()); Assert.assertEquals(request.getUserPseudoId(), actualRequest.getUserPseudoId()); Assert.assertEquals(request.getContentSearchSpec(), actualRequest.getContentSearchSpec()); + Assert.assertEquals(request.getEmbeddingSpec(), actualRequest.getEmbeddingSpec()); + Assert.assertEquals(request.getRankingExpression(), actualRequest.getRankingExpression()); Assert.assertEquals(request.getSafeSearch(), actualRequest.getSafeSearch()); Assert.assertEquals(request.getUserLabelsMap(), actualRequest.getUserLabelsMap()); Assert.assertTrue( @@ -188,6 +192,8 @@ public void searchExceptionTest() throws Exception { .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) .setUserPseudoId("userPseudoId-1155274652") .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") .setSafeSearch(true) .putAllUserLabels(new HashMap()) .build(); diff --git a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceGrpc.java b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceGrpc.java new file mode 100644 index 000000000000..d056a6b9273f --- /dev/null +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceGrpc.java @@ -0,0 +1,1047 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.discoveryengine.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for conversational search.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/discoveryengine/v1/conversational_search_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ConversationalSearchServiceGrpc { + + private ConversationalSearchServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.discoveryengine.v1.ConversationalSearchService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.ConverseConversationRequest, + com.google.cloud.discoveryengine.v1.ConverseConversationResponse> + getConverseConversationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ConverseConversation", + requestType = com.google.cloud.discoveryengine.v1.ConverseConversationRequest.class, + responseType = com.google.cloud.discoveryengine.v1.ConverseConversationResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.ConverseConversationRequest, + com.google.cloud.discoveryengine.v1.ConverseConversationResponse> + getConverseConversationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.ConverseConversationRequest, + com.google.cloud.discoveryengine.v1.ConverseConversationResponse> + getConverseConversationMethod; + if ((getConverseConversationMethod = + ConversationalSearchServiceGrpc.getConverseConversationMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getConverseConversationMethod = + ConversationalSearchServiceGrpc.getConverseConversationMethod) + == null) { + ConversationalSearchServiceGrpc.getConverseConversationMethod = + getConverseConversationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ConverseConversation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.ConverseConversationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.ConverseConversationResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "ConverseConversation")) + .build(); + } + } + } + return getConverseConversationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.CreateConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation> + getCreateConversationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateConversation", + requestType = com.google.cloud.discoveryengine.v1.CreateConversationRequest.class, + responseType = com.google.cloud.discoveryengine.v1.Conversation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.CreateConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation> + getCreateConversationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.CreateConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation> + getCreateConversationMethod; + if ((getCreateConversationMethod = ConversationalSearchServiceGrpc.getCreateConversationMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getCreateConversationMethod = + ConversationalSearchServiceGrpc.getCreateConversationMethod) + == null) { + ConversationalSearchServiceGrpc.getCreateConversationMethod = + getCreateConversationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateConversation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.CreateConversationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.Conversation + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "CreateConversation")) + .build(); + } + } + } + return getCreateConversationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.DeleteConversationRequest, com.google.protobuf.Empty> + getDeleteConversationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteConversation", + requestType = com.google.cloud.discoveryengine.v1.DeleteConversationRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.DeleteConversationRequest, com.google.protobuf.Empty> + getDeleteConversationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.DeleteConversationRequest, + com.google.protobuf.Empty> + getDeleteConversationMethod; + if ((getDeleteConversationMethod = ConversationalSearchServiceGrpc.getDeleteConversationMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getDeleteConversationMethod = + ConversationalSearchServiceGrpc.getDeleteConversationMethod) + == null) { + ConversationalSearchServiceGrpc.getDeleteConversationMethod = + getDeleteConversationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteConversation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.DeleteConversationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "DeleteConversation")) + .build(); + } + } + } + return getDeleteConversationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.UpdateConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation> + getUpdateConversationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateConversation", + requestType = com.google.cloud.discoveryengine.v1.UpdateConversationRequest.class, + responseType = com.google.cloud.discoveryengine.v1.Conversation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.UpdateConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation> + getUpdateConversationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.UpdateConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation> + getUpdateConversationMethod; + if ((getUpdateConversationMethod = ConversationalSearchServiceGrpc.getUpdateConversationMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getUpdateConversationMethod = + ConversationalSearchServiceGrpc.getUpdateConversationMethod) + == null) { + ConversationalSearchServiceGrpc.getUpdateConversationMethod = + getUpdateConversationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateConversation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.UpdateConversationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.Conversation + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "UpdateConversation")) + .build(); + } + } + } + return getUpdateConversationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.GetConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation> + getGetConversationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConversation", + requestType = com.google.cloud.discoveryengine.v1.GetConversationRequest.class, + responseType = com.google.cloud.discoveryengine.v1.Conversation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.GetConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation> + getGetConversationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.GetConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation> + getGetConversationMethod; + if ((getGetConversationMethod = ConversationalSearchServiceGrpc.getGetConversationMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getGetConversationMethod = ConversationalSearchServiceGrpc.getGetConversationMethod) + == null) { + ConversationalSearchServiceGrpc.getGetConversationMethod = + getGetConversationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConversation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.GetConversationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.Conversation + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "GetConversation")) + .build(); + } + } + } + return getGetConversationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.ListConversationsRequest, + com.google.cloud.discoveryengine.v1.ListConversationsResponse> + getListConversationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListConversations", + requestType = com.google.cloud.discoveryengine.v1.ListConversationsRequest.class, + responseType = com.google.cloud.discoveryengine.v1.ListConversationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.ListConversationsRequest, + com.google.cloud.discoveryengine.v1.ListConversationsResponse> + getListConversationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1.ListConversationsRequest, + com.google.cloud.discoveryengine.v1.ListConversationsResponse> + getListConversationsMethod; + if ((getListConversationsMethod = ConversationalSearchServiceGrpc.getListConversationsMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getListConversationsMethod = + ConversationalSearchServiceGrpc.getListConversationsMethod) + == null) { + ConversationalSearchServiceGrpc.getListConversationsMethod = + getListConversationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConversations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.ListConversationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1.ListConversationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "ListConversations")) + .build(); + } + } + } + return getListConversationsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ConversationalSearchServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConversationalSearchServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceStub(channel, callOptions); + } + }; + return ConversationalSearchServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ConversationalSearchServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConversationalSearchServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceBlockingStub(channel, callOptions); + } + }; + return ConversationalSearchServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ConversationalSearchServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConversationalSearchServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceFutureStub(channel, callOptions); + } + }; + return ConversationalSearchServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for conversational search.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Converses a conversation.
+     * 
+ */ + default void converseConversation( + com.google.cloud.discoveryengine.v1.ConverseConversationRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1.ConverseConversationResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getConverseConversationMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to
+     * create already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + default void createConversation( + com.google.cloud.discoveryengine.v1.CreateConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateConversationMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to
+     * delete does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + default void deleteConversation( + com.google.cloud.discoveryengine.v1.DeleteConversationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteConversationMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a Conversation.
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] action type
+     * cannot be changed. If the
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update does
+     * not exist, a NOT_FOUND error is returned.
+     * 
+ */ + default void updateConversation( + com.google.cloud.discoveryengine.v1.UpdateConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateConversationMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a Conversation.
+     * 
+ */ + default void getConversation( + com.google.cloud.discoveryengine.v1.GetConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetConversationMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all Conversations by their parent
+     * [DataStore][google.cloud.discoveryengine.v1.DataStore].
+     * 
+ */ + default void listConversations( + com.google.cloud.discoveryengine.v1.ListConversationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListConversationsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service ConversationalSearchService. + * + *
+   * Service for conversational search.
+   * 
+ */ + public abstract static class ConversationalSearchServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ConversationalSearchServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service ConversationalSearchService. + * + *
+   * Service for conversational search.
+   * 
+ */ + public static final class ConversationalSearchServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ConversationalSearchServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConversationalSearchServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Converses a conversation.
+     * 
+ */ + public void converseConversation( + com.google.cloud.discoveryengine.v1.ConverseConversationRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1.ConverseConversationResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getConverseConversationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to
+     * create already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public void createConversation( + com.google.cloud.discoveryengine.v1.CreateConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateConversationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to
+     * delete does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void deleteConversation( + com.google.cloud.discoveryengine.v1.DeleteConversationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteConversationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a Conversation.
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] action type
+     * cannot be changed. If the
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update does
+     * not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void updateConversation( + com.google.cloud.discoveryengine.v1.UpdateConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateConversationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a Conversation.
+     * 
+ */ + public void getConversation( + com.google.cloud.discoveryengine.v1.GetConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetConversationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all Conversations by their parent
+     * [DataStore][google.cloud.discoveryengine.v1.DataStore].
+     * 
+ */ + public void listConversations( + com.google.cloud.discoveryengine.v1.ListConversationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListConversationsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service ConversationalSearchService. + * + *
+   * Service for conversational search.
+   * 
+ */ + public static final class ConversationalSearchServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ConversationalSearchServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConversationalSearchServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Converses a conversation.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1.ConverseConversationResponse converseConversation( + com.google.cloud.discoveryengine.v1.ConverseConversationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getConverseConversationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to
+     * create already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1.Conversation createConversation( + com.google.cloud.discoveryengine.v1.CreateConversationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateConversationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to
+     * delete does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.protobuf.Empty deleteConversation( + com.google.cloud.discoveryengine.v1.DeleteConversationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteConversationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a Conversation.
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] action type
+     * cannot be changed. If the
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update does
+     * not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1.Conversation updateConversation( + com.google.cloud.discoveryengine.v1.UpdateConversationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateConversationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a Conversation.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1.Conversation getConversation( + com.google.cloud.discoveryengine.v1.GetConversationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetConversationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all Conversations by their parent
+     * [DataStore][google.cloud.discoveryengine.v1.DataStore].
+     * 
+ */ + public com.google.cloud.discoveryengine.v1.ListConversationsResponse listConversations( + com.google.cloud.discoveryengine.v1.ListConversationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListConversationsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * ConversationalSearchService. + * + *
+   * Service for conversational search.
+   * 
+ */ + public static final class ConversationalSearchServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ConversationalSearchServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConversationalSearchServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Converses a conversation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1.ConverseConversationResponse> + converseConversation( + com.google.cloud.discoveryengine.v1.ConverseConversationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getConverseConversationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to
+     * create already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1.Conversation> + createConversation(com.google.cloud.discoveryengine.v1.CreateConversationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateConversationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to
+     * delete does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteConversation(com.google.cloud.discoveryengine.v1.DeleteConversationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteConversationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a Conversation.
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] action type
+     * cannot be changed. If the
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update does
+     * not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1.Conversation> + updateConversation(com.google.cloud.discoveryengine.v1.UpdateConversationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateConversationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a Conversation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1.Conversation> + getConversation(com.google.cloud.discoveryengine.v1.GetConversationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetConversationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all Conversations by their parent
+     * [DataStore][google.cloud.discoveryengine.v1.DataStore].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1.ListConversationsResponse> + listConversations(com.google.cloud.discoveryengine.v1.ListConversationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListConversationsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CONVERSE_CONVERSATION = 0; + private static final int METHODID_CREATE_CONVERSATION = 1; + private static final int METHODID_DELETE_CONVERSATION = 2; + private static final int METHODID_UPDATE_CONVERSATION = 3; + private static final int METHODID_GET_CONVERSATION = 4; + private static final int METHODID_LIST_CONVERSATIONS = 5; + + 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_CONVERSE_CONVERSATION: + serviceImpl.converseConversation( + (com.google.cloud.discoveryengine.v1.ConverseConversationRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1.ConverseConversationResponse>) + responseObserver); + break; + case METHODID_CREATE_CONVERSATION: + serviceImpl.createConversation( + (com.google.cloud.discoveryengine.v1.CreateConversationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_CONVERSATION: + serviceImpl.deleteConversation( + (com.google.cloud.discoveryengine.v1.DeleteConversationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CONVERSATION: + serviceImpl.updateConversation( + (com.google.cloud.discoveryengine.v1.UpdateConversationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_CONVERSATION: + serviceImpl.getConversation( + (com.google.cloud.discoveryengine.v1.GetConversationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CONVERSATIONS: + serviceImpl.listConversations( + (com.google.cloud.discoveryengine.v1.ListConversationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1.ListConversationsResponse>) + 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( + getConverseConversationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1.ConverseConversationRequest, + com.google.cloud.discoveryengine.v1.ConverseConversationResponse>( + service, METHODID_CONVERSE_CONVERSATION))) + .addMethod( + getCreateConversationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1.CreateConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation>( + service, METHODID_CREATE_CONVERSATION))) + .addMethod( + getDeleteConversationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1.DeleteConversationRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_CONVERSATION))) + .addMethod( + getUpdateConversationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1.UpdateConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation>( + service, METHODID_UPDATE_CONVERSATION))) + .addMethod( + getGetConversationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1.GetConversationRequest, + com.google.cloud.discoveryengine.v1.Conversation>( + service, METHODID_GET_CONVERSATION))) + .addMethod( + getListConversationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1.ListConversationsRequest, + com.google.cloud.discoveryengine.v1.ListConversationsResponse>( + service, METHODID_LIST_CONVERSATIONS))) + .build(); + } + + private abstract static class ConversationalSearchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ConversationalSearchServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ConversationalSearchService"); + } + } + + private static final class ConversationalSearchServiceFileDescriptorSupplier + extends ConversationalSearchServiceBaseDescriptorSupplier { + ConversationalSearchServiceFileDescriptorSupplier() {} + } + + private static final class ConversationalSearchServiceMethodDescriptorSupplier + extends ConversationalSearchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ConversationalSearchServiceMethodDescriptorSupplier(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 (ConversationalSearchServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ConversationalSearchServiceFileDescriptorSupplier()) + .addMethod(getConverseConversationMethod()) + .addMethod(getCreateConversationMethod()) + .addMethod(getDeleteConversationMethod()) + .addMethod(getUpdateConversationMethod()) + .addMethod(getGetConversationMethod()) + .addMethod(getListConversationsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventServiceGrpc.java b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventServiceGrpc.java index 80a1f168a806..b78b31860e4b 100644 --- a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventServiceGrpc.java +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventServiceGrpc.java @@ -240,7 +240,7 @@ default void writeUserEvent( * *
      * Writes a single user event from the browser. This uses a GET request to
-     * due to browser restriction of POST-ing to a 3rd party domain.
+     * due to browser restriction of POST-ing to a third-party domain.
      * This method is used only by the Discovery Engine API JavaScript pixel and
      * Google Tag Manager. Users should not call this method directly.
      * 
@@ -328,7 +328,7 @@ public void writeUserEvent( * *
      * Writes a single user event from the browser. This uses a GET request to
-     * due to browser restriction of POST-ing to a 3rd party domain.
+     * due to browser restriction of POST-ing to a third-party domain.
      * This method is used only by the Discovery Engine API JavaScript pixel and
      * Google Tag Manager. Users should not call this method directly.
      * 
@@ -401,7 +401,7 @@ public com.google.cloud.discoveryengine.v1.UserEvent writeUserEvent( * *
      * Writes a single user event from the browser. This uses a GET request to
-     * due to browser restriction of POST-ing to a 3rd party domain.
+     * due to browser restriction of POST-ing to a third-party domain.
      * This method is used only by the Discovery Engine API JavaScript pixel and
      * Google Tag Manager. Users should not call this method directly.
      * 
@@ -469,7 +469,7 @@ protected UserEventServiceFutureStub build( * *
      * Writes a single user event from the browser. This uses a GET request to
-     * due to browser restriction of POST-ing to a 3rd party domain.
+     * due to browser restriction of POST-ing to a third-party domain.
      * This method is used only by the Discovery Engine API JavaScript pixel and
      * Google Tag Manager. Users should not call this method directly.
      * 
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/BigQuerySource.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/BigQuerySource.java index ade68e1ce531..14520444ed1f 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/BigQuerySource.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/BigQuerySource.java @@ -403,9 +403,9 @@ public com.google.protobuf.ByteString getGcsStagingDirBytes() { * [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data] * or * [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data]. - * * `custom`: One custom data per row in arbitrary format that conforms the - * defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * * `custom`: One custom data per row in arbitrary format that conforms to + * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + * store. This can only be used by Gen App Builder. * * * string data_schema = 6; @@ -444,9 +444,9 @@ public java.lang.String getDataSchema() { * [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data] * or * [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data]. - * * `custom`: One custom data per row in arbitrary format that conforms the - * defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * * `custom`: One custom data per row in arbitrary format that conforms to + * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + * store. This can only be used by Gen App Builder. * * * string data_schema = 6; @@ -1646,9 +1646,9 @@ public Builder setGcsStagingDirBytes(com.google.protobuf.ByteString value) { * [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data] * or * [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data]. - * * `custom`: One custom data per row in arbitrary format that conforms the - * defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * * `custom`: One custom data per row in arbitrary format that conforms to + * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + * store. This can only be used by Gen App Builder. * * * string data_schema = 6; @@ -1686,9 +1686,9 @@ public java.lang.String getDataSchema() { * [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data] * or * [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data]. - * * `custom`: One custom data per row in arbitrary format that conforms the - * defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * * `custom`: One custom data per row in arbitrary format that conforms to + * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + * store. This can only be used by Gen App Builder. * * * string data_schema = 6; @@ -1726,9 +1726,9 @@ public com.google.protobuf.ByteString getDataSchemaBytes() { * [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data] * or * [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data]. - * * `custom`: One custom data per row in arbitrary format that conforms the - * defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * * `custom`: One custom data per row in arbitrary format that conforms to + * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + * store. This can only be used by Gen App Builder. * * * string data_schema = 6; @@ -1765,9 +1765,9 @@ public Builder setDataSchema(java.lang.String value) { * [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data] * or * [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data]. - * * `custom`: One custom data per row in arbitrary format that conforms the - * defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * * `custom`: One custom data per row in arbitrary format that conforms to + * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + * store. This can only be used by Gen App Builder. * * * string data_schema = 6; @@ -1800,9 +1800,9 @@ public Builder clearDataSchema() { * [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data] * or * [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data]. - * * `custom`: One custom data per row in arbitrary format that conforms the - * defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * * `custom`: One custom data per row in arbitrary format that conforms to + * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + * store. This can only be used by Gen App Builder. * * * string data_schema = 6; diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/BigQuerySourceOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/BigQuerySourceOrBuilder.java index 22787ff37651..95537e16167d 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/BigQuerySourceOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/BigQuerySourceOrBuilder.java @@ -190,9 +190,9 @@ public interface BigQuerySourceOrBuilder * [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data] * or * [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data]. - * * `custom`: One custom data per row in arbitrary format that conforms the - * defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * * `custom`: One custom data per row in arbitrary format that conforms to + * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + * store. This can only be used by Gen App Builder. * * * string data_schema = 6; @@ -220,9 +220,9 @@ public interface BigQuerySourceOrBuilder * [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data] * or * [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data]. - * * `custom`: One custom data per row in arbitrary format that conforms the - * defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * * `custom`: One custom data per row in arbitrary format that conforms to + * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + * store. This can only be used by Gen App Builder. * * * string data_schema = 6; diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CollectUserEventRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CollectUserEventRequest.java index 8a4688d6b7ce..4f2c663179ec 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CollectUserEventRequest.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CollectUserEventRequest.java @@ -185,7 +185,7 @@ public com.google.protobuf.ByteString getUserEventBytes() { *
    * The URL including cgi-parameters but excluding the hash fragment with a
    * length limit of 5,000 characters. This is often more useful than the
-   * referer URL, because many browsers only send the domain for 3rd party
+   * referer URL, because many browsers only send the domain for third-party
    * requests.
    * 
* @@ -203,7 +203,7 @@ public boolean hasUri() { *
    * The URL including cgi-parameters but excluding the hash fragment with a
    * length limit of 5,000 characters. This is often more useful than the
-   * referer URL, because many browsers only send the domain for 3rd party
+   * referer URL, because many browsers only send the domain for third-party
    * requests.
    * 
* @@ -229,7 +229,7 @@ public java.lang.String getUri() { *
    * The URL including cgi-parameters but excluding the hash fragment with a
    * length limit of 5,000 characters. This is often more useful than the
-   * referer URL, because many browsers only send the domain for 3rd party
+   * referer URL, because many browsers only send the domain for third-party
    * requests.
    * 
* @@ -953,7 +953,7 @@ public Builder setUserEventBytes(com.google.protobuf.ByteString value) { *
      * The URL including cgi-parameters but excluding the hash fragment with a
      * length limit of 5,000 characters. This is often more useful than the
-     * referer URL, because many browsers only send the domain for 3rd party
+     * referer URL, because many browsers only send the domain for third-party
      * requests.
      * 
* @@ -970,7 +970,7 @@ public boolean hasUri() { *
      * The URL including cgi-parameters but excluding the hash fragment with a
      * length limit of 5,000 characters. This is often more useful than the
-     * referer URL, because many browsers only send the domain for 3rd party
+     * referer URL, because many browsers only send the domain for third-party
      * requests.
      * 
* @@ -995,7 +995,7 @@ public java.lang.String getUri() { *
      * The URL including cgi-parameters but excluding the hash fragment with a
      * length limit of 5,000 characters. This is often more useful than the
-     * referer URL, because many browsers only send the domain for 3rd party
+     * referer URL, because many browsers only send the domain for third-party
      * requests.
      * 
* @@ -1020,7 +1020,7 @@ public com.google.protobuf.ByteString getUriBytes() { *
      * The URL including cgi-parameters but excluding the hash fragment with a
      * length limit of 5,000 characters. This is often more useful than the
-     * referer URL, because many browsers only send the domain for 3rd party
+     * referer URL, because many browsers only send the domain for third-party
      * requests.
      * 
* @@ -1044,7 +1044,7 @@ public Builder setUri(java.lang.String value) { *
      * The URL including cgi-parameters but excluding the hash fragment with a
      * length limit of 5,000 characters. This is often more useful than the
-     * referer URL, because many browsers only send the domain for 3rd party
+     * referer URL, because many browsers only send the domain for third-party
      * requests.
      * 
* @@ -1064,7 +1064,7 @@ public Builder clearUri() { *
      * The URL including cgi-parameters but excluding the hash fragment with a
      * length limit of 5,000 characters. This is often more useful than the
-     * referer URL, because many browsers only send the domain for 3rd party
+     * referer URL, because many browsers only send the domain for third-party
      * requests.
      * 
* diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CollectUserEventRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CollectUserEventRequestOrBuilder.java index 6f05ac7cf767..676dd22e9c11 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CollectUserEventRequestOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CollectUserEventRequestOrBuilder.java @@ -87,7 +87,7 @@ public interface CollectUserEventRequestOrBuilder *
    * The URL including cgi-parameters but excluding the hash fragment with a
    * length limit of 5,000 characters. This is often more useful than the
-   * referer URL, because many browsers only send the domain for 3rd party
+   * referer URL, because many browsers only send the domain for third-party
    * requests.
    * 
* @@ -102,7 +102,7 @@ public interface CollectUserEventRequestOrBuilder *
    * The URL including cgi-parameters but excluding the hash fragment with a
    * length limit of 5,000 characters. This is often more useful than the
-   * referer URL, because many browsers only send the domain for 3rd party
+   * referer URL, because many browsers only send the domain for third-party
    * requests.
    * 
* @@ -117,7 +117,7 @@ public interface CollectUserEventRequestOrBuilder *
    * The URL including cgi-parameters but excluding the hash fragment with a
    * length limit of 5,000 characters. This is often more useful than the
-   * referer URL, because many browsers only send the domain for 3rd party
+   * referer URL, because many browsers only send the domain for third-party
    * requests.
    * 
* diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CommonProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CommonProto.java index c20d457479b9..4bcc8a3b8804 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CommonProto.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CommonProto.java @@ -27,6 +27,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_Interval_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_Interval_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_discoveryengine_v1_CustomAttribute_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -46,34 +50,37 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n,google/cloud/discoveryengine/v1/common" + ".proto\022\037google.cloud.discoveryengine.v1\032" - + "\031google/api/resource.proto\"0\n\017CustomAttr" - + "ibute\022\014\n\004text\030\001 \003(\t\022\017\n\007numbers\030\002 \003(\001\"/\n\010" - + "UserInfo\022\017\n\007user_id\030\001 \001(\t\022\022\n\nuser_agent\030" - + "\002 \001(\tB\276\007\n#com.google.cloud.discoveryengi" - + "ne.v1B\013CommonProtoP\001ZMcloud.google.com/g" - + "o/discoveryengine/apiv1/discoveryenginep" - + "b;discoveryenginepb\242\002\017DISCOVERYENGINE\252\002\037" - + "Google.Cloud.DiscoveryEngine.V1\312\002\037Google" - + "\\Cloud\\DiscoveryEngine\\V1\352\002\"Google::Clou" - + "d::DiscoveryEngine::V1\352A\346\001\n%discoveryeng" - + "ine.googleapis.com/Branch\022Qprojects/{pro" - + "ject}/locations/{location}/dataStores/{d" - + "ata_store}/branches/{branch}\022jprojects/{" - + "project}/locations/{location}/collection" - + "s/{collection}/dataStores/{data_store}/b" - + "ranches/{branch}\352A\305\001\n(discoveryengine.go" - + "ogleapis.com/DataStore\022?projects/{projec" - + "t}/locations/{location}/dataStores/{data" - + "_store}\022Xprojects/{project}/locations/{l" - + "ocation}/collections/{collection}/dataSt" - + "ores/{data_store}\352A\211\002\n,discoveryengine.g" - + "oogleapis.com/ServingConfig\022_projects/{p" + + "\031google/api/resource.proto\"x\n\010Interval\022\021" + + "\n\007minimum\030\001 \001(\001H\000\022\033\n\021exclusive_minimum\030\002" + + " \001(\001H\000\022\021\n\007maximum\030\003 \001(\001H\001\022\033\n\021exclusive_m" + + "aximum\030\004 \001(\001H\001B\005\n\003minB\005\n\003max\"0\n\017CustomAt" + + "tribute\022\014\n\004text\030\001 \003(\t\022\017\n\007numbers\030\002 \003(\001\"/" + + "\n\010UserInfo\022\017\n\007user_id\030\001 \001(\t\022\022\n\nuser_agen" + + "t\030\002 \001(\tB\276\007\n#com.google.cloud.discoveryen" + + "gine.v1B\013CommonProtoP\001ZMcloud.google.com" + + "/go/discoveryengine/apiv1/discoveryengin" + + "epb;discoveryenginepb\242\002\017DISCOVERYENGINE\252" + + "\002\037Google.Cloud.DiscoveryEngine.V1\312\002\037Goog" + + "le\\Cloud\\DiscoveryEngine\\V1\352\002\"Google::Cl" + + "oud::DiscoveryEngine::V1\352A\346\001\n%discoverye" + + "ngine.googleapis.com/Branch\022Qprojects/{p" + "roject}/locations/{location}/dataStores/" - + "{data_store}/servingConfigs/{serving_con" - + "fig}\022xprojects/{project}/locations/{loca" - + "tion}/collections/{collection}/dataStore" + + "{data_store}/branches/{branch}\022jprojects" + + "/{project}/locations/{location}/collecti" + + "ons/{collection}/dataStores/{data_store}" + + "/branches/{branch}\352A\305\001\n(discoveryengine." + + "googleapis.com/DataStore\022?projects/{proj" + + "ect}/locations/{location}/dataStores/{da" + + "ta_store}\022Xprojects/{project}/locations/" + + "{location}/collections/{collection}/data" + + "Stores/{data_store}\352A\211\002\n,discoveryengine" + + ".googleapis.com/ServingConfig\022_projects/" + + "{project}/locations/{location}/dataStore" + "s/{data_store}/servingConfigs/{serving_c" - + "onfig}b\006proto3" + + "onfig}\022xprojects/{project}/locations/{lo" + + "cation}/collections/{collection}/dataSto" + + "res/{data_store}/servingConfigs/{serving" + + "_config}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -81,8 +88,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.ResourceProto.getDescriptor(), }); - internal_static_google_cloud_discoveryengine_v1_CustomAttribute_descriptor = + internal_static_google_cloud_discoveryengine_v1_Interval_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1_Interval_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_Interval_descriptor, + new java.lang.String[] { + "Minimum", "ExclusiveMinimum", "Maximum", "ExclusiveMaximum", "Min", "Max", + }); + internal_static_google_cloud_discoveryengine_v1_CustomAttribute_descriptor = + getDescriptor().getMessageTypes().get(1); internal_static_google_cloud_discoveryengine_v1_CustomAttribute_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_CustomAttribute_descriptor, @@ -90,7 +105,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Text", "Numbers", }); internal_static_google_cloud_discoveryengine_v1_UserInfo_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(2); internal_static_google_cloud_discoveryengine_v1_UserInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_UserInfo_descriptor, diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryRequest.java index 3290a9c90ebd..70096c39a86b 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryRequest.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryRequest.java @@ -196,13 +196,14 @@ public com.google.protobuf.ByteString getQueryBytes() { * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * * Default values: * * * `document` is the default model for regular dataStores. * * `search-history` is the default model for - * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] - * dataStores. + * [IndustryVertical.SITE_SEARCH][] dataStores. * * * string query_model = 3; @@ -234,13 +235,14 @@ public java.lang.String getQueryModel() { * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * * Default values: * * * `document` is the default model for regular dataStores. * * `search-history` is the default model for - * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] - * dataStores. + * [IndustryVertical.SITE_SEARCH][] dataStores. * * * string query_model = 3; @@ -337,6 +339,27 @@ public com.google.protobuf.ByteString getUserPseudoIdBytes() { } } + public static final int INCLUDE_TAIL_SUGGESTIONS_FIELD_NUMBER = 5; + private boolean includeTailSuggestions_ = false; + /** + * + * + *
+   * Indicates if tail suggestions should be returned if there are no
+   * suggestions that match the full query. Even if set to true, if there are
+   * suggestions that match the full query, those are returned and no
+   * tail suggestions are returned.
+   * 
+ * + * bool include_tail_suggestions = 5; + * + * @return The includeTailSuggestions. + */ + @java.lang.Override + public boolean getIncludeTailSuggestions() { + return includeTailSuggestions_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -363,6 +386,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, userPseudoId_); } + if (includeTailSuggestions_ != false) { + output.writeBool(5, includeTailSuggestions_); + } getUnknownFields().writeTo(output); } @@ -384,6 +410,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, userPseudoId_); } + if (includeTailSuggestions_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, includeTailSuggestions_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -404,6 +433,7 @@ public boolean equals(final java.lang.Object obj) { if (!getQuery().equals(other.getQuery())) return false; if (!getQueryModel().equals(other.getQueryModel())) return false; if (!getUserPseudoId().equals(other.getUserPseudoId())) return false; + if (getIncludeTailSuggestions() != other.getIncludeTailSuggestions()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -423,6 +453,8 @@ public int hashCode() { hash = (53 * hash) + getQueryModel().hashCode(); hash = (37 * hash) + USER_PSEUDO_ID_FIELD_NUMBER; hash = (53 * hash) + getUserPseudoId().hashCode(); + hash = (37 * hash) + INCLUDE_TAIL_SUGGESTIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeTailSuggestions()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -569,6 +601,7 @@ public Builder clear() { query_ = ""; queryModel_ = ""; userPseudoId_ = ""; + includeTailSuggestions_ = false; return this; } @@ -617,6 +650,9 @@ private void buildPartial0(com.google.cloud.discoveryengine.v1.CompleteQueryRequ if (((from_bitField0_ & 0x00000008) != 0)) { result.userPseudoId_ = userPseudoId_; } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.includeTailSuggestions_ = includeTailSuggestions_; + } } @java.lang.Override @@ -685,6 +721,9 @@ public Builder mergeFrom(com.google.cloud.discoveryengine.v1.CompleteQueryReques bitField0_ |= 0x00000008; onChanged(); } + if (other.getIncludeTailSuggestions() != false) { + setIncludeTailSuggestions(other.getIncludeTailSuggestions()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -735,6 +774,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000008; break; } // case 34 + case 40: + { + includeTailSuggestions_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1005,13 +1050,14 @@ public Builder setQueryBytes(com.google.protobuf.ByteString value) { * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * * Default values: * * * `document` is the default model for regular dataStores. * * `search-history` is the default model for - * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] - * dataStores. + * [IndustryVertical.SITE_SEARCH][] dataStores. * * * string query_model = 3; @@ -1042,13 +1088,14 @@ public java.lang.String getQueryModel() { * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * * Default values: * * * `document` is the default model for regular dataStores. * * `search-history` is the default model for - * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] - * dataStores. + * [IndustryVertical.SITE_SEARCH][] dataStores. * * * string query_model = 3; @@ -1079,13 +1126,14 @@ public com.google.protobuf.ByteString getQueryModelBytes() { * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * * Default values: * * * `document` is the default model for regular dataStores. * * `search-history` is the default model for - * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] - * dataStores. + * [IndustryVertical.SITE_SEARCH][] dataStores. * * * string query_model = 3; @@ -1115,13 +1163,14 @@ public Builder setQueryModel(java.lang.String value) { * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * * Default values: * * * `document` is the default model for regular dataStores. * * `search-history` is the default model for - * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] - * dataStores. + * [IndustryVertical.SITE_SEARCH][] dataStores. * * * string query_model = 3; @@ -1147,13 +1196,14 @@ public Builder clearQueryModel() { * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * * Default values: * * * `document` is the default model for regular dataStores. * * `search-history` is the default model for - * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] - * dataStores. + * [IndustryVertical.SITE_SEARCH][] dataStores. * * * string query_model = 3; @@ -1343,6 +1393,68 @@ public Builder setUserPseudoIdBytes(com.google.protobuf.ByteString value) { return this; } + private boolean includeTailSuggestions_; + /** + * + * + *
+     * Indicates if tail suggestions should be returned if there are no
+     * suggestions that match the full query. Even if set to true, if there are
+     * suggestions that match the full query, those are returned and no
+     * tail suggestions are returned.
+     * 
+ * + * bool include_tail_suggestions = 5; + * + * @return The includeTailSuggestions. + */ + @java.lang.Override + public boolean getIncludeTailSuggestions() { + return includeTailSuggestions_; + } + /** + * + * + *
+     * Indicates if tail suggestions should be returned if there are no
+     * suggestions that match the full query. Even if set to true, if there are
+     * suggestions that match the full query, those are returned and no
+     * tail suggestions are returned.
+     * 
+ * + * bool include_tail_suggestions = 5; + * + * @param value The includeTailSuggestions to set. + * @return This builder for chaining. + */ + public Builder setIncludeTailSuggestions(boolean value) { + + includeTailSuggestions_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates if tail suggestions should be returned if there are no
+     * suggestions that match the full query. Even if set to true, if there are
+     * suggestions that match the full query, those are returned and no
+     * tail suggestions are returned.
+     * 
+ * + * bool include_tail_suggestions = 5; + * + * @return This builder for chaining. + */ + public Builder clearIncludeTailSuggestions() { + bitField0_ = (bitField0_ & ~0x00000010); + includeTailSuggestions_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryRequestOrBuilder.java index dffd870cf179..804094108a3f 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryRequestOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryRequestOrBuilder.java @@ -96,13 +96,14 @@ public interface CompleteQueryRequestOrBuilder * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * * Default values: * * * `document` is the default model for regular dataStores. * * `search-history` is the default model for - * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] - * dataStores. + * [IndustryVertical.SITE_SEARCH][] dataStores. * * * string query_model = 3; @@ -123,13 +124,14 @@ public interface CompleteQueryRequestOrBuilder * API calls. Do not use it when there is no traffic for Search API. * * `user-event` - Using suggestions generated from user-imported search * events. + * * `document-completable` - Using suggestions taken directly from + * user-imported document fields marked as completable. * * Default values: * * * `document` is the default model for regular dataStores. * * `search-history` is the default model for - * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] - * dataStores. + * [IndustryVertical.SITE_SEARCH][] dataStores. * * * string query_model = 3; @@ -188,4 +190,20 @@ public interface CompleteQueryRequestOrBuilder * @return The bytes for userPseudoId. */ com.google.protobuf.ByteString getUserPseudoIdBytes(); + + /** + * + * + *
+   * Indicates if tail suggestions should be returned if there are no
+   * suggestions that match the full query. Even if set to true, if there are
+   * suggestions that match the full query, those are returned and no
+   * tail suggestions are returned.
+   * 
+ * + * bool include_tail_suggestions = 5; + * + * @return The includeTailSuggestions. + */ + boolean getIncludeTailSuggestions(); } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryResponse.java index 14ac8bbe1ce0..ae4b9b340a05 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryResponse.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryResponse.java @@ -821,6 +821,27 @@ public int getQuerySuggestionsCount() { return querySuggestions_.get(index); } + public static final int TAIL_MATCH_TRIGGERED_FIELD_NUMBER = 2; + private boolean tailMatchTriggered_ = false; + /** + * + * + *
+   * True if the returned suggestions are all tail suggestions.
+   *
+   * For tail matching to be triggered, include_tail_suggestions in the request
+   * must be true and there must be no suggestions that match the full query.
+   * 
+ * + * bool tail_match_triggered = 2; + * + * @return The tailMatchTriggered. + */ + @java.lang.Override + public boolean getTailMatchTriggered() { + return tailMatchTriggered_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -838,6 +859,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < querySuggestions_.size(); i++) { output.writeMessage(1, querySuggestions_.get(i)); } + if (tailMatchTriggered_ != false) { + output.writeBool(2, tailMatchTriggered_); + } getUnknownFields().writeTo(output); } @@ -850,6 +874,9 @@ public int getSerializedSize() { for (int i = 0; i < querySuggestions_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, querySuggestions_.get(i)); } + if (tailMatchTriggered_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, tailMatchTriggered_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -867,6 +894,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.discoveryengine.v1.CompleteQueryResponse) obj; if (!getQuerySuggestionsList().equals(other.getQuerySuggestionsList())) return false; + if (getTailMatchTriggered() != other.getTailMatchTriggered()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -882,6 +910,8 @@ public int hashCode() { hash = (37 * hash) + QUERY_SUGGESTIONS_FIELD_NUMBER; hash = (53 * hash) + getQuerySuggestionsList().hashCode(); } + hash = (37 * hash) + TAIL_MATCH_TRIGGERED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTailMatchTriggered()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1031,6 +1061,7 @@ public Builder clear() { querySuggestionsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); + tailMatchTriggered_ = false; return this; } @@ -1081,6 +1112,9 @@ private void buildPartialRepeatedFields( private void buildPartial0(com.google.cloud.discoveryengine.v1.CompleteQueryResponse result) { int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tailMatchTriggered_ = tailMatchTriggered_; + } } @java.lang.Override @@ -1156,6 +1190,9 @@ public Builder mergeFrom(com.google.cloud.discoveryengine.v1.CompleteQueryRespon } } } + if (other.getTailMatchTriggered() != false) { + setTailMatchTriggered(other.getTailMatchTriggered()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1197,6 +1234,12 @@ public Builder mergeFrom( } break; } // case 10 + case 16: + { + tailMatchTriggered_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1653,6 +1696,68 @@ public Builder removeQuerySuggestions(int index) { return querySuggestionsBuilder_; } + private boolean tailMatchTriggered_; + /** + * + * + *
+     * True if the returned suggestions are all tail suggestions.
+     *
+     * For tail matching to be triggered, include_tail_suggestions in the request
+     * must be true and there must be no suggestions that match the full query.
+     * 
+ * + * bool tail_match_triggered = 2; + * + * @return The tailMatchTriggered. + */ + @java.lang.Override + public boolean getTailMatchTriggered() { + return tailMatchTriggered_; + } + /** + * + * + *
+     * True if the returned suggestions are all tail suggestions.
+     *
+     * For tail matching to be triggered, include_tail_suggestions in the request
+     * must be true and there must be no suggestions that match the full query.
+     * 
+ * + * bool tail_match_triggered = 2; + * + * @param value The tailMatchTriggered to set. + * @return This builder for chaining. + */ + public Builder setTailMatchTriggered(boolean value) { + + tailMatchTriggered_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * True if the returned suggestions are all tail suggestions.
+     *
+     * For tail matching to be triggered, include_tail_suggestions in the request
+     * must be true and there must be no suggestions that match the full query.
+     * 
+ * + * bool tail_match_triggered = 2; + * + * @return This builder for chaining. + */ + public Builder clearTailMatchTriggered() { + bitField0_ = (bitField0_ & ~0x00000002); + tailMatchTriggered_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryResponseOrBuilder.java index 88b1a60b7146..a5fa3af97e82 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryResponseOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompleteQueryResponseOrBuilder.java @@ -94,4 +94,20 @@ com.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion getQue */ com.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestionOrBuilder getQuerySuggestionsOrBuilder(int index); + + /** + * + * + *
+   * True if the returned suggestions are all tail suggestions.
+   *
+   * For tail matching to be triggered, include_tail_suggestions in the request
+   * must be true and there must be no suggestions that match the full query.
+   * 
+ * + * bool tail_match_triggered = 2; + * + * @return The tailMatchTriggered. + */ + boolean getTailMatchTriggered(); } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionInfo.java index 89dab0e52b27..ace0d801e2e4 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionInfo.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionInfo.java @@ -71,7 +71,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
    * 
* * string selected_suggestion = 1; @@ -94,7 +95,8 @@ public java.lang.String getSelectedSuggestion() { * * *
-   * End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
    * 
* * string selected_suggestion = 1; @@ -120,7 +122,8 @@ public com.google.protobuf.ByteString getSelectedSuggestionBytes() { * * *
-   * End user selected [CompleteQueryResponse.CompletionResult.suggestion][]
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion]
    * position, starting from 0.
    * 
* @@ -503,7 +506,8 @@ public Builder mergeFrom( * * *
-     * End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
      * 
* * string selected_suggestion = 1; @@ -525,7 +529,8 @@ public java.lang.String getSelectedSuggestion() { * * *
-     * End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
      * 
* * string selected_suggestion = 1; @@ -547,7 +552,8 @@ public com.google.protobuf.ByteString getSelectedSuggestionBytes() { * * *
-     * End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
      * 
* * string selected_suggestion = 1; @@ -568,7 +574,8 @@ public Builder setSelectedSuggestion(java.lang.String value) { * * *
-     * End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
      * 
* * string selected_suggestion = 1; @@ -585,7 +592,8 @@ public Builder clearSelectedSuggestion() { * * *
-     * End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
      * 
* * string selected_suggestion = 1; @@ -609,7 +617,8 @@ public Builder setSelectedSuggestionBytes(com.google.protobuf.ByteString value) * * *
-     * End user selected [CompleteQueryResponse.CompletionResult.suggestion][]
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion]
      * position, starting from 0.
      * 
* @@ -625,7 +634,8 @@ public int getSelectedPosition() { * * *
-     * End user selected [CompleteQueryResponse.CompletionResult.suggestion][]
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion]
      * position, starting from 0.
      * 
* @@ -645,7 +655,8 @@ public Builder setSelectedPosition(int value) { * * *
-     * End user selected [CompleteQueryResponse.CompletionResult.suggestion][]
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion]
      * position, starting from 0.
      * 
* diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionInfoOrBuilder.java index 7555c9ef28ab..1eb58fbd6952 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionInfoOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionInfoOrBuilder.java @@ -27,7 +27,8 @@ public interface CompletionInfoOrBuilder * * *
-   * End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
    * 
* * string selected_suggestion = 1; @@ -39,7 +40,8 @@ public interface CompletionInfoOrBuilder * * *
-   * End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
    * 
* * string selected_suggestion = 1; @@ -52,7 +54,8 @@ public interface CompletionInfoOrBuilder * * *
-   * End user selected [CompleteQueryResponse.CompletionResult.suggestion][]
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion]
    * position, starting from 0.
    * 
* diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionServiceProto.java index 94b98620dfa0..9aa6e96ee6d4 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionServiceProto.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CompletionServiceProto.java @@ -53,32 +53,33 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ryengine.v1\032\034google/api/annotations.prot" + "o\032\027google/api/client.proto\032\037google/api/f" + "ield_behavior.proto\032\031google/api/resource" - + ".proto\"\237\001\n\024CompleteQueryRequest\022E\n\ndata_" + + ".proto\"\301\001\n\024CompleteQueryRequest\022E\n\ndata_" + "store\030\001 \001(\tB1\342A\001\002\372A*\n(discoveryengine.go" + "ogleapis.com/DataStore\022\023\n\005query\030\002 \001(\tB\004\342" + "A\001\002\022\023\n\013query_model\030\003 \001(\t\022\026\n\016user_pseudo_" - + "id\030\004 \001(\t\"\241\001\n\025CompleteQueryResponse\022a\n\021qu" - + "ery_suggestions\030\001 \003(\0132F.google.cloud.dis" - + "coveryengine.v1.CompleteQueryResponse.Qu" - + "erySuggestion\032%\n\017QuerySuggestion\022\022\n\nsugg" - + "estion\030\001 \001(\t2\212\003\n\021CompletionService\022\240\002\n\rC" - + "ompleteQuery\0225.google.cloud.discoveryeng" - + "ine.v1.CompleteQueryRequest\0326.google.clo" - + "ud.discoveryengine.v1.CompleteQueryRespo" - + "nse\"\237\001\202\323\344\223\002\230\001\022B/v1/{data_store=projects/" - + "*/locations/*/dataStores/*}:completeQuer" - + "yZR\022P/v1/{data_store=projects/*/location" - + "s/*/collections/*/dataStores/*}:complete" - + "Query\032R\312A\036discoveryengine.googleapis.com" - + "\322A.https://www.googleapis.com/auth/cloud" - + "-platformB\211\002\n#com.google.cloud.discovery" - + "engine.v1B\026CompletionServiceProtoP\001ZMclo" - + "ud.google.com/go/discoveryengine/apiv1/d" - + "iscoveryenginepb;discoveryenginepb\242\002\017DIS" - + "COVERYENGINE\252\002\037Google.Cloud.DiscoveryEng" - + "ine.V1\312\002\037Google\\Cloud\\DiscoveryEngine\\V1" - + "\352\002\"Google::Cloud::DiscoveryEngine::V1b\006p" - + "roto3" + + "id\030\004 \001(\t\022 \n\030include_tail_suggestions\030\005 \001" + + "(\010\"\277\001\n\025CompleteQueryResponse\022a\n\021query_su" + + "ggestions\030\001 \003(\0132F.google.cloud.discovery" + + "engine.v1.CompleteQueryResponse.QuerySug" + + "gestion\022\034\n\024tail_match_triggered\030\002 \001(\010\032%\n" + + "\017QuerySuggestion\022\022\n\nsuggestion\030\001 \001(\t2\212\003\n" + + "\021CompletionService\022\240\002\n\rCompleteQuery\0225.g" + + "oogle.cloud.discoveryengine.v1.CompleteQ" + + "ueryRequest\0326.google.cloud.discoveryengi" + + "ne.v1.CompleteQueryResponse\"\237\001\202\323\344\223\002\230\001\022B/" + + "v1/{data_store=projects/*/locations/*/da" + + "taStores/*}:completeQueryZR\022P/v1/{data_s" + + "tore=projects/*/locations/*/collections/" + + "*/dataStores/*}:completeQuery\032R\312A\036discov" + + "eryengine.googleapis.com\322A.https://www.g" + + "oogleapis.com/auth/cloud-platformB\211\002\n#co" + + "m.google.cloud.discoveryengine.v1B\026Compl" + + "etionServiceProtoP\001ZMcloud.google.com/go" + + "/discoveryengine/apiv1/discoveryenginepb" + + ";discoveryenginepb\242\002\017DISCOVERYENGINE\252\002\037G" + + "oogle.Cloud.DiscoveryEngine.V1\312\002\037Google\\" + + "Cloud\\DiscoveryEngine\\V1\352\002\"Google::Cloud" + + "::DiscoveryEngine::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -95,7 +96,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_CompleteQueryRequest_descriptor, new java.lang.String[] { - "DataStore", "Query", "QueryModel", "UserPseudoId", + "DataStore", "Query", "QueryModel", "UserPseudoId", "IncludeTailSuggestions", }); internal_static_google_cloud_discoveryengine_v1_CompleteQueryResponse_descriptor = getDescriptor().getMessageTypes().get(1); @@ -103,7 +104,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_CompleteQueryResponse_descriptor, new java.lang.String[] { - "QuerySuggestions", + "QuerySuggestions", "TailMatchTriggered", }); internal_static_google_cloud_discoveryengine_v1_CompleteQueryResponse_QuerySuggestion_descriptor = internal_static_google_cloud_discoveryengine_v1_CompleteQueryResponse_descriptor diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Conversation.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Conversation.java new file mode 100644 index 000000000000..dbe9d1b1d20a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Conversation.java @@ -0,0 +1,2169 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * External conversation proto definition.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.Conversation} + */ +public final class Conversation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.Conversation) + ConversationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Conversation.newBuilder() to construct. + private Conversation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Conversation() { + name_ = ""; + state_ = 0; + userPseudoId_ = ""; + messages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Conversation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_Conversation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_Conversation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.Conversation.class, + com.google.cloud.discoveryengine.v1.Conversation.Builder.class); + } + + /** + * + * + *
+   * Enumeration of the state of the conversation.
+   * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1.Conversation.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Conversation is currently open.
+     * 
+ * + * IN_PROGRESS = 1; + */ + IN_PROGRESS(1), + /** + * + * + *
+     * Conversation has been completed.
+     * 
+ * + * COMPLETED = 2; + */ + COMPLETED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Conversation is currently open.
+     * 
+ * + * IN_PROGRESS = 1; + */ + public static final int IN_PROGRESS_VALUE = 1; + /** + * + * + *
+     * Conversation has been completed.
+     * 
+ * + * COMPLETED = 2; + */ + public static final int COMPLETED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State 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 State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return IN_PROGRESS; + case 2: + return COMPLETED; + 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 State findValueByNumber(int number) { + return State.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.discoveryengine.v1.Conversation.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1.Conversation.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Immutable. Fully qualified name
+   * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. Fully qualified name
+   * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 2; + private int state_ = 0; + /** + * + * + *
+   * The state of the Conversation.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the Conversation.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation.State state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Conversation.State getState() { + com.google.cloud.discoveryengine.v1.Conversation.State result = + com.google.cloud.discoveryengine.v1.Conversation.State.forNumber(state_); + return result == null + ? com.google.cloud.discoveryengine.v1.Conversation.State.UNRECOGNIZED + : result; + } + + public static final int USER_PSEUDO_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+   * A unique identifier for tracking users.
+   * 
+ * + * string user_pseudo_id = 3; + * + * @return The userPseudoId. + */ + @java.lang.Override + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + 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(); + userPseudoId_ = s; + return s; + } + } + /** + * + * + *
+   * A unique identifier for tracking users.
+   * 
+ * + * string user_pseudo_id = 3; + * + * @return The bytes for userPseudoId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List messages_; + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + @java.lang.Override + public java.util.List getMessagesList() { + return messages_; + } + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + @java.lang.Override + public java.util.List + getMessagesOrBuilderList() { + return messages_; + } + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + @java.lang.Override + public int getMessagesCount() { + return messages_.size(); + } + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationMessage getMessages(int index) { + return messages_.get(index); + } + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationMessageOrBuilder getMessagesOrBuilder( + int index) { + return messages_.get(index); + } + + public static final int START_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (state_ + != com.google.cloud.discoveryengine.v1.Conversation.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, userPseudoId_); + } + for (int i = 0; i < messages_.size(); i++) { + output.writeMessage(4, messages_.get(i)); + } + if (startTime_ != null) { + output.writeMessage(5, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(6, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (state_ + != com.google.cloud.discoveryengine.v1.Conversation.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, userPseudoId_); + } + for (int i = 0; i < messages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, messages_.get(i)); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEndTime()); + } + 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.discoveryengine.v1.Conversation)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.Conversation other = + (com.google.cloud.discoveryengine.v1.Conversation) obj; + + if (!getName().equals(other.getName())) return false; + if (state_ != other.state_) return false; + if (!getUserPseudoId().equals(other.getUserPseudoId())) return false; + if (!getMessagesList().equals(other.getMessagesList())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + USER_PSEUDO_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserPseudoId().hashCode(); + if (getMessagesCount() > 0) { + hash = (37 * hash) + MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getMessagesList().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.Conversation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.Conversation 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.discoveryengine.v1.Conversation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.Conversation 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.discoveryengine.v1.Conversation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.Conversation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.Conversation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.Conversation 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.discoveryengine.v1.Conversation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.Conversation 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.discoveryengine.v1.Conversation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.Conversation 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.discoveryengine.v1.Conversation 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; + } + /** + * + * + *
+   * External conversation proto definition.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.Conversation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.Conversation) + com.google.cloud.discoveryengine.v1.ConversationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_Conversation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_Conversation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.Conversation.class, + com.google.cloud.discoveryengine.v1.Conversation.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.Conversation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + state_ = 0; + userPseudoId_ = ""; + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + } else { + messages_ = null; + messagesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_Conversation_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Conversation getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Conversation build() { + com.google.cloud.discoveryengine.v1.Conversation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Conversation buildPartial() { + com.google.cloud.discoveryengine.v1.Conversation result = + new com.google.cloud.discoveryengine.v1.Conversation(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1.Conversation result) { + if (messagesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.messages_ = messages_; + } else { + result.messages_ = messagesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1.Conversation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.userPseudoId_ = userPseudoId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.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.discoveryengine.v1.Conversation) { + return mergeFrom((com.google.cloud.discoveryengine.v1.Conversation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.Conversation other) { + if (other == com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getUserPseudoId().isEmpty()) { + userPseudoId_ = other.userPseudoId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (messagesBuilder_ == null) { + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + } else { + if (!other.messages_.isEmpty()) { + if (messagesBuilder_.isEmpty()) { + messagesBuilder_.dispose(); + messagesBuilder_ = null; + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000008); + messagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMessagesFieldBuilder() + : null; + } else { + messagesBuilder_.addAllMessages(other.messages_); + } + } + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + userPseudoId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.cloud.discoveryengine.v1.ConversationMessage m = + input.readMessage( + com.google.cloud.discoveryengine.v1.ConversationMessage.parser(), + extensionRegistry); + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(m); + } else { + messagesBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Fully qualified name
+     * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of the Conversation.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the Conversation.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation.State state = 2; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the Conversation.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation.State state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Conversation.State getState() { + com.google.cloud.discoveryengine.v1.Conversation.State result = + com.google.cloud.discoveryengine.v1.Conversation.State.forNumber(state_); + return result == null + ? com.google.cloud.discoveryengine.v1.Conversation.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the Conversation.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation.State state = 2; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.discoveryengine.v1.Conversation.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the Conversation.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation.State state = 2; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000002); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+     * A unique identifier for tracking users.
+     * 
+ * + * string user_pseudo_id = 3; + * + * @return The userPseudoId. + */ + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userPseudoId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique identifier for tracking users.
+     * 
+ * + * string user_pseudo_id = 3; + * + * @return The bytes for userPseudoId. + */ + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique identifier for tracking users.
+     * 
+ * + * string user_pseudo_id = 3; + * + * @param value The userPseudoId to set. + * @return This builder for chaining. + */ + public Builder setUserPseudoId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + userPseudoId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique identifier for tracking users.
+     * 
+ * + * string user_pseudo_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearUserPseudoId() { + userPseudoId_ = getDefaultInstance().getUserPseudoId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique identifier for tracking users.
+     * 
+ * + * string user_pseudo_id = 3; + * + * @param value The bytes for userPseudoId to set. + * @return This builder for chaining. + */ + public Builder setUserPseudoIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + userPseudoId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List messages_ = + java.util.Collections.emptyList(); + + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + messages_ = + new java.util.ArrayList( + messages_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.ConversationMessage, + com.google.cloud.discoveryengine.v1.ConversationMessage.Builder, + com.google.cloud.discoveryengine.v1.ConversationMessageOrBuilder> + messagesBuilder_; + + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public java.util.List + getMessagesList() { + if (messagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(messages_); + } else { + return messagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public int getMessagesCount() { + if (messagesBuilder_ == null) { + return messages_.size(); + } else { + return messagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public com.google.cloud.discoveryengine.v1.ConversationMessage getMessages(int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public Builder setMessages( + int index, com.google.cloud.discoveryengine.v1.ConversationMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + } else { + messagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public Builder setMessages( + int index, + com.google.cloud.discoveryengine.v1.ConversationMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.set(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public Builder addMessages(com.google.cloud.discoveryengine.v1.ConversationMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + } else { + messagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public Builder addMessages( + int index, com.google.cloud.discoveryengine.v1.ConversationMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(index, value); + onChanged(); + } else { + messagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public Builder addMessages( + com.google.cloud.discoveryengine.v1.ConversationMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public Builder addMessages( + int index, + com.google.cloud.discoveryengine.v1.ConversationMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public Builder addAllMessages( + java.lang.Iterable + values) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); + onChanged(); + } else { + messagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public Builder clearMessages() { + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + messagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public Builder removeMessages(int index) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.remove(index); + onChanged(); + } else { + messagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public com.google.cloud.discoveryengine.v1.ConversationMessage.Builder getMessagesBuilder( + int index) { + return getMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public com.google.cloud.discoveryengine.v1.ConversationMessageOrBuilder getMessagesOrBuilder( + int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1.ConversationMessageOrBuilder> + getMessagesOrBuilderList() { + if (messagesBuilder_ != null) { + return messagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(messages_); + } + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public com.google.cloud.discoveryengine.v1.ConversationMessage.Builder addMessagesBuilder() { + return getMessagesFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1.ConversationMessage.getDefaultInstance()); + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public com.google.cloud.discoveryengine.v1.ConversationMessage.Builder addMessagesBuilder( + int index) { + return getMessagesFieldBuilder() + .addBuilder( + index, com.google.cloud.discoveryengine.v1.ConversationMessage.getDefaultInstance()); + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + public java.util.List + getMessagesBuilderList() { + return getMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.ConversationMessage, + com.google.cloud.discoveryengine.v1.ConversationMessage.Builder, + com.google.cloud.discoveryengine.v1.ConversationMessageOrBuilder> + getMessagesFieldBuilder() { + if (messagesBuilder_ == null) { + messagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.ConversationMessage, + com.google.cloud.discoveryengine.v1.ConversationMessage.Builder, + com.google.cloud.discoveryengine.v1.ConversationMessageOrBuilder>( + messages_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + messages_ = null; + } + return messagesBuilder_; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000010); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000020); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + @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.discoveryengine.v1.Conversation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.Conversation) + private static final com.google.cloud.discoveryengine.v1.Conversation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.Conversation(); + } + + public static com.google.cloud.discoveryengine.v1.Conversation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Conversation 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.discoveryengine.v1.Conversation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationContext.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationContext.java new file mode 100644 index 000000000000..abd62729da53 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationContext.java @@ -0,0 +1,922 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Defines context of the conversation
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ConversationContext} + */ +public final class ConversationContext extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.ConversationContext) + ConversationContextOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConversationContext.newBuilder() to construct. + private ConversationContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConversationContext() { + contextDocuments_ = com.google.protobuf.LazyStringArrayList.emptyList(); + activeDocument_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConversationContext(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_ConversationContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_ConversationContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ConversationContext.class, + com.google.cloud.discoveryengine.v1.ConversationContext.Builder.class); + } + + public static final int CONTEXT_DOCUMENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList contextDocuments_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @return A list containing the contextDocuments. + */ + public com.google.protobuf.ProtocolStringList getContextDocumentsList() { + return contextDocuments_; + } + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @return The count of contextDocuments. + */ + public int getContextDocumentsCount() { + return contextDocuments_.size(); + } + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the element to return. + * @return The contextDocuments at the given index. + */ + public java.lang.String getContextDocuments(int index) { + return contextDocuments_.get(index); + } + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the value to return. + * @return The bytes of the contextDocuments at the given index. + */ + public com.google.protobuf.ByteString getContextDocumentsBytes(int index) { + return contextDocuments_.getByteString(index); + } + + public static final int ACTIVE_DOCUMENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object activeDocument_ = ""; + /** + * + * + *
+   * The current active document the user opened.
+   * It contains the document resource reference.
+   * 
+ * + * string active_document = 2; + * + * @return The activeDocument. + */ + @java.lang.Override + public java.lang.String getActiveDocument() { + java.lang.Object ref = activeDocument_; + 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(); + activeDocument_ = s; + return s; + } + } + /** + * + * + *
+   * The current active document the user opened.
+   * It contains the document resource reference.
+   * 
+ * + * string active_document = 2; + * + * @return The bytes for activeDocument. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActiveDocumentBytes() { + java.lang.Object ref = activeDocument_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeDocument_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < contextDocuments_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, contextDocuments_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(activeDocument_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, activeDocument_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < contextDocuments_.size(); i++) { + dataSize += computeStringSizeNoTag(contextDocuments_.getRaw(i)); + } + size += dataSize; + size += 1 * getContextDocumentsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(activeDocument_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, activeDocument_); + } + 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.discoveryengine.v1.ConversationContext)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.ConversationContext other = + (com.google.cloud.discoveryengine.v1.ConversationContext) obj; + + if (!getContextDocumentsList().equals(other.getContextDocumentsList())) return false; + if (!getActiveDocument().equals(other.getActiveDocument())) 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 (getContextDocumentsCount() > 0) { + hash = (37 * hash) + CONTEXT_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getContextDocumentsList().hashCode(); + } + hash = (37 * hash) + ACTIVE_DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getActiveDocument().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.ConversationContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConversationContext 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.discoveryengine.v1.ConversationContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConversationContext 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.discoveryengine.v1.ConversationContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConversationContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.ConversationContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConversationContext 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.discoveryengine.v1.ConversationContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConversationContext 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.discoveryengine.v1.ConversationContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConversationContext 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.discoveryengine.v1.ConversationContext 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; + } + /** + * + * + *
+   * Defines context of the conversation
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ConversationContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.ConversationContext) + com.google.cloud.discoveryengine.v1.ConversationContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_ConversationContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_ConversationContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ConversationContext.class, + com.google.cloud.discoveryengine.v1.ConversationContext.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.ConversationContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + contextDocuments_ = com.google.protobuf.LazyStringArrayList.emptyList(); + activeDocument_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_ConversationContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationContext getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.ConversationContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationContext build() { + com.google.cloud.discoveryengine.v1.ConversationContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationContext buildPartial() { + com.google.cloud.discoveryengine.v1.ConversationContext result = + new com.google.cloud.discoveryengine.v1.ConversationContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1.ConversationContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + contextDocuments_.makeImmutable(); + result.contextDocuments_ = contextDocuments_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.activeDocument_ = activeDocument_; + } + } + + @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.discoveryengine.v1.ConversationContext) { + return mergeFrom((com.google.cloud.discoveryengine.v1.ConversationContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.ConversationContext other) { + if (other == com.google.cloud.discoveryengine.v1.ConversationContext.getDefaultInstance()) + return this; + if (!other.contextDocuments_.isEmpty()) { + if (contextDocuments_.isEmpty()) { + contextDocuments_ = other.contextDocuments_; + bitField0_ |= 0x00000001; + } else { + ensureContextDocumentsIsMutable(); + contextDocuments_.addAll(other.contextDocuments_); + } + onChanged(); + } + if (!other.getActiveDocument().isEmpty()) { + activeDocument_ = other.activeDocument_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureContextDocumentsIsMutable(); + contextDocuments_.add(s); + break; + } // case 10 + case 18: + { + activeDocument_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList contextDocuments_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureContextDocumentsIsMutable() { + if (!contextDocuments_.isModifiable()) { + contextDocuments_ = new com.google.protobuf.LazyStringArrayList(contextDocuments_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @return A list containing the contextDocuments. + */ + public com.google.protobuf.ProtocolStringList getContextDocumentsList() { + contextDocuments_.makeImmutable(); + return contextDocuments_; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @return The count of contextDocuments. + */ + public int getContextDocumentsCount() { + return contextDocuments_.size(); + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the element to return. + * @return The contextDocuments at the given index. + */ + public java.lang.String getContextDocuments(int index) { + return contextDocuments_.get(index); + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the value to return. + * @return The bytes of the contextDocuments at the given index. + */ + public com.google.protobuf.ByteString getContextDocumentsBytes(int index) { + return contextDocuments_.getByteString(index); + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param index The index to set the value at. + * @param value The contextDocuments to set. + * @return This builder for chaining. + */ + public Builder setContextDocuments(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextDocumentsIsMutable(); + contextDocuments_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param value The contextDocuments to add. + * @return This builder for chaining. + */ + public Builder addContextDocuments(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextDocumentsIsMutable(); + contextDocuments_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param values The contextDocuments to add. + * @return This builder for chaining. + */ + public Builder addAllContextDocuments(java.lang.Iterable values) { + ensureContextDocumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contextDocuments_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @return This builder for chaining. + */ + public Builder clearContextDocuments() { + contextDocuments_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param value The bytes of the contextDocuments to add. + * @return This builder for chaining. + */ + public Builder addContextDocumentsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureContextDocumentsIsMutable(); + contextDocuments_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object activeDocument_ = ""; + /** + * + * + *
+     * The current active document the user opened.
+     * It contains the document resource reference.
+     * 
+ * + * string active_document = 2; + * + * @return The activeDocument. + */ + public java.lang.String getActiveDocument() { + java.lang.Object ref = activeDocument_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeDocument_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The current active document the user opened.
+     * It contains the document resource reference.
+     * 
+ * + * string active_document = 2; + * + * @return The bytes for activeDocument. + */ + public com.google.protobuf.ByteString getActiveDocumentBytes() { + java.lang.Object ref = activeDocument_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeDocument_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The current active document the user opened.
+     * It contains the document resource reference.
+     * 
+ * + * string active_document = 2; + * + * @param value The activeDocument to set. + * @return This builder for chaining. + */ + public Builder setActiveDocument(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + activeDocument_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The current active document the user opened.
+     * It contains the document resource reference.
+     * 
+ * + * string active_document = 2; + * + * @return This builder for chaining. + */ + public Builder clearActiveDocument() { + activeDocument_ = getDefaultInstance().getActiveDocument(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The current active document the user opened.
+     * It contains the document resource reference.
+     * 
+ * + * string active_document = 2; + * + * @param value The bytes for activeDocument to set. + * @return This builder for chaining. + */ + public Builder setActiveDocumentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + activeDocument_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.ConversationContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.ConversationContext) + private static final com.google.cloud.discoveryengine.v1.ConversationContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.ConversationContext(); + } + + public static com.google.cloud.discoveryengine.v1.ConversationContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConversationContext 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.discoveryengine.v1.ConversationContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationContextOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationContextOrBuilder.java new file mode 100644 index 000000000000..2d48e1469255 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationContextOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +public interface ConversationContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.ConversationContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @return A list containing the contextDocuments. + */ + java.util.List getContextDocumentsList(); + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @return The count of contextDocuments. + */ + int getContextDocumentsCount(); + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the element to return. + * @return The contextDocuments at the given index. + */ + java.lang.String getContextDocuments(int index); + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the value to return. + * @return The bytes of the contextDocuments at the given index. + */ + com.google.protobuf.ByteString getContextDocumentsBytes(int index); + + /** + * + * + *
+   * The current active document the user opened.
+   * It contains the document resource reference.
+   * 
+ * + * string active_document = 2; + * + * @return The activeDocument. + */ + java.lang.String getActiveDocument(); + /** + * + * + *
+   * The current active document the user opened.
+   * It contains the document resource reference.
+   * 
+ * + * string active_document = 2; + * + * @return The bytes for activeDocument. + */ + com.google.protobuf.ByteString getActiveDocumentBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationMessage.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationMessage.java new file mode 100644 index 000000000000..1881d09e693b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationMessage.java @@ -0,0 +1,1393 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Defines a conversation message.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ConversationMessage} + */ +public final class ConversationMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.ConversationMessage) + ConversationMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConversationMessage.newBuilder() to construct. + private ConversationMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConversationMessage() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConversationMessage(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_ConversationMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_ConversationMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ConversationMessage.class, + com.google.cloud.discoveryengine.v1.ConversationMessage.Builder.class); + } + + private int messageCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object message_; + + public enum MessageCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + USER_INPUT(1), + REPLY(2), + MESSAGE_NOT_SET(0); + private final int value; + + private MessageCase(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 MessageCase valueOf(int value) { + return forNumber(value); + } + + public static MessageCase forNumber(int value) { + switch (value) { + case 1: + return USER_INPUT; + case 2: + return REPLY; + case 0: + return MESSAGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public static final int USER_INPUT_FIELD_NUMBER = 1; + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + * + * @return Whether the userInput field is set. + */ + @java.lang.Override + public boolean hasUserInput() { + return messageCase_ == 1; + } + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + * + * @return The userInput. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.TextInput getUserInput() { + if (messageCase_ == 1) { + return (com.google.cloud.discoveryengine.v1.TextInput) message_; + } + return com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance(); + } + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.TextInputOrBuilder getUserInputOrBuilder() { + if (messageCase_ == 1) { + return (com.google.cloud.discoveryengine.v1.TextInput) message_; + } + return com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance(); + } + + public static final int REPLY_FIELD_NUMBER = 2; + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + * + * @return Whether the reply field is set. + */ + @java.lang.Override + public boolean hasReply() { + return messageCase_ == 2; + } + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + * + * @return The reply. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Reply getReply() { + if (messageCase_ == 2) { + return (com.google.cloud.discoveryengine.v1.Reply) message_; + } + return com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance(); + } + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ReplyOrBuilder getReplyOrBuilder() { + if (messageCase_ == 2) { + return (com.google.cloud.discoveryengine.v1.Reply) message_; + } + return com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 (messageCase_ == 1) { + output.writeMessage(1, (com.google.cloud.discoveryengine.v1.TextInput) message_); + } + if (messageCase_ == 2) { + output.writeMessage(2, (com.google.cloud.discoveryengine.v1.Reply) message_); + } + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (messageCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.discoveryengine.v1.TextInput) message_); + } + if (messageCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.discoveryengine.v1.Reply) message_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + 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.discoveryengine.v1.ConversationMessage)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.ConversationMessage other = + (com.google.cloud.discoveryengine.v1.ConversationMessage) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getMessageCase().equals(other.getMessageCase())) return false; + switch (messageCase_) { + case 1: + if (!getUserInput().equals(other.getUserInput())) return false; + break; + case 2: + if (!getReply().equals(other.getReply())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + switch (messageCase_) { + case 1: + hash = (37 * hash) + USER_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getUserInput().hashCode(); + break; + case 2: + hash = (37 * hash) + REPLY_FIELD_NUMBER; + hash = (53 * hash) + getReply().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.ConversationMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConversationMessage 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.discoveryengine.v1.ConversationMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConversationMessage 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.discoveryengine.v1.ConversationMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConversationMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.ConversationMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConversationMessage 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.discoveryengine.v1.ConversationMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConversationMessage 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.discoveryengine.v1.ConversationMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConversationMessage 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.discoveryengine.v1.ConversationMessage 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; + } + /** + * + * + *
+   * Defines a conversation message.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ConversationMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.ConversationMessage) + com.google.cloud.discoveryengine.v1.ConversationMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_ConversationMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_ConversationMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ConversationMessage.class, + com.google.cloud.discoveryengine.v1.ConversationMessage.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.ConversationMessage.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (userInputBuilder_ != null) { + userInputBuilder_.clear(); + } + if (replyBuilder_ != null) { + replyBuilder_.clear(); + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + messageCase_ = 0; + message_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_ConversationMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationMessage getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.ConversationMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationMessage build() { + com.google.cloud.discoveryengine.v1.ConversationMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationMessage buildPartial() { + com.google.cloud.discoveryengine.v1.ConversationMessage result = + new com.google.cloud.discoveryengine.v1.ConversationMessage(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1.ConversationMessage result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1.ConversationMessage result) { + result.messageCase_ = messageCase_; + result.message_ = this.message_; + if (messageCase_ == 1 && userInputBuilder_ != null) { + result.message_ = userInputBuilder_.build(); + } + if (messageCase_ == 2 && replyBuilder_ != null) { + result.message_ = replyBuilder_.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.discoveryengine.v1.ConversationMessage) { + return mergeFrom((com.google.cloud.discoveryengine.v1.ConversationMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.ConversationMessage other) { + if (other == com.google.cloud.discoveryengine.v1.ConversationMessage.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + switch (other.getMessageCase()) { + case USER_INPUT: + { + mergeUserInput(other.getUserInput()); + break; + } + case REPLY: + { + mergeReply(other.getReply()); + break; + } + case MESSAGE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUserInputFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getReplyFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int messageCase_ = 0; + private java.lang.Object message_; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public Builder clearMessage() { + messageCase_ = 0; + message_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.TextInput, + com.google.cloud.discoveryengine.v1.TextInput.Builder, + com.google.cloud.discoveryengine.v1.TextInputOrBuilder> + userInputBuilder_; + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + * + * @return Whether the userInput field is set. + */ + @java.lang.Override + public boolean hasUserInput() { + return messageCase_ == 1; + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + * + * @return The userInput. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.TextInput getUserInput() { + if (userInputBuilder_ == null) { + if (messageCase_ == 1) { + return (com.google.cloud.discoveryengine.v1.TextInput) message_; + } + return com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance(); + } else { + if (messageCase_ == 1) { + return userInputBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance(); + } + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + */ + public Builder setUserInput(com.google.cloud.discoveryengine.v1.TextInput value) { + if (userInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + userInputBuilder_.setMessage(value); + } + messageCase_ = 1; + return this; + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + */ + public Builder setUserInput( + com.google.cloud.discoveryengine.v1.TextInput.Builder builderForValue) { + if (userInputBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + userInputBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 1; + return this; + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + */ + public Builder mergeUserInput(com.google.cloud.discoveryengine.v1.TextInput value) { + if (userInputBuilder_ == null) { + if (messageCase_ == 1 + && message_ != com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance()) { + message_ = + com.google.cloud.discoveryengine.v1.TextInput.newBuilder( + (com.google.cloud.discoveryengine.v1.TextInput) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 1) { + userInputBuilder_.mergeFrom(value); + } else { + userInputBuilder_.setMessage(value); + } + } + messageCase_ = 1; + return this; + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + */ + public Builder clearUserInput() { + if (userInputBuilder_ == null) { + if (messageCase_ == 1) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 1) { + messageCase_ = 0; + message_ = null; + } + userInputBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + */ + public com.google.cloud.discoveryengine.v1.TextInput.Builder getUserInputBuilder() { + return getUserInputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.TextInputOrBuilder getUserInputOrBuilder() { + if ((messageCase_ == 1) && (userInputBuilder_ != null)) { + return userInputBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 1) { + return (com.google.cloud.discoveryengine.v1.TextInput) message_; + } + return com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance(); + } + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.TextInput, + com.google.cloud.discoveryengine.v1.TextInput.Builder, + com.google.cloud.discoveryengine.v1.TextInputOrBuilder> + getUserInputFieldBuilder() { + if (userInputBuilder_ == null) { + if (!(messageCase_ == 1)) { + message_ = com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance(); + } + userInputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.TextInput, + com.google.cloud.discoveryengine.v1.TextInput.Builder, + com.google.cloud.discoveryengine.v1.TextInputOrBuilder>( + (com.google.cloud.discoveryengine.v1.TextInput) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 1; + onChanged(); + return userInputBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Reply, + com.google.cloud.discoveryengine.v1.Reply.Builder, + com.google.cloud.discoveryengine.v1.ReplyOrBuilder> + replyBuilder_; + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + * + * @return Whether the reply field is set. + */ + @java.lang.Override + public boolean hasReply() { + return messageCase_ == 2; + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + * + * @return The reply. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Reply getReply() { + if (replyBuilder_ == null) { + if (messageCase_ == 2) { + return (com.google.cloud.discoveryengine.v1.Reply) message_; + } + return com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance(); + } else { + if (messageCase_ == 2) { + return replyBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance(); + } + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + */ + public Builder setReply(com.google.cloud.discoveryengine.v1.Reply value) { + if (replyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + replyBuilder_.setMessage(value); + } + messageCase_ = 2; + return this; + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + */ + public Builder setReply(com.google.cloud.discoveryengine.v1.Reply.Builder builderForValue) { + if (replyBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + replyBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 2; + return this; + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + */ + public Builder mergeReply(com.google.cloud.discoveryengine.v1.Reply value) { + if (replyBuilder_ == null) { + if (messageCase_ == 2 + && message_ != com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance()) { + message_ = + com.google.cloud.discoveryengine.v1.Reply.newBuilder( + (com.google.cloud.discoveryengine.v1.Reply) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 2) { + replyBuilder_.mergeFrom(value); + } else { + replyBuilder_.setMessage(value); + } + } + messageCase_ = 2; + return this; + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + */ + public Builder clearReply() { + if (replyBuilder_ == null) { + if (messageCase_ == 2) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 2) { + messageCase_ = 0; + message_ = null; + } + replyBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + */ + public com.google.cloud.discoveryengine.v1.Reply.Builder getReplyBuilder() { + return getReplyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ReplyOrBuilder getReplyOrBuilder() { + if ((messageCase_ == 2) && (replyBuilder_ != null)) { + return replyBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 2) { + return (com.google.cloud.discoveryengine.v1.Reply) message_; + } + return com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance(); + } + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Reply, + com.google.cloud.discoveryengine.v1.Reply.Builder, + com.google.cloud.discoveryengine.v1.ReplyOrBuilder> + getReplyFieldBuilder() { + if (replyBuilder_ == null) { + if (!(messageCase_ == 2)) { + message_ = com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance(); + } + replyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Reply, + com.google.cloud.discoveryengine.v1.Reply.Builder, + com.google.cloud.discoveryengine.v1.ReplyOrBuilder>( + (com.google.cloud.discoveryengine.v1.Reply) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 2; + onChanged(); + return replyBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + @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.discoveryengine.v1.ConversationMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.ConversationMessage) + private static final com.google.cloud.discoveryengine.v1.ConversationMessage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.ConversationMessage(); + } + + public static com.google.cloud.discoveryengine.v1.ConversationMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConversationMessage 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.discoveryengine.v1.ConversationMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationMessageOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationMessageOrBuilder.java new file mode 100644 index 000000000000..5d82e323107f --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationMessageOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +public interface ConversationMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.ConversationMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + * + * @return Whether the userInput field is set. + */ + boolean hasUserInput(); + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + * + * @return The userInput. + */ + com.google.cloud.discoveryengine.v1.TextInput getUserInput(); + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.TextInput user_input = 1; + */ + com.google.cloud.discoveryengine.v1.TextInputOrBuilder getUserInputOrBuilder(); + + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + * + * @return Whether the reply field is set. + */ + boolean hasReply(); + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + * + * @return The reply. + */ + com.google.cloud.discoveryengine.v1.Reply getReply(); + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 2; + */ + com.google.cloud.discoveryengine.v1.ReplyOrBuilder getReplyOrBuilder(); + + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + com.google.cloud.discoveryengine.v1.ConversationMessage.MessageCase getMessageCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationName.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationName.java new file mode 100644 index 000000000000..80b27af53338 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationName.java @@ -0,0 +1,432 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ConversationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DATA_STORE_CONVERSATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}"); + private static final PathTemplate PROJECT_LOCATION_COLLECTION_DATA_STORE_CONVERSATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String dataStore; + private final String conversation; + private final String collection; + + @Deprecated + protected ConversationName() { + project = null; + location = null; + dataStore = null; + conversation = null; + collection = null; + } + + private ConversationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + conversation = Preconditions.checkNotNull(builder.getConversation()); + collection = null; + pathTemplate = PROJECT_LOCATION_DATA_STORE_CONVERSATION; + } + + private ConversationName(ProjectLocationCollectionDataStoreConversationBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + collection = Preconditions.checkNotNull(builder.getCollection()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + conversation = Preconditions.checkNotNull(builder.getConversation()); + pathTemplate = PROJECT_LOCATION_COLLECTION_DATA_STORE_CONVERSATION; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getConversation() { + return conversation; + } + + public String getCollection() { + return collection; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationDataStoreConversationBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationCollectionDataStoreConversationBuilder + newProjectLocationCollectionDataStoreConversationBuilder() { + return new ProjectLocationCollectionDataStoreConversationBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ConversationName of( + String project, String location, String dataStore, String conversation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setConversation(conversation) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ConversationName ofProjectLocationDataStoreConversationName( + String project, String location, String dataStore, String conversation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setConversation(conversation) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ConversationName ofProjectLocationCollectionDataStoreConversationName( + String project, String location, String collection, String dataStore, String conversation) { + return newProjectLocationCollectionDataStoreConversationBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setConversation(conversation) + .build(); + } + + public static String format( + String project, String location, String dataStore, String conversation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setConversation(conversation) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationDataStoreConversationName( + String project, String location, String dataStore, String conversation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setConversation(conversation) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationCollectionDataStoreConversationName( + String project, String location, String collection, String dataStore, String conversation) { + return newProjectLocationCollectionDataStoreConversationBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setConversation(conversation) + .build() + .toString(); + } + + public static ConversationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_DATA_STORE_CONVERSATION.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_DATA_STORE_CONVERSATION.match(formattedString); + return ofProjectLocationDataStoreConversationName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("data_store"), + matchMap.get("conversation")); + } else if (PROJECT_LOCATION_COLLECTION_DATA_STORE_CONVERSATION.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_COLLECTION_DATA_STORE_CONVERSATION.match(formattedString); + return ofProjectLocationCollectionDataStoreConversationName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("collection"), + matchMap.get("data_store"), + matchMap.get("conversation")); + } + throw new ValidationException("ConversationName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ConversationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DATA_STORE_CONVERSATION.matches(formattedString) + || PROJECT_LOCATION_COLLECTION_DATA_STORE_CONVERSATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (dataStore != null) { + fieldMapBuilder.put("data_store", dataStore); + } + if (conversation != null) { + fieldMapBuilder.put("conversation", conversation); + } + if (collection != null) { + fieldMapBuilder.put("collection", collection); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ConversationName that = ((ConversationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.dataStore, that.dataStore) + && Objects.equals(this.conversation, that.conversation) + && Objects.equals(this.collection, that.collection); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dataStore); + h *= 1000003; + h ^= Objects.hashCode(conversation); + h *= 1000003; + h ^= Objects.hashCode(collection); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}. + */ + public static class Builder { + private String project; + private String location; + private String dataStore; + private String conversation; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getConversation() { + return conversation; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public Builder setConversation(String conversation) { + this.conversation = conversation; + return this; + } + + private Builder(ConversationName conversationName) { + Preconditions.checkArgument( + Objects.equals(conversationName.pathTemplate, PROJECT_LOCATION_DATA_STORE_CONVERSATION), + "toBuilder is only supported when ConversationName has the pattern of projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}"); + this.project = conversationName.project; + this.location = conversationName.location; + this.dataStore = conversationName.dataStore; + this.conversation = conversationName.conversation; + } + + public ConversationName build() { + return new ConversationName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationCollectionDataStoreConversationBuilder { + private String project; + private String location; + private String collection; + private String dataStore; + private String conversation; + + protected ProjectLocationCollectionDataStoreConversationBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollection() { + return collection; + } + + public String getDataStore() { + return dataStore; + } + + public String getConversation() { + return conversation; + } + + public ProjectLocationCollectionDataStoreConversationBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationCollectionDataStoreConversationBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationCollectionDataStoreConversationBuilder setCollection(String collection) { + this.collection = collection; + return this; + } + + public ProjectLocationCollectionDataStoreConversationBuilder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public ProjectLocationCollectionDataStoreConversationBuilder setConversation( + String conversation) { + this.conversation = conversation; + return this; + } + + public ConversationName build() { + return new ConversationName(this); + } + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationOrBuilder.java new file mode 100644 index 000000000000..c6746f16016d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationOrBuilder.java @@ -0,0 +1,230 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +public interface ConversationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.Conversation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Fully qualified name
+   * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Fully qualified name
+   * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The state of the Conversation.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the Conversation.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation.State state = 2; + * + * @return The state. + */ + com.google.cloud.discoveryengine.v1.Conversation.State getState(); + + /** + * + * + *
+   * A unique identifier for tracking users.
+   * 
+ * + * string user_pseudo_id = 3; + * + * @return The userPseudoId. + */ + java.lang.String getUserPseudoId(); + /** + * + * + *
+   * A unique identifier for tracking users.
+   * 
+ * + * string user_pseudo_id = 3; + * + * @return The bytes for userPseudoId. + */ + com.google.protobuf.ByteString getUserPseudoIdBytes(); + + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + java.util.List getMessagesList(); + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + com.google.cloud.discoveryengine.v1.ConversationMessage getMessages(int index); + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + int getMessagesCount(); + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + java.util.List + getMessagesOrBuilderList(); + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.ConversationMessage messages = 4; + */ + com.google.cloud.discoveryengine.v1.ConversationMessageOrBuilder getMessagesOrBuilder(int index); + + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationProto.java new file mode 100644 index 000000000000..d1140f931d53 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationProto.java @@ -0,0 +1,163 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +public final class ConversationProto { + private ConversationProto() {} + + 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_discoveryengine_v1_Conversation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_Conversation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_Reply_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_Reply_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_ConversationContext_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_ConversationContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_TextInput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_TextInput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_ConversationMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_ConversationMessage_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n2google/cloud/discoveryengine/v1/conver" + + "sation.proto\022\037google.cloud.discoveryengi" + + "ne.v1\032\037google/api/field_behavior.proto\032\031" + + "google/api/resource.proto\0324google/cloud/" + + "discoveryengine/v1/search_service.proto\032" + + "\037google/protobuf/timestamp.proto\"\371\004\n\014Con" + + "versation\022\022\n\004name\030\001 \001(\tB\004\342A\001\005\022B\n\005state\030\002" + + " \001(\01623.google.cloud.discoveryengine.v1.C" + + "onversation.State\022\026\n\016user_pseudo_id\030\003 \001(" + + "\t\022F\n\010messages\030\004 \003(\01324.google.cloud.disco" + + "veryengine.v1.ConversationMessage\0224\n\nsta" + + "rt_time\030\005 \001(\0132\032.google.protobuf.Timestam" + + "pB\004\342A\001\003\0222\n\010end_time\030\006 \001(\0132\032.google.proto" + + "buf.TimestampB\004\342A\001\003\">\n\005State\022\025\n\021STATE_UN" + + "SPECIFIED\020\000\022\017\n\013IN_PROGRESS\020\001\022\r\n\tCOMPLETE" + + "D\020\002:\206\002\352A\202\002\n+discoveryengine.googleapis.c" + + "om/Conversation\022\\projects/{project}/loca" + + "tions/{location}/dataStores/{data_store}" + + "/conversations/{conversation}\022uprojects/" + + "{project}/locations/{location}/collectio" + + "ns/{collection}/dataStores/{data_store}/" + + "conversations/{conversation}\"Q\n\005Reply\022H\n" + + "\007summary\030\003 \001(\01327.google.cloud.discoverye" + + "ngine.v1.SearchResponse.Summary\"I\n\023Conve" + + "rsationContext\022\031\n\021context_documents\030\001 \003(" + + "\t\022\027\n\017active_document\030\002 \001(\t\"a\n\tTextInput\022" + + "\r\n\005input\030\001 \001(\t\022E\n\007context\030\002 \001(\01324.google" + + ".cloud.discoveryengine.v1.ConversationCo" + + "ntext\"\322\001\n\023ConversationMessage\022@\n\nuser_in" + + "put\030\001 \001(\0132*.google.cloud.discoveryengine" + + ".v1.TextInputH\000\0227\n\005reply\030\002 \001(\0132&.google." + + "cloud.discoveryengine.v1.ReplyH\000\0225\n\013crea" + + "te_time\030\003 \001(\0132\032.google.protobuf.Timestam" + + "pB\004\342A\001\003B\t\n\007messageB\204\002\n#com.google.cloud." + + "discoveryengine.v1B\021ConversationProtoP\001Z" + + "Mcloud.google.com/go/discoveryengine/api" + + "v1/discoveryenginepb;discoveryenginepb\242\002" + + "\017DISCOVERYENGINE\252\002\037Google.Cloud.Discover" + + "yEngine.V1\312\002\037Google\\Cloud\\DiscoveryEngin" + + "e\\V1\352\002\"Google::Cloud::DiscoveryEngine::V" + + "1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.discoveryengine.v1.SearchServiceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1_Conversation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1_Conversation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_Conversation_descriptor, + new java.lang.String[] { + "Name", "State", "UserPseudoId", "Messages", "StartTime", "EndTime", + }); + internal_static_google_cloud_discoveryengine_v1_Reply_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1_Reply_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_Reply_descriptor, + new java.lang.String[] { + "Summary", + }); + internal_static_google_cloud_discoveryengine_v1_ConversationContext_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_discoveryengine_v1_ConversationContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_ConversationContext_descriptor, + new java.lang.String[] { + "ContextDocuments", "ActiveDocument", + }); + internal_static_google_cloud_discoveryengine_v1_TextInput_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_discoveryengine_v1_TextInput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_TextInput_descriptor, + new java.lang.String[] { + "Input", "Context", + }); + internal_static_google_cloud_discoveryengine_v1_ConversationMessage_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_discoveryengine_v1_ConversationMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_ConversationMessage_descriptor, + new java.lang.String[] { + "UserInput", "Reply", "CreateTime", "Message", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.discoveryengine.v1.SearchServiceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceProto.java new file mode 100644 index 000000000000..ba23c7f8b37d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConversationalSearchServiceProto.java @@ -0,0 +1,298 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +public final class ConversationalSearchServiceProto { + private ConversationalSearchServiceProto() {} + + 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_discoveryengine_v1_ConverseConversationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_UserLabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_UserLabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_ConverseConversationResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_ConverseConversationResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_CreateConversationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_CreateConversationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_UpdateConversationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_UpdateConversationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_DeleteConversationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_DeleteConversationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_GetConversationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_GetConversationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_ListConversationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_ListConversationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_ListConversationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_ListConversationsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nCgoogle/cloud/discoveryengine/v1/conver" + + "sational_search_service.proto\022\037google.cl" + + "oud.discoveryengine.v1\032\034google/api/annot" + + "ations.proto\032\027google/api/client.proto\032\037g" + + "oogle/api/field_behavior.proto\032\031google/a" + + "pi/resource.proto\0322google/cloud/discover" + + "yengine/v1/conversation.proto\0324google/cl" + + "oud/discoveryengine/v1/search_service.pr" + + "oto\032\033google/protobuf/empty.proto\032 google" + + "/protobuf/field_mask.proto\"\301\004\n\033ConverseC" + + "onversationRequest\022B\n\004name\030\001 \001(\tB4\342A\001\002\372A" + + "-\n+discoveryengine.googleapis.com/Conver" + + "sation\022?\n\005query\030\002 \001(\0132*.google.cloud.dis" + + "coveryengine.v1.TextInputB\004\342A\001\002\022I\n\016servi" + + "ng_config\030\003 \001(\tB1\372A.\n,discoveryengine.go" + + "ogleapis.com/ServingConfig\022C\n\014conversati" + + "on\030\005 \001(\0132-.google.cloud.discoveryengine." + + "v1.Conversation\022\023\n\013safe_search\030\006 \001(\010\022a\n\013" + + "user_labels\030\007 \003(\0132L.google.cloud.discove" + + "ryengine.v1.ConverseConversationRequest." + + "UserLabelsEntry\022b\n\014summary_spec\030\010 \001(\0132L." + + "google.cloud.discoveryengine.v1.SearchRe" + + "quest.ContentSearchSpec.SummarySpec\0321\n\017U" + + "serLabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\t:\0028\001\"\360\001\n\034ConverseConversationResponse\022" + + "5\n\005reply\030\001 \001(\0132&.google.cloud.discoverye" + + "ngine.v1.Reply\022C\n\014conversation\030\002 \001(\0132-.g" + + "oogle.cloud.discoveryengine.v1.Conversat" + + "ion\022T\n\016search_results\030\003 \003(\0132<.google.clo" + + "ud.discoveryengine.v1.SearchResponse.Sea" + + "rchResult\"\251\001\n\031CreateConversationRequest\022" + + "A\n\006parent\030\001 \001(\tB1\342A\001\002\372A*\n(discoveryengin" + + "e.googleapis.com/DataStore\022I\n\014conversati" + + "on\030\002 \001(\0132-.google.cloud.discoveryengine." + + "v1.ConversationB\004\342A\001\002\"\227\001\n\031UpdateConversa" + + "tionRequest\022I\n\014conversation\030\001 \001(\0132-.goog" + + "le.cloud.discoveryengine.v1.Conversation" + + "B\004\342A\001\002\022/\n\013update_mask\030\002 \001(\0132\032.google.pro" + + "tobuf.FieldMask\"_\n\031DeleteConversationReq" + + "uest\022B\n\004name\030\001 \001(\tB4\342A\001\002\372A-\n+discoveryen" + + "gine.googleapis.com/Conversation\"\\\n\026GetC" + + "onversationRequest\022B\n\004name\030\001 \001(\tB4\342A\001\002\372A" + + "-\n+discoveryengine.googleapis.com/Conver" + + "sation\"\246\001\n\030ListConversationsRequest\022A\n\006p" + + "arent\030\001 \001(\tB1\342A\001\002\372A*\n(discoveryengine.go" + + "ogleapis.com/DataStore\022\021\n\tpage_size\030\002 \001(" + + "\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n" + + "\010order_by\030\005 \001(\t\"z\n\031ListConversationsResp" + + "onse\022D\n\rconversations\030\001 \003(\0132-.google.clo" + + "ud.discoveryengine.v1.Conversation\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t2\332\017\n\033ConversationalSe" + + "archService\022\322\002\n\024ConverseConversation\022<.g" + + "oogle.cloud.discoveryengine.v1.ConverseC" + + "onversationRequest\032=.google.cloud.discov" + + "eryengine.v1.ConverseConversationRespons" + + "e\"\274\001\332A\nname,query\202\323\344\223\002\250\001\"G/v1/{name=proj" + + "ects/*/locations/*/dataStores/*/conversa" + + "tions/*}:converse:\001*ZZ\"U/v1/{name=projec" + + "ts/*/locations/*/collections/*/dataStore" + + "s/*/conversations/*}:converse:\001*\022\313\002\n\022Cre" + + "ateConversation\022:.google.cloud.discovery" + + "engine.v1.CreateConversationRequest\032-.go" + + "ogle.cloud.discoveryengine.v1.Conversati" + + "on\"\311\001\332A\023parent,conversation\202\323\344\223\002\254\001\">/v1/" + + "{parent=projects/*/locations/*/dataStore" + + "s/*}/conversations:\014conversationZ\\\"L/v1/" + + "{parent=projects/*/locations/*/collectio" + + "ns/*/dataStores/*}/conversations:\014conver" + + "sation\022\211\002\n\022DeleteConversation\022:.google.c" + + "loud.discoveryengine.v1.DeleteConversati" + + "onRequest\032\026.google.protobuf.Empty\"\236\001\332A\004n" + + "ame\202\323\344\223\002\220\001*>/v1/{name=projects/*/locatio" + + "ns/*/dataStores/*/conversations/*}ZN*L/v" + + "1/{name=projects/*/locations/*/collectio" + + "ns/*/dataStores/*/conversations/*}\022\352\002\n\022U" + + "pdateConversation\022:.google.cloud.discove" + + "ryengine.v1.UpdateConversationRequest\032-." + + "google.cloud.discoveryengine.v1.Conversa" + + "tion\"\350\001\332A\030conversation,update_mask\202\323\344\223\002\306" + + "\0012K/v1/{conversation.name=projects/*/loc" + + "ations/*/dataStores/*/conversations/*}:\014" + + "conversationZi2Y/v1/{conversation.name=p" + + "rojects/*/locations/*/collections/*/data" + + "Stores/*/conversations/*}:\014conversation\022" + + "\232\002\n\017GetConversation\0227.google.cloud.disco" + + "veryengine.v1.GetConversationRequest\032-.g" + + "oogle.cloud.discoveryengine.v1.Conversat" + + "ion\"\236\001\332A\004name\202\323\344\223\002\220\001\022>/v1/{name=projects" + + "/*/locations/*/dataStores/*/conversation" + + "s/*}ZN\022L/v1/{name=projects/*/locations/*" + + "/collections/*/dataStores/*/conversation" + + "s/*}\022\255\002\n\021ListConversations\0229.google.clou" + + "d.discoveryengine.v1.ListConversationsRe" + + "quest\032:.google.cloud.discoveryengine.v1." + + "ListConversationsResponse\"\240\001\332A\006parent\202\323\344" + + "\223\002\220\001\022>/v1/{parent=projects/*/locations/*" + + "/dataStores/*}/conversationsZN\022L/v1/{par" + + "ent=projects/*/locations/*/collections/*" + + "/dataStores/*}/conversations\032R\312A\036discove" + + "ryengine.googleapis.com\322A.https://www.go" + + "ogleapis.com/auth/cloud-platformB\223\002\n#com" + + ".google.cloud.discoveryengine.v1B Conver" + + "sationalSearchServiceProtoP\001ZMcloud.goog" + + "le.com/go/discoveryengine/apiv1/discover" + + "yenginepb;discoveryenginepb\242\002\017DISCOVERYE" + + "NGINE\252\002\037Google.Cloud.DiscoveryEngine.V1\312" + + "\002\037Google\\Cloud\\DiscoveryEngine\\V1\352\002\"Goog" + + "le::Cloud::DiscoveryEngine::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.discoveryengine.v1.ConversationProto.getDescriptor(), + com.google.cloud.discoveryengine.v1.SearchServiceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_descriptor, + new java.lang.String[] { + "Name", + "Query", + "ServingConfig", + "Conversation", + "SafeSearch", + "UserLabels", + "SummarySpec", + }); + internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_UserLabelsEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_UserLabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_UserLabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_discoveryengine_v1_ConverseConversationResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1_ConverseConversationResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_ConverseConversationResponse_descriptor, + new java.lang.String[] { + "Reply", "Conversation", "SearchResults", + }); + internal_static_google_cloud_discoveryengine_v1_CreateConversationRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_discoveryengine_v1_CreateConversationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_CreateConversationRequest_descriptor, + new java.lang.String[] { + "Parent", "Conversation", + }); + internal_static_google_cloud_discoveryengine_v1_UpdateConversationRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_discoveryengine_v1_UpdateConversationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_UpdateConversationRequest_descriptor, + new java.lang.String[] { + "Conversation", "UpdateMask", + }); + internal_static_google_cloud_discoveryengine_v1_DeleteConversationRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_discoveryengine_v1_DeleteConversationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_DeleteConversationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_discoveryengine_v1_GetConversationRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_discoveryengine_v1_GetConversationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_GetConversationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_discoveryengine_v1_ListConversationsRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_discoveryengine_v1_ListConversationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_ListConversationsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_discoveryengine_v1_ListConversationsResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_discoveryengine_v1_ListConversationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_ListConversationsResponse_descriptor, + new java.lang.String[] { + "Conversations", "NextPageToken", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.discoveryengine.v1.ConversationProto.getDescriptor(); + com.google.cloud.discoveryengine.v1.SearchServiceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationRequest.java new file mode 100644 index 000000000000..b8c91a144013 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationRequest.java @@ -0,0 +1,2373 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Request message for
+ * [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1.ConversationalSearchService.ConverseConversation]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ConverseConversationRequest} + */ +public final class ConverseConversationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.ConverseConversationRequest) + ConverseConversationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConverseConversationRequest.newBuilder() to construct. + private ConverseConversationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConverseConversationRequest() { + name_ = ""; + servingConfig_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConverseConversationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ConverseConversationRequest.class, + com.google.cloud.discoveryengine.v1.ConverseConversationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+   * Use
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+   * to activate auto session mode, which automatically creates a new
+   * conversation inside a ConverseConversation session.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+   * Use
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+   * to activate auto session mode, which automatically creates a new
+   * conversation inside a ConverseConversation session.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1.TextInput query_; + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the query field is set. + */ + @java.lang.Override + public boolean hasQuery() { + return query_ != null; + } + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The query. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.TextInput getQuery() { + return query_ == null + ? com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance() + : query_; + } + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.TextInputOrBuilder getQueryOrBuilder() { + return query_ == null + ? com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance() + : query_; + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object servingConfig_ = ""; + /** + * + * + *
+   * The resource name of the Serving Config to use. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+   * If this is not set, the default serving config will be used.
+   * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @return The servingConfig. + */ + @java.lang.Override + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + 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(); + servingConfig_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the Serving Config to use. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+   * If this is not set, the default serving config will be used.
+   * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for servingConfig. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONVERSATION_FIELD_NUMBER = 5; + private com.google.cloud.discoveryengine.v1.Conversation conversation_; + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + * + * @return Whether the conversation field is set. + */ + @java.lang.Override + public boolean hasConversation() { + return conversation_ != null; + } + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + * + * @return The conversation. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Conversation getConversation() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + + public static final int SAFE_SEARCH_FIELD_NUMBER = 6; + private boolean safeSearch_ = false; + /** + * + * + *
+   * Whether to turn on safe search.
+   * 
+ * + * bool safe_search = 6; + * + * @return The safeSearch. + */ + @java.lang.Override + public boolean getSafeSearch() { + return safeSearch_; + } + + public static final int USER_LABELS_FIELD_NUMBER = 7; + + private static final class UserLabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_UserLabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SUMMARY_SPEC_FIELD_NUMBER = 8; + private com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + summarySpec_; + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return Whether the summarySpec field is set. + */ + @java.lang.Override + public boolean hasSummarySpec() { + return summarySpec_ != null; + } + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return The summarySpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec() { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpecOrBuilder + getSummarySpecOrBuilder() { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (query_ != null) { + output.writeMessage(2, getQuery()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, servingConfig_); + } + if (conversation_ != null) { + output.writeMessage(5, getConversation()); + } + if (safeSearch_ != false) { + output.writeBool(6, safeSearch_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 7); + if (summarySpec_ != null) { + output.writeMessage(8, getSummarySpec()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (query_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQuery()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfig_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, servingConfig_); + } + if (conversation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getConversation()); + } + if (safeSearch_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, safeSearch_); + } + for (java.util.Map.Entry entry : + internalGetUserLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry userLabels__ = + UserLabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, userLabels__); + } + if (summarySpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSummarySpec()); + } + 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.discoveryengine.v1.ConverseConversationRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.ConverseConversationRequest other = + (com.google.cloud.discoveryengine.v1.ConverseConversationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasQuery() != other.hasQuery()) return false; + if (hasQuery()) { + if (!getQuery().equals(other.getQuery())) return false; + } + if (!getServingConfig().equals(other.getServingConfig())) return false; + if (hasConversation() != other.hasConversation()) return false; + if (hasConversation()) { + if (!getConversation().equals(other.getConversation())) return false; + } + if (getSafeSearch() != other.getSafeSearch()) return false; + if (!internalGetUserLabels().equals(other.internalGetUserLabels())) return false; + if (hasSummarySpec() != other.hasSummarySpec()) return false; + if (hasSummarySpec()) { + if (!getSummarySpec().equals(other.getSummarySpec())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasQuery()) { + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + } + hash = (37 * hash) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().hashCode(); + if (hasConversation()) { + hash = (37 * hash) + CONVERSATION_FIELD_NUMBER; + hash = (53 * hash) + getConversation().hashCode(); + } + hash = (37 * hash) + SAFE_SEARCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSafeSearch()); + if (!internalGetUserLabels().getMap().isEmpty()) { + hash = (37 * hash) + USER_LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetUserLabels().hashCode(); + } + if (hasSummarySpec()) { + hash = (37 * hash) + SUMMARY_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSummarySpec().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationRequest 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.discoveryengine.v1.ConverseConversationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationRequest 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.discoveryengine.v1.ConverseConversationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationRequest 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.discoveryengine.v1.ConverseConversationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationRequest 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.discoveryengine.v1.ConverseConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationRequest 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.discoveryengine.v1.ConverseConversationRequest 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
+   * [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1.ConversationalSearchService.ConverseConversation]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ConverseConversationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.ConverseConversationRequest) + com.google.cloud.discoveryengine.v1.ConverseConversationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ConverseConversationRequest.class, + com.google.cloud.discoveryengine.v1.ConverseConversationRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.ConverseConversationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + query_ = null; + if (queryBuilder_ != null) { + queryBuilder_.dispose(); + queryBuilder_ = null; + } + servingConfig_ = ""; + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + safeSearch_ = false; + internalGetMutableUserLabels().clear(); + summarySpec_ = null; + if (summarySpecBuilder_ != null) { + summarySpecBuilder_.dispose(); + summarySpecBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConverseConversationRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.ConverseConversationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConverseConversationRequest build() { + com.google.cloud.discoveryengine.v1.ConverseConversationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConverseConversationRequest buildPartial() { + com.google.cloud.discoveryengine.v1.ConverseConversationRequest result = + new com.google.cloud.discoveryengine.v1.ConverseConversationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.ConverseConversationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.query_ = queryBuilder_ == null ? query_ : queryBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.servingConfig_ = servingConfig_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.conversation_ = + conversationBuilder_ == null ? conversation_ : conversationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.safeSearch_ = safeSearch_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.userLabels_ = internalGetUserLabels(); + result.userLabels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.summarySpec_ = + summarySpecBuilder_ == null ? summarySpec_ : summarySpecBuilder_.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.discoveryengine.v1.ConverseConversationRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1.ConverseConversationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.ConverseConversationRequest other) { + if (other + == com.google.cloud.discoveryengine.v1.ConverseConversationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasQuery()) { + mergeQuery(other.getQuery()); + } + if (!other.getServingConfig().isEmpty()) { + servingConfig_ = other.servingConfig_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasConversation()) { + mergeConversation(other.getConversation()); + } + if (other.getSafeSearch() != false) { + setSafeSearch(other.getSafeSearch()); + } + internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); + bitField0_ |= 0x00000020; + if (other.hasSummarySpec()) { + mergeSummarySpec(other.getSummarySpec()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getQueryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + servingConfig_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + input.readMessage(getConversationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 48: + { + safeSearch_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 48 + case 58: + { + com.google.protobuf.MapEntry userLabels__ = + input.readMessage( + UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableUserLabels() + .getMutableMap() + .put(userLabels__.getKey(), userLabels__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 66: + { + input.readMessage(getSummarySpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+     * Use
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+     * to activate auto session mode, which automatically creates a new
+     * conversation inside a ConverseConversation session.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+     * Use
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+     * to activate auto session mode, which automatically creates a new
+     * conversation inside a ConverseConversation session.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+     * Use
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+     * to activate auto session mode, which automatically creates a new
+     * conversation inside a ConverseConversation session.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+     * Use
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+     * to activate auto session mode, which automatically creates a new
+     * conversation inside a ConverseConversation session.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+     * Use
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+     * to activate auto session mode, which automatically creates a new
+     * conversation inside a ConverseConversation session.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1.TextInput query_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.TextInput, + com.google.cloud.discoveryengine.v1.TextInput.Builder, + com.google.cloud.discoveryengine.v1.TextInputOrBuilder> + queryBuilder_; + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the query field is set. + */ + public boolean hasQuery() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The query. + */ + public com.google.cloud.discoveryengine.v1.TextInput getQuery() { + if (queryBuilder_ == null) { + return query_ == null + ? com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance() + : query_; + } else { + return queryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuery(com.google.cloud.discoveryengine.v1.TextInput value) { + if (queryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + query_ = value; + } else { + queryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuery(com.google.cloud.discoveryengine.v1.TextInput.Builder builderForValue) { + if (queryBuilder_ == null) { + query_ = builderForValue.build(); + } else { + queryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQuery(com.google.cloud.discoveryengine.v1.TextInput value) { + if (queryBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && query_ != null + && query_ != com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance()) { + getQueryBuilder().mergeFrom(value); + } else { + query_ = value; + } + } else { + queryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQuery() { + bitField0_ = (bitField0_ & ~0x00000002); + query_ = null; + if (queryBuilder_ != null) { + queryBuilder_.dispose(); + queryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1.TextInput.Builder getQueryBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getQueryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1.TextInputOrBuilder getQueryOrBuilder() { + if (queryBuilder_ != null) { + return queryBuilder_.getMessageOrBuilder(); + } else { + return query_ == null + ? com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance() + : query_; + } + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.TextInput, + com.google.cloud.discoveryengine.v1.TextInput.Builder, + com.google.cloud.discoveryengine.v1.TextInputOrBuilder> + getQueryFieldBuilder() { + if (queryBuilder_ == null) { + queryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.TextInput, + com.google.cloud.discoveryengine.v1.TextInput.Builder, + com.google.cloud.discoveryengine.v1.TextInputOrBuilder>( + getQuery(), getParentForChildren(), isClean()); + query_ = null; + } + return queryBuilder_; + } + + private java.lang.Object servingConfig_ = ""; + /** + * + * + *
+     * The resource name of the Serving Config to use. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+     * If this is not set, the default serving config will be used.
+     * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @return The servingConfig. + */ + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + servingConfig_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the Serving Config to use. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+     * If this is not set, the default serving config will be used.
+     * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for servingConfig. + */ + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the Serving Config to use. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+     * If this is not set, the default serving config will be used.
+     * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfig(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + servingConfig_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Serving Config to use. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+     * If this is not set, the default serving config will be used.
+     * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearServingConfig() { + servingConfig_ = getDefaultInstance().getServingConfig(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Serving Config to use. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+     * If this is not set, the default serving config will be used.
+     * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfigBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + servingConfig_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1.Conversation conversation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder> + conversationBuilder_; + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + * + * @return Whether the conversation field is set. + */ + public boolean hasConversation() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + * + * @return The conversation. + */ + public com.google.cloud.discoveryengine.v1.Conversation getConversation() { + if (conversationBuilder_ == null) { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } else { + return conversationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + */ + public Builder setConversation(com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conversation_ = value; + } else { + conversationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + */ + public Builder setConversation( + com.google.cloud.discoveryengine.v1.Conversation.Builder builderForValue) { + if (conversationBuilder_ == null) { + conversation_ = builderForValue.build(); + } else { + conversationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + */ + public Builder mergeConversation(com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && conversation_ != null + && conversation_ + != com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance()) { + getConversationBuilder().mergeFrom(value); + } else { + conversation_ = value; + } + } else { + conversationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + */ + public Builder clearConversation() { + bitField0_ = (bitField0_ & ~0x00000008); + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + */ + public com.google.cloud.discoveryengine.v1.Conversation.Builder getConversationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getConversationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + */ + public com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder() { + if (conversationBuilder_ != null) { + return conversationBuilder_.getMessageOrBuilder(); + } else { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder> + getConversationFieldBuilder() { + if (conversationBuilder_ == null) { + conversationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder>( + getConversation(), getParentForChildren(), isClean()); + conversation_ = null; + } + return conversationBuilder_; + } + + private boolean safeSearch_; + /** + * + * + *
+     * Whether to turn on safe search.
+     * 
+ * + * bool safe_search = 6; + * + * @return The safeSearch. + */ + @java.lang.Override + public boolean getSafeSearch() { + return safeSearch_; + } + /** + * + * + *
+     * Whether to turn on safe search.
+     * 
+ * + * bool safe_search = 6; + * + * @param value The safeSearch to set. + * @return This builder for chaining. + */ + public Builder setSafeSearch(boolean value) { + + safeSearch_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether to turn on safe search.
+     * 
+ * + * bool safe_search = 6; + * + * @return This builder for chaining. + */ + public Builder clearSafeSearch() { + bitField0_ = (bitField0_ & ~0x00000010); + safeSearch_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField + internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + private com.google.protobuf.MapField + internalGetMutableUserLabels() { + if (userLabels_ == null) { + userLabels_ = + com.google.protobuf.MapField.newMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + if (!userLabels_.isMutable()) { + userLabels_ = userLabels_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearUserLabels() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableUserLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + public Builder removeUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableUserLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableUserLabels() { + bitField0_ |= 0x00000020; + return internalGetMutableUserLabels().getMutableMap(); + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + public Builder putUserLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableUserLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + public Builder putAllUserLabels(java.util.Map values) { + internalGetMutableUserLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + summarySpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder> + summarySpecBuilder_; + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return Whether the summarySpec field is set. + */ + public boolean hasSummarySpec() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return The summarySpec. + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec() { + if (summarySpecBuilder_ == null) { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } else { + return summarySpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder setSummarySpec( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec value) { + if (summarySpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summarySpec_ = value; + } else { + summarySpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder setSummarySpec( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.Builder + builderForValue) { + if (summarySpecBuilder_ == null) { + summarySpec_ = builderForValue.build(); + } else { + summarySpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder mergeSummarySpec( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec value) { + if (summarySpecBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && summarySpec_ != null + && summarySpec_ + != com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance()) { + getSummarySpecBuilder().mergeFrom(value); + } else { + summarySpec_ = value; + } + } else { + summarySpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder clearSummarySpec() { + bitField0_ = (bitField0_ & ~0x00000040); + summarySpec_ = null; + if (summarySpecBuilder_ != null) { + summarySpecBuilder_.dispose(); + summarySpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.Builder + getSummarySpecBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getSummarySpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpecOrBuilder + getSummarySpecOrBuilder() { + if (summarySpecBuilder_ != null) { + return summarySpecBuilder_.getMessageOrBuilder(); + } else { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder> + getSummarySpecFieldBuilder() { + if (summarySpecBuilder_ == null) { + summarySpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder>(getSummarySpec(), getParentForChildren(), isClean()); + summarySpec_ = null; + } + return summarySpecBuilder_; + } + + @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.discoveryengine.v1.ConverseConversationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.ConverseConversationRequest) + private static final com.google.cloud.discoveryengine.v1.ConverseConversationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.ConverseConversationRequest(); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConverseConversationRequest 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.discoveryengine.v1.ConverseConversationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationRequestOrBuilder.java new file mode 100644 index 000000000000..d2870ae6b22a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationRequestOrBuilder.java @@ -0,0 +1,368 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +public interface ConverseConversationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.ConverseConversationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+   * Use
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+   * to activate auto session mode, which automatically creates a new
+   * conversation inside a ConverseConversation session.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+   * Use
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+   * to activate auto session mode, which automatically creates a new
+   * conversation inside a ConverseConversation session.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the query field is set. + */ + boolean hasQuery(); + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The query. + */ + com.google.cloud.discoveryengine.v1.TextInput getQuery(); + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1.TextInputOrBuilder getQueryOrBuilder(); + + /** + * + * + *
+   * The resource name of the Serving Config to use. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+   * If this is not set, the default serving config will be used.
+   * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @return The servingConfig. + */ + java.lang.String getServingConfig(); + /** + * + * + *
+   * The resource name of the Serving Config to use. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+   * If this is not set, the default serving config will be used.
+   * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for servingConfig. + */ + com.google.protobuf.ByteString getServingConfigBytes(); + + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + * + * @return Whether the conversation field is set. + */ + boolean hasConversation(); + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + * + * @return The conversation. + */ + com.google.cloud.discoveryengine.v1.Conversation getConversation(); + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 5; + */ + com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder(); + + /** + * + * + *
+   * Whether to turn on safe search.
+   * 
+ * + * bool safe_search = 6; + * + * @return The safeSearch. + */ + boolean getSafeSearch(); + + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + int getUserLabelsCount(); + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + boolean containsUserLabels(java.lang.String key); + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getUserLabels(); + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + java.util.Map getUserLabelsMap(); + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + /* nullable */ + java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + java.lang.String getUserLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return Whether the summarySpec field is set. + */ + boolean hasSummarySpec(); + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return The summarySpec. + */ + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec getSummarySpec(); + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpecOrBuilder + getSummarySpecOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationResponse.java new file mode 100644 index 000000000000..d8ea4e1fe7ed --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationResponse.java @@ -0,0 +1,1544 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Response message for
+ * [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1.ConversationalSearchService.ConverseConversation]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ConverseConversationResponse} + */ +public final class ConverseConversationResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.ConverseConversationResponse) + ConverseConversationResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConverseConversationResponse.newBuilder() to construct. + private ConverseConversationResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConverseConversationResponse() { + searchResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConverseConversationResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ConverseConversationResponse.class, + com.google.cloud.discoveryengine.v1.ConverseConversationResponse.Builder.class); + } + + public static final int REPLY_FIELD_NUMBER = 1; + private com.google.cloud.discoveryengine.v1.Reply reply_; + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + * + * @return Whether the reply field is set. + */ + @java.lang.Override + public boolean hasReply() { + return reply_ != null; + } + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + * + * @return The reply. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Reply getReply() { + return reply_ == null ? com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance() : reply_; + } + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ReplyOrBuilder getReplyOrBuilder() { + return reply_ == null ? com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance() : reply_; + } + + public static final int CONVERSATION_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1.Conversation conversation_; + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + * + * @return Whether the conversation field is set. + */ + @java.lang.Override + public boolean hasConversation() { + return conversation_ != null; + } + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + * + * @return The conversation. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Conversation getConversation() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + + public static final int SEARCH_RESULTS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List + searchResults_; + /** + * + * + *
+   * Search Results.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + @java.lang.Override + public java.util.List + getSearchResultsList() { + return searchResults_; + } + /** + * + * + *
+   * Search Results.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> + getSearchResultsOrBuilderList() { + return searchResults_; + } + /** + * + * + *
+   * Search Results.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + @java.lang.Override + public int getSearchResultsCount() { + return searchResults_.size(); + } + /** + * + * + *
+   * Search Results.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult getSearchResults( + int index) { + return searchResults_.get(index); + } + /** + * + * + *
+   * Search Results.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder + getSearchResultsOrBuilder(int index) { + return searchResults_.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 (reply_ != null) { + output.writeMessage(1, getReply()); + } + if (conversation_ != null) { + output.writeMessage(2, getConversation()); + } + for (int i = 0; i < searchResults_.size(); i++) { + output.writeMessage(3, searchResults_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reply_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getReply()); + } + if (conversation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConversation()); + } + for (int i = 0; i < searchResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, searchResults_.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.discoveryengine.v1.ConverseConversationResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.ConverseConversationResponse other = + (com.google.cloud.discoveryengine.v1.ConverseConversationResponse) obj; + + if (hasReply() != other.hasReply()) return false; + if (hasReply()) { + if (!getReply().equals(other.getReply())) return false; + } + if (hasConversation() != other.hasConversation()) return false; + if (hasConversation()) { + if (!getConversation().equals(other.getConversation())) return false; + } + if (!getSearchResultsList().equals(other.getSearchResultsList())) 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 (hasReply()) { + hash = (37 * hash) + REPLY_FIELD_NUMBER; + hash = (53 * hash) + getReply().hashCode(); + } + if (hasConversation()) { + hash = (37 * hash) + CONVERSATION_FIELD_NUMBER; + hash = (53 * hash) + getConversation().hashCode(); + } + if (getSearchResultsCount() > 0) { + hash = (37 * hash) + SEARCH_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getSearchResultsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationResponse 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.discoveryengine.v1.ConverseConversationResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationResponse 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.discoveryengine.v1.ConverseConversationResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationResponse 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.discoveryengine.v1.ConverseConversationResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationResponse 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.discoveryengine.v1.ConverseConversationResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationResponse 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.discoveryengine.v1.ConverseConversationResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1.ConversationalSearchService.ConverseConversation]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ConverseConversationResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.ConverseConversationResponse) + com.google.cloud.discoveryengine.v1.ConverseConversationResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ConverseConversationResponse.class, + com.google.cloud.discoveryengine.v1.ConverseConversationResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.ConverseConversationResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reply_ = null; + if (replyBuilder_ != null) { + replyBuilder_.dispose(); + replyBuilder_ = null; + } + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + if (searchResultsBuilder_ == null) { + searchResults_ = java.util.Collections.emptyList(); + } else { + searchResults_ = null; + searchResultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ConverseConversationResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConverseConversationResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.ConverseConversationResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConverseConversationResponse build() { + com.google.cloud.discoveryengine.v1.ConverseConversationResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConverseConversationResponse buildPartial() { + com.google.cloud.discoveryengine.v1.ConverseConversationResponse result = + new com.google.cloud.discoveryengine.v1.ConverseConversationResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1.ConverseConversationResponse result) { + if (searchResultsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + searchResults_ = java.util.Collections.unmodifiableList(searchResults_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.searchResults_ = searchResults_; + } else { + result.searchResults_ = searchResultsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.ConverseConversationResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reply_ = replyBuilder_ == null ? reply_ : replyBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.conversation_ = + conversationBuilder_ == null ? conversation_ : conversationBuilder_.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.discoveryengine.v1.ConverseConversationResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1.ConverseConversationResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.ConverseConversationResponse other) { + if (other + == com.google.cloud.discoveryengine.v1.ConverseConversationResponse.getDefaultInstance()) + return this; + if (other.hasReply()) { + mergeReply(other.getReply()); + } + if (other.hasConversation()) { + mergeConversation(other.getConversation()); + } + if (searchResultsBuilder_ == null) { + if (!other.searchResults_.isEmpty()) { + if (searchResults_.isEmpty()) { + searchResults_ = other.searchResults_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSearchResultsIsMutable(); + searchResults_.addAll(other.searchResults_); + } + onChanged(); + } + } else { + if (!other.searchResults_.isEmpty()) { + if (searchResultsBuilder_.isEmpty()) { + searchResultsBuilder_.dispose(); + searchResultsBuilder_ = null; + searchResults_ = other.searchResults_; + bitField0_ = (bitField0_ & ~0x00000004); + searchResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSearchResultsFieldBuilder() + : null; + } else { + searchResultsBuilder_.addAllMessages(other.searchResults_); + } + } + } + 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(getReplyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getConversationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult m = + input.readMessage( + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.parser(), + extensionRegistry); + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.add(m); + } else { + searchResultsBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.discoveryengine.v1.Reply reply_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Reply, + com.google.cloud.discoveryengine.v1.Reply.Builder, + com.google.cloud.discoveryengine.v1.ReplyOrBuilder> + replyBuilder_; + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + * + * @return Whether the reply field is set. + */ + public boolean hasReply() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + * + * @return The reply. + */ + public com.google.cloud.discoveryengine.v1.Reply getReply() { + if (replyBuilder_ == null) { + return reply_ == null + ? com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance() + : reply_; + } else { + return replyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + */ + public Builder setReply(com.google.cloud.discoveryengine.v1.Reply value) { + if (replyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reply_ = value; + } else { + replyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + */ + public Builder setReply(com.google.cloud.discoveryengine.v1.Reply.Builder builderForValue) { + if (replyBuilder_ == null) { + reply_ = builderForValue.build(); + } else { + replyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + */ + public Builder mergeReply(com.google.cloud.discoveryengine.v1.Reply value) { + if (replyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && reply_ != null + && reply_ != com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance()) { + getReplyBuilder().mergeFrom(value); + } else { + reply_ = value; + } + } else { + replyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + */ + public Builder clearReply() { + bitField0_ = (bitField0_ & ~0x00000001); + reply_ = null; + if (replyBuilder_ != null) { + replyBuilder_.dispose(); + replyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + */ + public com.google.cloud.discoveryengine.v1.Reply.Builder getReplyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getReplyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + */ + public com.google.cloud.discoveryengine.v1.ReplyOrBuilder getReplyOrBuilder() { + if (replyBuilder_ != null) { + return replyBuilder_.getMessageOrBuilder(); + } else { + return reply_ == null + ? com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance() + : reply_; + } + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Reply, + com.google.cloud.discoveryengine.v1.Reply.Builder, + com.google.cloud.discoveryengine.v1.ReplyOrBuilder> + getReplyFieldBuilder() { + if (replyBuilder_ == null) { + replyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Reply, + com.google.cloud.discoveryengine.v1.Reply.Builder, + com.google.cloud.discoveryengine.v1.ReplyOrBuilder>( + getReply(), getParentForChildren(), isClean()); + reply_ = null; + } + return replyBuilder_; + } + + private com.google.cloud.discoveryengine.v1.Conversation conversation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder> + conversationBuilder_; + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + * + * @return Whether the conversation field is set. + */ + public boolean hasConversation() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + * + * @return The conversation. + */ + public com.google.cloud.discoveryengine.v1.Conversation getConversation() { + if (conversationBuilder_ == null) { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } else { + return conversationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + */ + public Builder setConversation(com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conversation_ = value; + } else { + conversationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + */ + public Builder setConversation( + com.google.cloud.discoveryengine.v1.Conversation.Builder builderForValue) { + if (conversationBuilder_ == null) { + conversation_ = builderForValue.build(); + } else { + conversationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + */ + public Builder mergeConversation(com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && conversation_ != null + && conversation_ + != com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance()) { + getConversationBuilder().mergeFrom(value); + } else { + conversation_ = value; + } + } else { + conversationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + */ + public Builder clearConversation() { + bitField0_ = (bitField0_ & ~0x00000002); + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + */ + public com.google.cloud.discoveryengine.v1.Conversation.Builder getConversationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getConversationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + */ + public com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder() { + if (conversationBuilder_ != null) { + return conversationBuilder_.getMessageOrBuilder(); + } else { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder> + getConversationFieldBuilder() { + if (conversationBuilder_ == null) { + conversationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder>( + getConversation(), getParentForChildren(), isClean()); + conversation_ = null; + } + return conversationBuilder_; + } + + private java.util.List + searchResults_ = java.util.Collections.emptyList(); + + private void ensureSearchResultsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + searchResults_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult>(searchResults_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> + searchResultsBuilder_; + + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public java.util.List + getSearchResultsList() { + if (searchResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(searchResults_); + } else { + return searchResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public int getSearchResultsCount() { + if (searchResultsBuilder_ == null) { + return searchResults_.size(); + } else { + return searchResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult getSearchResults( + int index) { + if (searchResultsBuilder_ == null) { + return searchResults_.get(index); + } else { + return searchResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder setSearchResults( + int index, com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult value) { + if (searchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchResultsIsMutable(); + searchResults_.set(index, value); + onChanged(); + } else { + searchResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder setSearchResults( + int index, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder builderForValue) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.set(index, builderForValue.build()); + onChanged(); + } else { + searchResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder addSearchResults( + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult value) { + if (searchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchResultsIsMutable(); + searchResults_.add(value); + onChanged(); + } else { + searchResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder addSearchResults( + int index, com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult value) { + if (searchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchResultsIsMutable(); + searchResults_.add(index, value); + onChanged(); + } else { + searchResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder addSearchResults( + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder builderForValue) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.add(builderForValue.build()); + onChanged(); + } else { + searchResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder addSearchResults( + int index, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder builderForValue) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.add(index, builderForValue.build()); + onChanged(); + } else { + searchResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder addAllSearchResults( + java.lang.Iterable< + ? extends com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult> + values) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, searchResults_); + onChanged(); + } else { + searchResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder clearSearchResults() { + if (searchResultsBuilder_ == null) { + searchResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + searchResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder removeSearchResults(int index) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.remove(index); + onChanged(); + } else { + searchResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder + getSearchResultsBuilder(int index) { + return getSearchResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder + getSearchResultsOrBuilder(int index) { + if (searchResultsBuilder_ == null) { + return searchResults_.get(index); + } else { + return searchResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> + getSearchResultsOrBuilderList() { + if (searchResultsBuilder_ != null) { + return searchResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(searchResults_); + } + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder + addSearchResultsBuilder() { + return getSearchResultsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder + addSearchResultsBuilder(int index) { + return getSearchResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + public java.util.List + getSearchResultsBuilderList() { + return getSearchResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> + getSearchResultsFieldBuilder() { + if (searchResultsBuilder_ == null) { + searchResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder>( + searchResults_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + searchResults_ = null; + } + return searchResultsBuilder_; + } + + @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.discoveryengine.v1.ConverseConversationResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.ConverseConversationResponse) + private static final com.google.cloud.discoveryengine.v1.ConverseConversationResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.ConverseConversationResponse(); + } + + public static com.google.cloud.discoveryengine.v1.ConverseConversationResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConverseConversationResponse 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.discoveryengine.v1.ConverseConversationResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationResponseOrBuilder.java new file mode 100644 index 000000000000..c36480e48d1d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ConverseConversationResponseOrBuilder.java @@ -0,0 +1,154 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +public interface ConverseConversationResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.ConverseConversationResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + * + * @return Whether the reply field is set. + */ + boolean hasReply(); + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + * + * @return The reply. + */ + com.google.cloud.discoveryengine.v1.Reply getReply(); + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Reply reply = 1; + */ + com.google.cloud.discoveryengine.v1.ReplyOrBuilder getReplyOrBuilder(); + + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + * + * @return Whether the conversation field is set. + */ + boolean hasConversation(); + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + * + * @return The conversation. + */ + com.google.cloud.discoveryengine.v1.Conversation getConversation(); + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2; + */ + com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder(); + + /** + * + * + *
+   * Search Results.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + java.util.List + getSearchResultsList(); + /** + * + * + *
+   * Search Results.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult getSearchResults(int index); + /** + * + * + *
+   * Search Results.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + int getSearchResultsCount(); + /** + * + * + *
+   * Search Results.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + java.util.List + getSearchResultsOrBuilderList(); + /** + * + * + *
+   * Search Results.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult search_results = 3; + * + */ + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder + getSearchResultsOrBuilder(int index); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CreateConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CreateConversationRequest.java new file mode 100644 index 000000000000..47cf0308c1bd --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CreateConversationRequest.java @@ -0,0 +1,941 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Request for CreateConversation method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.CreateConversationRequest} + */ +public final class CreateConversationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.CreateConversationRequest) + CreateConversationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateConversationRequest.newBuilder() to construct. + private CreateConversationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateConversationRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateConversationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_CreateConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_CreateConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.CreateConversationRequest.class, + com.google.cloud.discoveryengine.v1.CreateConversationRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Full resource name of parent data store. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of parent data store. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONVERSATION_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1.Conversation conversation_; + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + @java.lang.Override + public boolean hasConversation() { + return conversation_ != null; + } + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Conversation getConversation() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (conversation_ != null) { + output.writeMessage(2, getConversation()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (conversation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConversation()); + } + 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.discoveryengine.v1.CreateConversationRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.CreateConversationRequest other = + (com.google.cloud.discoveryengine.v1.CreateConversationRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasConversation() != other.hasConversation()) return false; + if (hasConversation()) { + if (!getConversation().equals(other.getConversation())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasConversation()) { + hash = (37 * hash) + CONVERSATION_FIELD_NUMBER; + hash = (53 * hash) + getConversation().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.CreateConversationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.CreateConversationRequest 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.discoveryengine.v1.CreateConversationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.CreateConversationRequest 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.discoveryengine.v1.CreateConversationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.CreateConversationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.CreateConversationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.CreateConversationRequest 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.discoveryengine.v1.CreateConversationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.CreateConversationRequest 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.discoveryengine.v1.CreateConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.CreateConversationRequest 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.discoveryengine.v1.CreateConversationRequest 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 for CreateConversation method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.CreateConversationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.CreateConversationRequest) + com.google.cloud.discoveryengine.v1.CreateConversationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_CreateConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_CreateConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.CreateConversationRequest.class, + com.google.cloud.discoveryengine.v1.CreateConversationRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.CreateConversationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_CreateConversationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.CreateConversationRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.CreateConversationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.CreateConversationRequest build() { + com.google.cloud.discoveryengine.v1.CreateConversationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.CreateConversationRequest buildPartial() { + com.google.cloud.discoveryengine.v1.CreateConversationRequest result = + new com.google.cloud.discoveryengine.v1.CreateConversationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.CreateConversationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.conversation_ = + conversationBuilder_ == null ? conversation_ : conversationBuilder_.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.discoveryengine.v1.CreateConversationRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1.CreateConversationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.CreateConversationRequest other) { + if (other + == com.google.cloud.discoveryengine.v1.CreateConversationRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasConversation()) { + mergeConversation(other.getConversation()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getConversationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Full resource name of parent data store. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of parent data store. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of parent data store. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of parent data store. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of parent data store. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1.Conversation conversation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder> + conversationBuilder_; + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + public boolean hasConversation() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + public com.google.cloud.discoveryengine.v1.Conversation getConversation() { + if (conversationBuilder_ == null) { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } else { + return conversationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversation(com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conversation_ = value; + } else { + conversationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversation( + com.google.cloud.discoveryengine.v1.Conversation.Builder builderForValue) { + if (conversationBuilder_ == null) { + conversation_ = builderForValue.build(); + } else { + conversationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConversation(com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && conversation_ != null + && conversation_ + != com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance()) { + getConversationBuilder().mergeFrom(value); + } else { + conversation_ = value; + } + } else { + conversationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConversation() { + bitField0_ = (bitField0_ & ~0x00000002); + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1.Conversation.Builder getConversationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getConversationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder() { + if (conversationBuilder_ != null) { + return conversationBuilder_.getMessageOrBuilder(); + } else { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder> + getConversationFieldBuilder() { + if (conversationBuilder_ == null) { + conversationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder>( + getConversation(), getParentForChildren(), isClean()); + conversation_ = null; + } + return conversationBuilder_; + } + + @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.discoveryengine.v1.CreateConversationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.CreateConversationRequest) + private static final com.google.cloud.discoveryengine.v1.CreateConversationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.CreateConversationRequest(); + } + + public static com.google.cloud.discoveryengine.v1.CreateConversationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateConversationRequest 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.discoveryengine.v1.CreateConversationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CreateConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CreateConversationRequestOrBuilder.java new file mode 100644 index 000000000000..f3f9f99a7a60 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/CreateConversationRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +public interface CreateConversationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.CreateConversationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of parent data store. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Full resource name of parent data store. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + boolean hasConversation(); + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + com.google.cloud.discoveryengine.v1.Conversation getConversation(); + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DeleteConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DeleteConversationRequest.java new file mode 100644 index 000000000000..c265ed36472a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DeleteConversationRequest.java @@ -0,0 +1,650 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Request for DeleteConversation method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.DeleteConversationRequest} + */ +public final class DeleteConversationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.DeleteConversationRequest) + DeleteConversationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteConversationRequest.newBuilder() to construct. + private DeleteConversationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteConversationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteConversationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_DeleteConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_DeleteConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.DeleteConversationRequest.class, + com.google.cloud.discoveryengine.v1.DeleteConversationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The resource name of the Conversation to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Conversation to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1.DeleteConversationRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.DeleteConversationRequest other = + (com.google.cloud.discoveryengine.v1.DeleteConversationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.DeleteConversationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.DeleteConversationRequest 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.discoveryengine.v1.DeleteConversationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.DeleteConversationRequest 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.discoveryengine.v1.DeleteConversationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.DeleteConversationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.DeleteConversationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.DeleteConversationRequest 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.discoveryengine.v1.DeleteConversationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.DeleteConversationRequest 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.discoveryengine.v1.DeleteConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.DeleteConversationRequest 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.discoveryengine.v1.DeleteConversationRequest 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 for DeleteConversation method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.DeleteConversationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.DeleteConversationRequest) + com.google.cloud.discoveryengine.v1.DeleteConversationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_DeleteConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_DeleteConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.DeleteConversationRequest.class, + com.google.cloud.discoveryengine.v1.DeleteConversationRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.DeleteConversationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_DeleteConversationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.DeleteConversationRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.DeleteConversationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.DeleteConversationRequest build() { + com.google.cloud.discoveryengine.v1.DeleteConversationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.DeleteConversationRequest buildPartial() { + com.google.cloud.discoveryengine.v1.DeleteConversationRequest result = + new com.google.cloud.discoveryengine.v1.DeleteConversationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.DeleteConversationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1.DeleteConversationRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1.DeleteConversationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.DeleteConversationRequest other) { + if (other + == com.google.cloud.discoveryengine.v1.DeleteConversationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Conversation to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Conversation to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Conversation to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.DeleteConversationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.DeleteConversationRequest) + private static final com.google.cloud.discoveryengine.v1.DeleteConversationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.DeleteConversationRequest(); + } + + public static com.google.cloud.discoveryengine.v1.DeleteConversationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteConversationRequest 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.discoveryengine.v1.DeleteConversationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DeleteConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DeleteConversationRequestOrBuilder.java new file mode 100644 index 000000000000..d6df9b313f63 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DeleteConversationRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +public interface DeleteConversationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.DeleteConversationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Conversation to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Conversation to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Document.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Document.java index 418427a60ec9..82240b543f60 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Document.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Document.java @@ -159,8 +159,11 @@ public interface ContentOrBuilder *
      * The MIME type of the content. Supported types:
      *
-     * * `application/pdf` (PDF)
+     * * `application/pdf` (PDF, only native PDFs are supported for now)
      * * `text/html` (HTML)
+     * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+     * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+     * * `text/plain` (TXT)
      *
      * See https://www.iana.org/assignments/media-types/media-types.xhtml.
      * 
@@ -176,8 +179,11 @@ public interface ContentOrBuilder *
      * The MIME type of the content. Supported types:
      *
-     * * `application/pdf` (PDF)
+     * * `application/pdf` (PDF, only native PDFs are supported for now)
      * * `text/html` (HTML)
+     * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+     * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+     * * `text/plain` (TXT)
      *
      * See https://www.iana.org/assignments/media-types/media-types.xhtml.
      * 
@@ -418,8 +424,11 @@ public com.google.protobuf.ByteString getUriBytes() { *
      * The MIME type of the content. Supported types:
      *
-     * * `application/pdf` (PDF)
+     * * `application/pdf` (PDF, only native PDFs are supported for now)
      * * `text/html` (HTML)
+     * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+     * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+     * * `text/plain` (TXT)
      *
      * See https://www.iana.org/assignments/media-types/media-types.xhtml.
      * 
@@ -446,8 +455,11 @@ public java.lang.String getMimeType() { *
      * The MIME type of the content. Supported types:
      *
-     * * `application/pdf` (PDF)
+     * * `application/pdf` (PDF, only native PDFs are supported for now)
      * * `text/html` (HTML)
+     * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+     * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+     * * `text/plain` (TXT)
      *
      * See https://www.iana.org/assignments/media-types/media-types.xhtml.
      * 
@@ -1159,8 +1171,11 @@ public Builder setUriBytes(com.google.protobuf.ByteString value) { *
        * The MIME type of the content. Supported types:
        *
-       * * `application/pdf` (PDF)
+       * * `application/pdf` (PDF, only native PDFs are supported for now)
        * * `text/html` (HTML)
+       * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+       * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+       * * `text/plain` (TXT)
        *
        * See https://www.iana.org/assignments/media-types/media-types.xhtml.
        * 
@@ -1186,8 +1201,11 @@ public java.lang.String getMimeType() { *
        * The MIME type of the content. Supported types:
        *
-       * * `application/pdf` (PDF)
+       * * `application/pdf` (PDF, only native PDFs are supported for now)
        * * `text/html` (HTML)
+       * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+       * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+       * * `text/plain` (TXT)
        *
        * See https://www.iana.org/assignments/media-types/media-types.xhtml.
        * 
@@ -1213,8 +1231,11 @@ public com.google.protobuf.ByteString getMimeTypeBytes() { *
        * The MIME type of the content. Supported types:
        *
-       * * `application/pdf` (PDF)
+       * * `application/pdf` (PDF, only native PDFs are supported for now)
        * * `text/html` (HTML)
+       * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+       * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+       * * `text/plain` (TXT)
        *
        * See https://www.iana.org/assignments/media-types/media-types.xhtml.
        * 
@@ -1239,8 +1260,11 @@ public Builder setMimeType(java.lang.String value) { *
        * The MIME type of the content. Supported types:
        *
-       * * `application/pdf` (PDF)
+       * * `application/pdf` (PDF, only native PDFs are supported for now)
        * * `text/html` (HTML)
+       * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+       * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+       * * `text/plain` (TXT)
        *
        * See https://www.iana.org/assignments/media-types/media-types.xhtml.
        * 
@@ -1261,8 +1285,11 @@ public Builder clearMimeType() { *
        * The MIME type of the content. Supported types:
        *
-       * * `application/pdf` (PDF)
+       * * `application/pdf` (PDF, only native PDFs are supported for now)
        * * `text/html` (HTML)
+       * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+       * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+       * * `text/plain` (TXT)
        *
        * See https://www.iana.org/assignments/media-types/media-types.xhtml.
        * 
@@ -1402,8 +1429,8 @@ public DataCase getDataCase() { * *
    * The structured JSON data for the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * .google.protobuf.Struct struct_data = 4; @@ -1419,8 +1446,8 @@ public boolean hasStructData() { * *
    * The structured JSON data for the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * .google.protobuf.Struct struct_data = 4; @@ -1439,8 +1466,8 @@ public com.google.protobuf.Struct getStructData() { * *
    * The structured JSON data for the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * .google.protobuf.Struct struct_data = 4; @@ -1459,8 +1486,8 @@ public com.google.protobuf.StructOrBuilder getStructDataOrBuilder() { * *
    * The JSON string representation of the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * string json_data = 5; @@ -1475,8 +1502,8 @@ public boolean hasJsonData() { * *
    * The JSON string representation of the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * string json_data = 5; @@ -1504,8 +1531,8 @@ public java.lang.String getJsonData() { * *
    * The JSON string representation of the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * string json_data = 5; @@ -2458,8 +2485,8 @@ public Builder clearData() { * *
      * The structured JSON data for the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * .google.protobuf.Struct struct_data = 4; @@ -2475,8 +2502,8 @@ public boolean hasStructData() { * *
      * The structured JSON data for the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * .google.protobuf.Struct struct_data = 4; @@ -2502,8 +2529,8 @@ public com.google.protobuf.Struct getStructData() { * *
      * The structured JSON data for the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * .google.protobuf.Struct struct_data = 4; @@ -2526,8 +2553,8 @@ public Builder setStructData(com.google.protobuf.Struct value) { * *
      * The structured JSON data for the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * .google.protobuf.Struct struct_data = 4; @@ -2547,8 +2574,8 @@ public Builder setStructData(com.google.protobuf.Struct.Builder builderForValue) * *
      * The structured JSON data for the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * .google.protobuf.Struct struct_data = 4; @@ -2579,8 +2606,8 @@ public Builder mergeStructData(com.google.protobuf.Struct value) { * *
      * The structured JSON data for the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * .google.protobuf.Struct struct_data = 4; @@ -2606,8 +2633,8 @@ public Builder clearStructData() { * *
      * The structured JSON data for the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * .google.protobuf.Struct struct_data = 4; @@ -2620,8 +2647,8 @@ public com.google.protobuf.Struct.Builder getStructDataBuilder() { * *
      * The structured JSON data for the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * .google.protobuf.Struct struct_data = 4; @@ -2642,8 +2669,8 @@ public com.google.protobuf.StructOrBuilder getStructDataOrBuilder() { * *
      * The structured JSON data for the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * .google.protobuf.Struct struct_data = 4; @@ -2675,8 +2702,8 @@ public com.google.protobuf.StructOrBuilder getStructDataOrBuilder() { * *
      * The JSON string representation of the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * string json_data = 5; @@ -2692,8 +2719,8 @@ public boolean hasJsonData() { * *
      * The JSON string representation of the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * string json_data = 5; @@ -2722,8 +2749,8 @@ public java.lang.String getJsonData() { * *
      * The JSON string representation of the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * string json_data = 5; @@ -2752,8 +2779,8 @@ public com.google.protobuf.ByteString getJsonDataBytes() { * *
      * The JSON string representation of the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * string json_data = 5; @@ -2775,8 +2802,8 @@ public Builder setJsonData(java.lang.String value) { * *
      * The JSON string representation of the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * string json_data = 5; @@ -2796,8 +2823,8 @@ public Builder clearJsonData() { * *
      * The JSON string representation of the document. It should conform to the
-     * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-     * or an `INVALID_ARGUMENT` error is thrown.
+     * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
      * 
* * string json_data = 5; diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentInfo.java index fc503d343f8e..80dbdd77599b 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentInfo.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentInfo.java @@ -74,6 +74,7 @@ public enum DocumentDescriptorCase com.google.protobuf.AbstractMessage.InternalOneOfEnum { ID(1), NAME(2), + URI(6), DOCUMENTDESCRIPTOR_NOT_SET(0); private final int value; @@ -96,6 +97,8 @@ public static DocumentDescriptorCase forNumber(int value) { return ID; case 2: return NAME; + case 6: + return URI; case 0: return DOCUMENTDESCRIPTOR_NOT_SET; default: @@ -117,10 +120,10 @@ public DocumentDescriptorCase getDocumentDescriptorCase() { * * *
-   * Required. The Document resource ID.
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
    * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @return Whether the id field is set. */ @@ -131,10 +134,10 @@ public boolean hasId() { * * *
-   * Required. The Document resource ID.
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
    * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @return The id. */ @@ -158,10 +161,10 @@ public java.lang.String getId() { * * *
-   * Required. The Document resource ID.
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
    * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @return The bytes for id. */ @@ -187,13 +190,12 @@ public com.google.protobuf.ByteString getIdBytes() { * * *
-   * Required. The Document resource full name, of the form:
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+   * name, of the form:
    * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
    * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @return Whether the name field is set. */ @@ -204,13 +206,12 @@ public boolean hasName() { * * *
-   * Required. The Document resource full name, of the form:
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+   * name, of the form:
    * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
    * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -234,13 +235,12 @@ public java.lang.String getName() { * * *
-   * Required. The Document resource full name, of the form:
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+   * name, of the form:
    * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
    * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ @@ -261,6 +261,79 @@ public com.google.protobuf.ByteString getNameBytes() { } } + public static final int URI_FIELD_NUMBER = 6; + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return documentDescriptorCase_ == 6; + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = s; + } + return s; + } + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int QUANTITY_FIELD_NUMBER = 3; private int quantity_ = 0; /** @@ -404,6 +477,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < promotionIds_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, promotionIds_.getRaw(i)); } + if (documentDescriptorCase_ == 6) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, documentDescriptor_); + } getUnknownFields().writeTo(output); } @@ -430,6 +506,9 @@ public int getSerializedSize() { size += dataSize; size += 1 * getPromotionIdsList().size(); } + if (documentDescriptorCase_ == 6) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, documentDescriptor_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -459,6 +538,9 @@ public boolean equals(final java.lang.Object obj) { case 2: if (!getName().equals(other.getName())) return false; break; + case 6: + if (!getUri().equals(other.getUri())) return false; + break; case 0: default: } @@ -490,6 +572,10 @@ public int hashCode() { hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); break; + case 6: + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + break; case 0: default: } @@ -674,11 +760,11 @@ public com.google.cloud.discoveryengine.v1.DocumentInfo buildPartial() { private void buildPartial0(com.google.cloud.discoveryengine.v1.DocumentInfo result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000004) != 0)) { + if (((from_bitField0_ & 0x00000008) != 0)) { result.quantity_ = quantity_; to_bitField0_ |= 0x00000001; } - if (((from_bitField0_ & 0x00000008) != 0)) { + if (((from_bitField0_ & 0x00000010) != 0)) { promotionIds_.makeImmutable(); result.promotionIds_ = promotionIds_; } @@ -742,7 +828,7 @@ public Builder mergeFrom(com.google.cloud.discoveryengine.v1.DocumentInfo other) if (!other.promotionIds_.isEmpty()) { if (promotionIds_.isEmpty()) { promotionIds_ = other.promotionIds_; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; } else { ensurePromotionIdsIsMutable(); promotionIds_.addAll(other.promotionIds_); @@ -764,6 +850,13 @@ public Builder mergeFrom(com.google.cloud.discoveryengine.v1.DocumentInfo other) onChanged(); break; } + case URI: + { + documentDescriptorCase_ = 6; + documentDescriptor_ = other.documentDescriptor_; + onChanged(); + break; + } case DOCUMENTDESCRIPTOR_NOT_SET: { break; @@ -812,7 +905,7 @@ public Builder mergeFrom( case 24: { quantity_ = input.readInt32(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; break; } // case 24 case 34: @@ -822,6 +915,13 @@ public Builder mergeFrom( promotionIds_.add(s); break; } // case 34 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + documentDescriptorCase_ = 6; + documentDescriptor_ = s; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -859,10 +959,10 @@ public Builder clearDocumentDescriptor() { * * *
-     * Required. The Document resource ID.
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
      * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @return Whether the id field is set. */ @@ -874,10 +974,10 @@ public boolean hasId() { * * *
-     * Required. The Document resource ID.
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
      * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @return The id. */ @@ -902,10 +1002,10 @@ public java.lang.String getId() { * * *
-     * Required. The Document resource ID.
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
      * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @return The bytes for id. */ @@ -930,10 +1030,10 @@ public com.google.protobuf.ByteString getIdBytes() { * * *
-     * Required. The Document resource ID.
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
      * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @param value The id to set. * @return This builder for chaining. @@ -951,10 +1051,10 @@ public Builder setId(java.lang.String value) { * * *
-     * Required. The Document resource ID.
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
      * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @return This builder for chaining. */ @@ -970,10 +1070,10 @@ public Builder clearId() { * * *
-     * Required. The Document resource ID.
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
      * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @param value The bytes for id to set. * @return This builder for chaining. @@ -993,13 +1093,12 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. The Document resource full name, of the form:
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+     * name, of the form:
      * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
      * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @return Whether the name field is set. */ @@ -1011,13 +1110,12 @@ public boolean hasName() { * * *
-     * Required. The Document resource full name, of the form:
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+     * name, of the form:
      * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
      * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -1042,13 +1140,12 @@ public java.lang.String getName() { * * *
-     * Required. The Document resource full name, of the form:
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+     * name, of the form:
      * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
      * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ @@ -1073,13 +1170,12 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The Document resource full name, of the form:
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+     * name, of the form:
      * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
      * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @param value The name to set. * @return This builder for chaining. @@ -1097,13 +1193,12 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The Document resource full name, of the form:
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+     * name, of the form:
      * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
      * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @return This builder for chaining. */ @@ -1119,13 +1214,12 @@ public Builder clearName() { * * *
-     * Required. The Document resource full name, of the form:
+     * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+     * name, of the form:
      * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
      * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @param value The bytes for name to set. * @return This builder for chaining. @@ -1141,6 +1235,146 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { return this; } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return documentDescriptorCase_ == 6; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + documentDescriptorCase_ = 6; + documentDescriptor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + if (documentDescriptorCase_ == 6) { + documentDescriptorCase_ = 0; + documentDescriptor_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + documentDescriptorCase_ = 6; + documentDescriptor_ = value; + onChanged(); + return this; + } + private int quantity_; /** * @@ -1163,7 +1397,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { */ @java.lang.Override public boolean hasQuantity() { - return ((bitField0_ & 0x00000004) != 0); + return ((bitField0_ & 0x00000008) != 0); } /** * @@ -1211,7 +1445,7 @@ public int getQuantity() { public Builder setQuantity(int value) { quantity_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1235,7 +1469,7 @@ public Builder setQuantity(int value) { * @return This builder for chaining. */ public Builder clearQuantity() { - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); quantity_ = 0; onChanged(); return this; @@ -1248,7 +1482,7 @@ private void ensurePromotionIdsIsMutable() { if (!promotionIds_.isModifiable()) { promotionIds_ = new com.google.protobuf.LazyStringArrayList(promotionIds_); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; } /** * @@ -1333,7 +1567,7 @@ public Builder setPromotionIds(int index, java.lang.String value) { } ensurePromotionIdsIsMutable(); promotionIds_.set(index, value); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1356,7 +1590,7 @@ public Builder addPromotionIds(java.lang.String value) { } ensurePromotionIdsIsMutable(); promotionIds_.add(value); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1376,7 +1610,7 @@ public Builder addPromotionIds(java.lang.String value) { public Builder addAllPromotionIds(java.lang.Iterable values) { ensurePromotionIdsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, promotionIds_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1394,7 +1628,7 @@ public Builder addAllPromotionIds(java.lang.Iterable values) { */ public Builder clearPromotionIds() { promotionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000010); ; onChanged(); return this; @@ -1419,7 +1653,7 @@ public Builder addPromotionIdsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensurePromotionIdsIsMutable(); promotionIds_.add(value); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentInfoOrBuilder.java index 26d61488201d..c02b450aab27 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentInfoOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentInfoOrBuilder.java @@ -27,10 +27,10 @@ public interface DocumentInfoOrBuilder * * *
-   * Required. The Document resource ID.
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
    * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @return Whether the id field is set. */ @@ -39,10 +39,10 @@ public interface DocumentInfoOrBuilder * * *
-   * Required. The Document resource ID.
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
    * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @return The id. */ @@ -51,10 +51,10 @@ public interface DocumentInfoOrBuilder * * *
-   * Required. The Document resource ID.
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
    * 
* - * string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * string id = 1; * * @return The bytes for id. */ @@ -64,13 +64,12 @@ public interface DocumentInfoOrBuilder * * *
-   * Required. The Document resource full name, of the form:
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+   * name, of the form:
    * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
    * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @return Whether the name field is set. */ @@ -79,13 +78,12 @@ public interface DocumentInfoOrBuilder * * *
-   * Required. The Document resource full name, of the form:
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+   * name, of the form:
    * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
    * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @return The name. */ @@ -94,18 +92,57 @@ public interface DocumentInfoOrBuilder * * *
-   * Required. The Document resource full name, of the form:
+   * The [Document][google.cloud.discoveryengine.v1.Document] resource full
+   * name, of the form:
    * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
    * 
* - * - * string name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string name = 2 [(.google.api.resource_reference) = { ... } * * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return Whether the uri field is set. + */ + boolean hasUri(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + /** * * diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentOrBuilder.java index 253605ce46fe..2a569ca50558 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/DocumentOrBuilder.java @@ -28,8 +28,8 @@ public interface DocumentOrBuilder * *
    * The structured JSON data for the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * .google.protobuf.Struct struct_data = 4; @@ -42,8 +42,8 @@ public interface DocumentOrBuilder * *
    * The structured JSON data for the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * .google.protobuf.Struct struct_data = 4; @@ -56,8 +56,8 @@ public interface DocumentOrBuilder * *
    * The structured JSON data for the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * .google.protobuf.Struct struct_data = 4; @@ -69,8 +69,8 @@ public interface DocumentOrBuilder * *
    * The JSON string representation of the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * string json_data = 5; @@ -83,8 +83,8 @@ public interface DocumentOrBuilder * *
    * The JSON string representation of the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * string json_data = 5; @@ -97,8 +97,8 @@ public interface DocumentOrBuilder * *
    * The JSON string representation of the document. It should conform to the
-   * registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-   * or an `INVALID_ARGUMENT` error is thrown.
+   * registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
    * 
* * string json_data = 5; diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GcsSource.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GcsSource.java index 428180bf0d28..f6184c9bde92 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GcsSource.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GcsSource.java @@ -172,11 +172,15 @@ public com.google.protobuf.ByteString getInputUrisBytes(int index) { * document must * have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - * `input_uris` will become a document, with the ID set to the first 128 + * `input_uris` becomes a document, with the ID set to the first 128 * bits of SHA256(URI) encoded as a hex string. * * `custom`: One custom data JSON per row in arbitrary format that conforms - * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. This can only be used by Gen App Builder. + * * `csv`: A CSV file with header conforming to the defined + * [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. Each entry after the header is imported as a Document. + * This can only be used by Gen App Builder. * * Supported values for user even imports: * @@ -213,11 +217,15 @@ public java.lang.String getDataSchema() { * document must * have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - * `input_uris` will become a document, with the ID set to the first 128 + * `input_uris` becomes a document, with the ID set to the first 128 * bits of SHA256(URI) encoded as a hex string. * * `custom`: One custom data JSON per row in arbitrary format that conforms - * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. This can only be used by Gen App Builder. + * * `csv`: A CSV file with header conforming to the defined + * [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. Each entry after the header is imported as a Document. + * This can only be used by Gen App Builder. * * Supported values for user even imports: * @@ -872,11 +880,15 @@ public Builder addInputUrisBytes(com.google.protobuf.ByteString value) { * document must * have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - * `input_uris` will become a document, with the ID set to the first 128 + * `input_uris` becomes a document, with the ID set to the first 128 * bits of SHA256(URI) encoded as a hex string. * * `custom`: One custom data JSON per row in arbitrary format that conforms - * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. This can only be used by Gen App Builder. + * * `csv`: A CSV file with header conforming to the defined + * [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. Each entry after the header is imported as a Document. + * This can only be used by Gen App Builder. * * Supported values for user even imports: * @@ -912,11 +924,15 @@ public java.lang.String getDataSchema() { * document must * have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - * `input_uris` will become a document, with the ID set to the first 128 + * `input_uris` becomes a document, with the ID set to the first 128 * bits of SHA256(URI) encoded as a hex string. * * `custom`: One custom data JSON per row in arbitrary format that conforms - * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. This can only be used by Gen App Builder. + * * `csv`: A CSV file with header conforming to the defined + * [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. Each entry after the header is imported as a Document. + * This can only be used by Gen App Builder. * * Supported values for user even imports: * @@ -952,11 +968,15 @@ public com.google.protobuf.ByteString getDataSchemaBytes() { * document must * have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - * `input_uris` will become a document, with the ID set to the first 128 + * `input_uris` becomes a document, with the ID set to the first 128 * bits of SHA256(URI) encoded as a hex string. * * `custom`: One custom data JSON per row in arbitrary format that conforms - * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. This can only be used by Gen App Builder. + * * `csv`: A CSV file with header conforming to the defined + * [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. Each entry after the header is imported as a Document. + * This can only be used by Gen App Builder. * * Supported values for user even imports: * @@ -991,11 +1011,15 @@ public Builder setDataSchema(java.lang.String value) { * document must * have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - * `input_uris` will become a document, with the ID set to the first 128 + * `input_uris` becomes a document, with the ID set to the first 128 * bits of SHA256(URI) encoded as a hex string. * * `custom`: One custom data JSON per row in arbitrary format that conforms - * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. This can only be used by Gen App Builder. + * * `csv`: A CSV file with header conforming to the defined + * [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. Each entry after the header is imported as a Document. + * This can only be used by Gen App Builder. * * Supported values for user even imports: * @@ -1026,11 +1050,15 @@ public Builder clearDataSchema() { * document must * have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - * `input_uris` will become a document, with the ID set to the first 128 + * `input_uris` becomes a document, with the ID set to the first 128 * bits of SHA256(URI) encoded as a hex string. * * `custom`: One custom data JSON per row in arbitrary format that conforms - * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. This can only be used by Gen App Builder. + * * `csv`: A CSV file with header conforming to the defined + * [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. Each entry after the header is imported as a Document. + * This can only be used by Gen App Builder. * * Supported values for user even imports: * diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GcsSourceOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GcsSourceOrBuilder.java index b6e485fd02e7..f023ed8d9218 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GcsSourceOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GcsSourceOrBuilder.java @@ -115,11 +115,15 @@ public interface GcsSourceOrBuilder * document must * have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - * `input_uris` will become a document, with the ID set to the first 128 + * `input_uris` becomes a document, with the ID set to the first 128 * bits of SHA256(URI) encoded as a hex string. * * `custom`: One custom data JSON per row in arbitrary format that conforms - * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. This can only be used by Gen App Builder. + * * `csv`: A CSV file with header conforming to the defined + * [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. Each entry after the header is imported as a Document. + * This can only be used by Gen App Builder. * * Supported values for user even imports: * @@ -145,11 +149,15 @@ public interface GcsSourceOrBuilder * document must * have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - * `input_uris` will become a document, with the ID set to the first 128 + * `input_uris` becomes a document, with the ID set to the first 128 * bits of SHA256(URI) encoded as a hex string. * * `custom`: One custom data JSON per row in arbitrary format that conforms - * the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data - * store. This can only be used by the GENERIC Data Store vertical. + * to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. This can only be used by Gen App Builder. + * * `csv`: A CSV file with header conforming to the defined + * [Schema][google.cloud.discoveryengine.v1.Schema] of the + * data store. Each entry after the header is imported as a Document. + * This can only be used by Gen App Builder. * * Supported values for user even imports: * diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GetConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GetConversationRequest.java new file mode 100644 index 000000000000..0bf48bb79920 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GetConversationRequest.java @@ -0,0 +1,646 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Request for GetConversation method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.GetConversationRequest} + */ +public final class GetConversationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.GetConversationRequest) + GetConversationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetConversationRequest.newBuilder() to construct. + private GetConversationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetConversationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetConversationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_GetConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_GetConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.GetConversationRequest.class, + com.google.cloud.discoveryengine.v1.GetConversationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1.GetConversationRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.GetConversationRequest other = + (com.google.cloud.discoveryengine.v1.GetConversationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.GetConversationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.GetConversationRequest 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.discoveryengine.v1.GetConversationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.GetConversationRequest 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.discoveryengine.v1.GetConversationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.GetConversationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.GetConversationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.GetConversationRequest 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.discoveryengine.v1.GetConversationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.GetConversationRequest 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.discoveryengine.v1.GetConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.GetConversationRequest 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.discoveryengine.v1.GetConversationRequest 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 for GetConversation method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.GetConversationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.GetConversationRequest) + com.google.cloud.discoveryengine.v1.GetConversationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_GetConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_GetConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.GetConversationRequest.class, + com.google.cloud.discoveryengine.v1.GetConversationRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.GetConversationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_GetConversationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.GetConversationRequest getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.GetConversationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.GetConversationRequest build() { + com.google.cloud.discoveryengine.v1.GetConversationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.GetConversationRequest buildPartial() { + com.google.cloud.discoveryengine.v1.GetConversationRequest result = + new com.google.cloud.discoveryengine.v1.GetConversationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1.GetConversationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1.GetConversationRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1.GetConversationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.GetConversationRequest other) { + if (other == com.google.cloud.discoveryengine.v1.GetConversationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.GetConversationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.GetConversationRequest) + private static final com.google.cloud.discoveryengine.v1.GetConversationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.GetConversationRequest(); + } + + public static com.google.cloud.discoveryengine.v1.GetConversationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConversationRequest 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.discoveryengine.v1.GetConversationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GetConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GetConversationRequestOrBuilder.java new file mode 100644 index 000000000000..7018e290845b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/GetConversationRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +public interface GetConversationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.GetConversationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportConfigProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportConfigProto.java index 415c436e099f..a586fa80cceb 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportConfigProto.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportConfigProto.java @@ -95,63 +95,62 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "t_id\030\002 \001(\tB\004\342A\001\002\022\026\n\010table_id\030\003 \001(\tB\004\342A\001\002" + "\022\027\n\017gcs_staging_dir\030\004 \001(\t\022\023\n\013data_schema" + "\030\006 \001(\tB\013\n\tpartition\"8\n\021ImportErrorConfig" - + "\022\024\n\ngcs_prefix\030\001 \001(\tH\000B\r\n\013destination\"\207\004" - + "\n\027ImportUserEventsRequest\022d\n\rinline_sour" + + "\022\024\n\ngcs_prefix\030\001 \001(\tH\000B\r\n\013destination\"\365\003" + + "\n\027ImportUserEventsRequest\022^\n\rinline_sour" + "ce\030\002 \001(\0132E.google.cloud.discoveryengine." - + "v1.ImportUserEventsRequest.InlineSourceB" - + "\004\342A\001\002H\000\022F\n\ngcs_source\030\003 \001(\0132*.google.clo" - + "ud.discoveryengine.v1.GcsSourceB\004\342A\001\002H\000\022" - + "P\n\017bigquery_source\030\004 \001(\0132/.google.cloud." - + "discoveryengine.v1.BigQuerySourceB\004\342A\001\002H" - + "\000\022A\n\006parent\030\001 \001(\tB1\342A\001\002\372A*\n(discoveryeng" - + "ine.googleapis.com/DataStore\022H\n\014error_co" - + "nfig\030\005 \001(\01322.google.cloud.discoveryengin" - + "e.v1.ImportErrorConfig\032U\n\014InlineSource\022E" - + "\n\013user_events\030\001 \003(\0132*.google.cloud.disco" - + "veryengine.v1.UserEventB\004\342A\001\002B\010\n\006source\"" - + "\313\001\n\030ImportUserEventsResponse\022)\n\rerror_sa" - + "mples\030\001 \003(\0132\022.google.rpc.Status\022H\n\014error" - + "_config\030\002 \001(\01322.google.cloud.discoveryen" - + "gine.v1.ImportErrorConfig\022\033\n\023joined_even" - + "ts_count\030\003 \001(\003\022\035\n\025unjoined_events_count\030" - + "\004 \001(\003\"\252\001\n\030ImportUserEventsMetadata\022/\n\013cr" - + "eate_time\030\001 \001(\0132\032.google.protobuf.Timest" - + "amp\022/\n\013update_time\030\002 \001(\0132\032.google.protob" - + "uf.Timestamp\022\025\n\rsuccess_count\030\003 \001(\003\022\025\n\rf" - + "ailure_count\030\004 \001(\003\"\251\001\n\027ImportDocumentsMe" - + "tadata\022/\n\013create_time\030\001 \001(\0132\032.google.pro" - + "tobuf.Timestamp\022/\n\013update_time\030\002 \001(\0132\032.g" - + "oogle.protobuf.Timestamp\022\025\n\rsuccess_coun" - + "t\030\003 \001(\003\022\025\n\rfailure_count\030\004 \001(\003\"\331\005\n\026Impor" - + "tDocumentsRequest\022]\n\rinline_source\030\002 \001(\013" - + "2D.google.cloud.discoveryengine.v1.Impor" - + "tDocumentsRequest.InlineSourceH\000\022@\n\ngcs_" - + "source\030\003 \001(\0132*.google.cloud.discoveryeng" - + "ine.v1.GcsSourceH\000\022J\n\017bigquery_source\030\004 " - + "\001(\0132/.google.cloud.discoveryengine.v1.Bi" - + "gQuerySourceH\000\022>\n\006parent\030\001 \001(\tB.\342A\001\002\372A\'\n" - + "%discoveryengine.googleapis.com/Branch\022H" - + "\n\014error_config\030\005 \001(\01322.google.cloud.disc" - + "overyengine.v1.ImportErrorConfig\022g\n\023reco" - + "nciliation_mode\030\006 \001(\0162J.google.cloud.dis" - + "coveryengine.v1.ImportDocumentsRequest.R" - + "econciliationMode\022\031\n\021auto_generate_ids\030\010" - + " \001(\010\022\020\n\010id_field\030\t \001(\t\032R\n\014InlineSource\022B" - + "\n\tdocuments\030\001 \003(\0132).google.cloud.discove" - + "ryengine.v1.DocumentB\004\342A\001\002\"T\n\022Reconcilia" - + "tionMode\022#\n\037RECONCILIATION_MODE_UNSPECIF" - + "IED\020\000\022\017\n\013INCREMENTAL\020\001\022\010\n\004FULL\020\002B\010\n\006sour" - + "ce\"\216\001\n\027ImportDocumentsResponse\022)\n\rerror_" - + "samples\030\001 \003(\0132\022.google.rpc.Status\022H\n\014err" - + "or_config\030\002 \001(\01322.google.cloud.discovery" - + "engine.v1.ImportErrorConfigB\204\002\n#com.goog" - + "le.cloud.discoveryengine.v1B\021ImportConfi" - + "gProtoP\001ZMcloud.google.com/go/discoverye" - + "ngine/apiv1/discoveryenginepb;discoverye" - + "nginepb\242\002\017DISCOVERYENGINE\252\002\037Google.Cloud" - + ".DiscoveryEngine.V1\312\002\037Google\\Cloud\\Disco" - + "veryEngine\\V1\352\002\"Google::Cloud::Discovery" - + "Engine::V1b\006proto3" + + "v1.ImportUserEventsRequest.InlineSourceH" + + "\000\022@\n\ngcs_source\030\003 \001(\0132*.google.cloud.dis" + + "coveryengine.v1.GcsSourceH\000\022J\n\017bigquery_" + + "source\030\004 \001(\0132/.google.cloud.discoveryeng" + + "ine.v1.BigQuerySourceH\000\022A\n\006parent\030\001 \001(\tB" + + "1\342A\001\002\372A*\n(discoveryengine.googleapis.com" + + "/DataStore\022H\n\014error_config\030\005 \001(\01322.googl" + + "e.cloud.discoveryengine.v1.ImportErrorCo" + + "nfig\032U\n\014InlineSource\022E\n\013user_events\030\001 \003(" + + "\0132*.google.cloud.discoveryengine.v1.User" + + "EventB\004\342A\001\002B\010\n\006source\"\313\001\n\030ImportUserEven" + + "tsResponse\022)\n\rerror_samples\030\001 \003(\0132\022.goog" + + "le.rpc.Status\022H\n\014error_config\030\002 \001(\01322.go" + + "ogle.cloud.discoveryengine.v1.ImportErro" + + "rConfig\022\033\n\023joined_events_count\030\003 \001(\003\022\035\n\025" + + "unjoined_events_count\030\004 \001(\003\"\252\001\n\030ImportUs" + + "erEventsMetadata\022/\n\013create_time\030\001 \001(\0132\032." + + "google.protobuf.Timestamp\022/\n\013update_time" + + "\030\002 \001(\0132\032.google.protobuf.Timestamp\022\025\n\rsu" + + "ccess_count\030\003 \001(\003\022\025\n\rfailure_count\030\004 \001(\003" + + "\"\251\001\n\027ImportDocumentsMetadata\022/\n\013create_t" + + "ime\030\001 \001(\0132\032.google.protobuf.Timestamp\022/\n" + + "\013update_time\030\002 \001(\0132\032.google.protobuf.Tim" + + "estamp\022\025\n\rsuccess_count\030\003 \001(\003\022\025\n\rfailure" + + "_count\030\004 \001(\003\"\331\005\n\026ImportDocumentsRequest\022" + + "]\n\rinline_source\030\002 \001(\0132D.google.cloud.di" + + "scoveryengine.v1.ImportDocumentsRequest." + + "InlineSourceH\000\022@\n\ngcs_source\030\003 \001(\0132*.goo" + + "gle.cloud.discoveryengine.v1.GcsSourceH\000" + + "\022J\n\017bigquery_source\030\004 \001(\0132/.google.cloud" + + ".discoveryengine.v1.BigQuerySourceH\000\022>\n\006" + + "parent\030\001 \001(\tB.\342A\001\002\372A\'\n%discoveryengine.g" + + "oogleapis.com/Branch\022H\n\014error_config\030\005 \001" + + "(\01322.google.cloud.discoveryengine.v1.Imp" + + "ortErrorConfig\022g\n\023reconciliation_mode\030\006 " + + "\001(\0162J.google.cloud.discoveryengine.v1.Im" + + "portDocumentsRequest.ReconciliationMode\022" + + "\031\n\021auto_generate_ids\030\010 \001(\010\022\020\n\010id_field\030\t" + + " \001(\t\032R\n\014InlineSource\022B\n\tdocuments\030\001 \003(\0132" + + ").google.cloud.discoveryengine.v1.Docume" + + "ntB\004\342A\001\002\"T\n\022ReconciliationMode\022#\n\037RECONC" + + "ILIATION_MODE_UNSPECIFIED\020\000\022\017\n\013INCREMENT" + + "AL\020\001\022\010\n\004FULL\020\002B\010\n\006source\"\216\001\n\027ImportDocum" + + "entsResponse\022)\n\rerror_samples\030\001 \003(\0132\022.go" + + "ogle.rpc.Status\022H\n\014error_config\030\002 \001(\01322." + + "google.cloud.discoveryengine.v1.ImportEr" + + "rorConfigB\204\002\n#com.google.cloud.discovery" + + "engine.v1B\021ImportConfigProtoP\001ZMcloud.go" + + "ogle.com/go/discoveryengine/apiv1/discov" + + "eryenginepb;discoveryenginepb\242\002\017DISCOVER" + + "YENGINE\252\002\037Google.Cloud.DiscoveryEngine.V" + + "1\312\002\037Google\\Cloud\\DiscoveryEngine\\V1\352\002\"Go" + + "ogle::Cloud::DiscoveryEngine::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsMetadata.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsMetadata.java index 66b18727557d..508b3d32711a 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsMetadata.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsMetadata.java @@ -22,8 +22,8 @@ * * *
- * Metadata related to the progress of the ImportDocuments operation. This will
- * be returned by the google.longrunning.Operation.metadata field.
+ * Metadata related to the progress of the ImportDocuments operation. This is
+ * returned by the google.longrunning.Operation.metadata field.
  * 
* * Protobuf type {@code google.cloud.discoveryengine.v1.ImportDocumentsMetadata} @@ -393,8 +393,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Metadata related to the progress of the ImportDocuments operation. This will
-   * be returned by the google.longrunning.Operation.metadata field.
+   * Metadata related to the progress of the ImportDocuments operation. This is
+   * returned by the google.longrunning.Operation.metadata field.
    * 
* * Protobuf type {@code google.cloud.discoveryengine.v1.ImportDocumentsMetadata} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsRequest.java index 983d696010ac..56f129dc4667 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsRequest.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsRequest.java @@ -79,7 +79,7 @@ public enum ReconciliationMode implements com.google.protobuf.ProtocolMessageEnu * * *
-     * Defaults to INCREMENTAL.
+     * Defaults to `INCREMENTAL`.
      * 
* * RECONCILIATION_MODE_UNSPECIFIED = 0; @@ -113,7 +113,7 @@ public enum ReconciliationMode implements com.google.protobuf.ProtocolMessageEnu * * *
-     * Defaults to INCREMENTAL.
+     * Defaults to `INCREMENTAL`.
      * 
* * RECONCILIATION_MODE_UNSPECIFIED = 0; @@ -1726,7 +1726,7 @@ public int getReconciliationModeValue() { * `false`, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have * to be specified using * [id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field], - * otherwises, documents without IDs will fail to be imported. + * otherwise, documents without IDs fail to be imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -1734,7 +1734,7 @@ public int getReconciliationModeValue() { * [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema] * or * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema] - * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * * * bool auto_generate_ids = 8; @@ -1762,12 +1762,12 @@ public boolean getAutoGenerateIds() { * For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is * the column name of the BigQuery table where the unique ids are stored. * - * The values of the JSON field or the BigQuery column will be used as the + * The values of the JSON field or the BigQuery column are used as the * [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field * or the BigQuery column must be of string type, and the values must be set * as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) - * with 1-63 characters. Otherwise, documents without valid IDs will fail to - * be imported. + * with 1-63 characters. Otherwise, documents without valid IDs fail to be + * imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -1811,12 +1811,12 @@ public java.lang.String getIdField() { * For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is * the column name of the BigQuery table where the unique ids are stored. * - * The values of the JSON field or the BigQuery column will be used as the + * The values of the JSON field or the BigQuery column are used as the * [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field * or the BigQuery column must be of string type, and the values must be set * as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) - * with 1-63 characters. Otherwise, documents without valid IDs will fail to - * be imported. + * with 1-63 characters. Otherwise, documents without valid IDs fail to be + * imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -3528,7 +3528,7 @@ public Builder clearReconciliationMode() { * `false`, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have * to be specified using * [id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field], - * otherwises, documents without IDs will fail to be imported. + * otherwise, documents without IDs fail to be imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -3536,7 +3536,7 @@ public Builder clearReconciliationMode() { * [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema] * or * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema] - * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * * * bool auto_generate_ids = 8; @@ -3562,7 +3562,7 @@ public boolean getAutoGenerateIds() { * `false`, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have * to be specified using * [id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field], - * otherwises, documents without IDs will fail to be imported. + * otherwise, documents without IDs fail to be imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -3570,7 +3570,7 @@ public boolean getAutoGenerateIds() { * [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema] * or * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema] - * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * * * bool auto_generate_ids = 8; @@ -3600,7 +3600,7 @@ public Builder setAutoGenerateIds(boolean value) { * `false`, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have * to be specified using * [id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field], - * otherwises, documents without IDs will fail to be imported. + * otherwise, documents without IDs fail to be imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -3608,7 +3608,7 @@ public Builder setAutoGenerateIds(boolean value) { * [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema] * or * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema] - * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * * * bool auto_generate_ids = 8; @@ -3635,12 +3635,12 @@ public Builder clearAutoGenerateIds() { * For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is * the column name of the BigQuery table where the unique ids are stored. * - * The values of the JSON field or the BigQuery column will be used as the + * The values of the JSON field or the BigQuery column are used as the * [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field * or the BigQuery column must be of string type, and the values must be set * as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) - * with 1-63 characters. Otherwise, documents without valid IDs will fail to - * be imported. + * with 1-63 characters. Otherwise, documents without valid IDs fail to be + * imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -3683,12 +3683,12 @@ public java.lang.String getIdField() { * For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is * the column name of the BigQuery table where the unique ids are stored. * - * The values of the JSON field or the BigQuery column will be used as the + * The values of the JSON field or the BigQuery column are used as the * [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field * or the BigQuery column must be of string type, and the values must be set * as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) - * with 1-63 characters. Otherwise, documents without valid IDs will fail to - * be imported. + * with 1-63 characters. Otherwise, documents without valid IDs fail to be + * imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -3731,12 +3731,12 @@ public com.google.protobuf.ByteString getIdFieldBytes() { * For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is * the column name of the BigQuery table where the unique ids are stored. * - * The values of the JSON field or the BigQuery column will be used as the + * The values of the JSON field or the BigQuery column are used as the * [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field * or the BigQuery column must be of string type, and the values must be set * as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) - * with 1-63 characters. Otherwise, documents without valid IDs will fail to - * be imported. + * with 1-63 characters. Otherwise, documents without valid IDs fail to be + * imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -3778,12 +3778,12 @@ public Builder setIdField(java.lang.String value) { * For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is * the column name of the BigQuery table where the unique ids are stored. * - * The values of the JSON field or the BigQuery column will be used as the + * The values of the JSON field or the BigQuery column are used as the * [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field * or the BigQuery column must be of string type, and the values must be set * as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) - * with 1-63 characters. Otherwise, documents without valid IDs will fail to - * be imported. + * with 1-63 characters. Otherwise, documents without valid IDs fail to be + * imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -3821,12 +3821,12 @@ public Builder clearIdField() { * For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is * the column name of the BigQuery table where the unique ids are stored. * - * The values of the JSON field or the BigQuery column will be used as the + * The values of the JSON field or the BigQuery column are used as the * [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field * or the BigQuery column must be of string type, and the values must be set * as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) - * with 1-63 characters. Otherwise, documents without valid IDs will fail to - * be imported. + * with 1-63 characters. Otherwise, documents without valid IDs fail to be + * imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsRequestOrBuilder.java index 883f9d59335c..eb5901646a75 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsRequestOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportDocumentsRequestOrBuilder.java @@ -249,7 +249,7 @@ public interface ImportDocumentsRequestOrBuilder * `false`, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have * to be specified using * [id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field], - * otherwises, documents without IDs will fail to be imported. + * otherwise, documents without IDs fail to be imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -257,7 +257,7 @@ public interface ImportDocumentsRequestOrBuilder * [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema] * or * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema] - * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. * * * bool auto_generate_ids = 8; @@ -278,12 +278,12 @@ public interface ImportDocumentsRequestOrBuilder * For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is * the column name of the BigQuery table where the unique ids are stored. * - * The values of the JSON field or the BigQuery column will be used as the + * The values of the JSON field or the BigQuery column are used as the * [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field * or the BigQuery column must be of string type, and the values must be set * as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) - * with 1-63 characters. Otherwise, documents without valid IDs will fail to - * be imported. + * with 1-63 characters. Otherwise, documents without valid IDs fail to be + * imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or @@ -316,12 +316,12 @@ public interface ImportDocumentsRequestOrBuilder * For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is * the column name of the BigQuery table where the unique ids are stored. * - * The values of the JSON field or the BigQuery column will be used as the + * The values of the JSON field or the BigQuery column are used as the * [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field * or the BigQuery column must be of string type, and the values must be set * as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) - * with 1-63 characters. Otherwise, documents without valid IDs will fail to - * be imported. + * with 1-63 characters. Otherwise, documents without valid IDs fail to be + * imported. * * Only set this field when using * [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportErrorConfig.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportErrorConfig.java index 23b89c88410c..60e1ec3f9958 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportErrorConfig.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportErrorConfig.java @@ -112,7 +112,7 @@ public DestinationCase getDestinationCase() { * *
    * Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
@@ -129,7 +129,7 @@ public boolean hasGcsPrefix() { * *
    * Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
@@ -159,7 +159,7 @@ public java.lang.String getGcsPrefix() { * *
    * Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
@@ -573,7 +573,7 @@ public Builder clearDestination() { * *
      * Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
@@ -591,7 +591,7 @@ public boolean hasGcsPrefix() { * *
      * Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
@@ -622,7 +622,7 @@ public java.lang.String getGcsPrefix() { * *
      * Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
@@ -653,7 +653,7 @@ public com.google.protobuf.ByteString getGcsPrefixBytes() { * *
      * Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
@@ -677,7 +677,7 @@ public Builder setGcsPrefix(java.lang.String value) { * *
      * Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
@@ -699,7 +699,7 @@ public Builder clearGcsPrefix() { * *
      * Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportErrorConfigOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportErrorConfigOrBuilder.java index c830ba4a5096..81ba7ecc13b9 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportErrorConfigOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportErrorConfigOrBuilder.java @@ -28,7 +28,7 @@ public interface ImportErrorConfigOrBuilder * *
    * Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
@@ -43,7 +43,7 @@ public interface ImportErrorConfigOrBuilder * *
    * Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
@@ -58,7 +58,7 @@ public interface ImportErrorConfigOrBuilder * *
    * Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsMetadata.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsMetadata.java index b86ba0b2bbdb..c79086aa0bcc 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsMetadata.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsMetadata.java @@ -22,7 +22,7 @@ * * *
- * Metadata related to the progress of the Import operation. This will be
+ * Metadata related to the progress of the Import operation. This is
  * returned by the google.longrunning.Operation.metadata field.
  * 
* @@ -393,7 +393,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Metadata related to the progress of the Import operation. This will be
+   * Metadata related to the progress of the Import operation. This is
    * returned by the google.longrunning.Operation.metadata field.
    * 
* diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsRequest.java index c28d6544c3bf..87e68ccee4be 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsRequest.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsRequest.java @@ -1183,11 +1183,10 @@ public SourceCase getSourceCase() { * * *
-   * Required. The Inline source for the input content for UserEvents.
+   * The Inline source for the input content for UserEvents.
    * 
* - * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * * * @return Whether the inlineSource field is set. @@ -1200,11 +1199,10 @@ public boolean hasInlineSource() { * * *
-   * Required. The Inline source for the input content for UserEvents.
+   * The Inline source for the input content for UserEvents.
    * 
* - * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * * * @return The inlineSource. @@ -1222,11 +1220,10 @@ public boolean hasInlineSource() { * * *
-   * Required. The Inline source for the input content for UserEvents.
+   * The Inline source for the input content for UserEvents.
    * 
* - * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * */ @java.lang.Override @@ -1244,12 +1241,10 @@ public boolean hasInlineSource() { * * *
-   * Required. Cloud Storage location for the input content.
+   * Cloud Storage location for the input content.
    * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; * * @return Whether the gcsSource field is set. */ @@ -1261,12 +1256,10 @@ public boolean hasGcsSource() { * * *
-   * Required. Cloud Storage location for the input content.
+   * Cloud Storage location for the input content.
    * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; * * @return The gcsSource. */ @@ -1281,12 +1274,10 @@ public com.google.cloud.discoveryengine.v1.GcsSource getGcsSource() { * * *
-   * Required. Cloud Storage location for the input content.
+   * Cloud Storage location for the input content.
    * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; */ @java.lang.Override public com.google.cloud.discoveryengine.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { @@ -1301,12 +1292,10 @@ public com.google.cloud.discoveryengine.v1.GcsSourceOrBuilder getGcsSourceOrBuil * * *
-   * Required. BigQuery input source.
+   * BigQuery input source.
    * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; * * @return Whether the bigquerySource field is set. */ @@ -1318,12 +1307,10 @@ public boolean hasBigquerySource() { * * *
-   * Required. BigQuery input source.
+   * BigQuery input source.
    * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; * * @return The bigquerySource. */ @@ -1338,12 +1325,10 @@ public com.google.cloud.discoveryengine.v1.BigQuerySource getBigquerySource() { * * *
-   * Required. BigQuery input source.
+   * BigQuery input source.
    * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; */ @java.lang.Override public com.google.cloud.discoveryengine.v1.BigQuerySourceOrBuilder getBigquerySourceOrBuilder() { @@ -1983,11 +1968,11 @@ public Builder clearSource() { * * *
-     * Required. The Inline source for the input content for UserEvents.
+     * The Inline source for the input content for UserEvents.
      * 
* * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * * * @return Whether the inlineSource field is set. @@ -2000,11 +1985,11 @@ public boolean hasInlineSource() { * * *
-     * Required. The Inline source for the input content for UserEvents.
+     * The Inline source for the input content for UserEvents.
      * 
* * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * * * @return The inlineSource. @@ -2030,11 +2015,11 @@ public boolean hasInlineSource() { * * *
-     * Required. The Inline source for the input content for UserEvents.
+     * The Inline source for the input content for UserEvents.
      * 
* * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * */ public Builder setInlineSource( @@ -2055,11 +2040,11 @@ public Builder setInlineSource( * * *
-     * Required. The Inline source for the input content for UserEvents.
+     * The Inline source for the input content for UserEvents.
      * 
* * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * */ public Builder setInlineSource( @@ -2078,11 +2063,11 @@ public Builder setInlineSource( * * *
-     * Required. The Inline source for the input content for UserEvents.
+     * The Inline source for the input content for UserEvents.
      * 
* * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * */ public Builder mergeInlineSource( @@ -2116,11 +2101,11 @@ public Builder mergeInlineSource( * * *
-     * Required. The Inline source for the input content for UserEvents.
+     * The Inline source for the input content for UserEvents.
      * 
* * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * */ public Builder clearInlineSource() { @@ -2143,11 +2128,11 @@ public Builder clearInlineSource() { * * *
-     * Required. The Inline source for the input content for UserEvents.
+     * The Inline source for the input content for UserEvents.
      * 
* * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * */ public com.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.Builder @@ -2158,11 +2143,11 @@ public Builder clearInlineSource() { * * *
-     * Required. The Inline source for the input content for UserEvents.
+     * The Inline source for the input content for UserEvents.
      * 
* * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * */ @java.lang.Override @@ -2182,11 +2167,11 @@ public Builder clearInlineSource() { * * *
-     * Required. The Inline source for the input content for UserEvents.
+     * The Inline source for the input content for UserEvents.
      * 
* * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * */ private com.google.protobuf.SingleFieldBuilderV3< @@ -2224,12 +2209,10 @@ public Builder clearInlineSource() { * * *
-     * Required. Cloud Storage location for the input content.
+     * Cloud Storage location for the input content.
      * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; * * @return Whether the gcsSource field is set. */ @@ -2241,12 +2224,10 @@ public boolean hasGcsSource() { * * *
-     * Required. Cloud Storage location for the input content.
+     * Cloud Storage location for the input content.
      * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; * * @return The gcsSource. */ @@ -2268,12 +2249,10 @@ public com.google.cloud.discoveryengine.v1.GcsSource getGcsSource() { * * *
-     * Required. Cloud Storage location for the input content.
+     * Cloud Storage location for the input content.
      * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; */ public Builder setGcsSource(com.google.cloud.discoveryengine.v1.GcsSource value) { if (gcsSourceBuilder_ == null) { @@ -2292,12 +2271,10 @@ public Builder setGcsSource(com.google.cloud.discoveryengine.v1.GcsSource value) * * *
-     * Required. Cloud Storage location for the input content.
+     * Cloud Storage location for the input content.
      * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; */ public Builder setGcsSource( com.google.cloud.discoveryengine.v1.GcsSource.Builder builderForValue) { @@ -2314,12 +2291,10 @@ public Builder setGcsSource( * * *
-     * Required. Cloud Storage location for the input content.
+     * Cloud Storage location for the input content.
      * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; */ public Builder mergeGcsSource(com.google.cloud.discoveryengine.v1.GcsSource value) { if (gcsSourceBuilder_ == null) { @@ -2348,12 +2323,10 @@ public Builder mergeGcsSource(com.google.cloud.discoveryengine.v1.GcsSource valu * * *
-     * Required. Cloud Storage location for the input content.
+     * Cloud Storage location for the input content.
      * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; */ public Builder clearGcsSource() { if (gcsSourceBuilder_ == null) { @@ -2375,12 +2348,10 @@ public Builder clearGcsSource() { * * *
-     * Required. Cloud Storage location for the input content.
+     * Cloud Storage location for the input content.
      * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; */ public com.google.cloud.discoveryengine.v1.GcsSource.Builder getGcsSourceBuilder() { return getGcsSourceFieldBuilder().getBuilder(); @@ -2389,12 +2360,10 @@ public com.google.cloud.discoveryengine.v1.GcsSource.Builder getGcsSourceBuilder * * *
-     * Required. Cloud Storage location for the input content.
+     * Cloud Storage location for the input content.
      * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; */ @java.lang.Override public com.google.cloud.discoveryengine.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { @@ -2411,12 +2380,10 @@ public com.google.cloud.discoveryengine.v1.GcsSourceOrBuilder getGcsSourceOrBuil * * *
-     * Required. Cloud Storage location for the input content.
+     * Cloud Storage location for the input content.
      * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.discoveryengine.v1.GcsSource, @@ -2451,12 +2418,10 @@ public com.google.cloud.discoveryengine.v1.GcsSourceOrBuilder getGcsSourceOrBuil * * *
-     * Required. BigQuery input source.
+     * BigQuery input source.
      * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; * * @return Whether the bigquerySource field is set. */ @@ -2468,12 +2433,10 @@ public boolean hasBigquerySource() { * * *
-     * Required. BigQuery input source.
+     * BigQuery input source.
      * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; * * @return The bigquerySource. */ @@ -2495,12 +2458,10 @@ public com.google.cloud.discoveryengine.v1.BigQuerySource getBigquerySource() { * * *
-     * Required. BigQuery input source.
+     * BigQuery input source.
      * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; */ public Builder setBigquerySource(com.google.cloud.discoveryengine.v1.BigQuerySource value) { if (bigquerySourceBuilder_ == null) { @@ -2519,12 +2480,10 @@ public Builder setBigquerySource(com.google.cloud.discoveryengine.v1.BigQuerySou * * *
-     * Required. BigQuery input source.
+     * BigQuery input source.
      * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; */ public Builder setBigquerySource( com.google.cloud.discoveryengine.v1.BigQuerySource.Builder builderForValue) { @@ -2541,12 +2500,10 @@ public Builder setBigquerySource( * * *
-     * Required. BigQuery input source.
+     * BigQuery input source.
      * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; */ public Builder mergeBigquerySource(com.google.cloud.discoveryengine.v1.BigQuerySource value) { if (bigquerySourceBuilder_ == null) { @@ -2575,12 +2532,10 @@ public Builder mergeBigquerySource(com.google.cloud.discoveryengine.v1.BigQueryS * * *
-     * Required. BigQuery input source.
+     * BigQuery input source.
      * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; */ public Builder clearBigquerySource() { if (bigquerySourceBuilder_ == null) { @@ -2602,12 +2557,10 @@ public Builder clearBigquerySource() { * * *
-     * Required. BigQuery input source.
+     * BigQuery input source.
      * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; */ public com.google.cloud.discoveryengine.v1.BigQuerySource.Builder getBigquerySourceBuilder() { return getBigquerySourceFieldBuilder().getBuilder(); @@ -2616,12 +2569,10 @@ public com.google.cloud.discoveryengine.v1.BigQuerySource.Builder getBigquerySou * * *
-     * Required. BigQuery input source.
+     * BigQuery input source.
      * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; */ @java.lang.Override public com.google.cloud.discoveryengine.v1.BigQuerySourceOrBuilder @@ -2639,12 +2590,10 @@ public com.google.cloud.discoveryengine.v1.BigQuerySource.Builder getBigquerySou * * *
-     * Required. BigQuery input source.
+     * BigQuery input source.
      * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.discoveryengine.v1.BigQuerySource, diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsRequestOrBuilder.java index c556dcbae392..cb2a2f8e3a64 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsRequestOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ImportUserEventsRequestOrBuilder.java @@ -27,11 +27,10 @@ public interface ImportUserEventsRequestOrBuilder * * *
-   * Required. The Inline source for the input content for UserEvents.
+   * The Inline source for the input content for UserEvents.
    * 
* - * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * * * @return Whether the inlineSource field is set. @@ -41,11 +40,10 @@ public interface ImportUserEventsRequestOrBuilder * * *
-   * Required. The Inline source for the input content for UserEvents.
+   * The Inline source for the input content for UserEvents.
    * 
* - * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * * * @return The inlineSource. @@ -55,11 +53,10 @@ public interface ImportUserEventsRequestOrBuilder * * *
-   * Required. The Inline source for the input content for UserEvents.
+   * The Inline source for the input content for UserEvents.
    * 
* - * - * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource inline_source = 2; * */ com.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSourceOrBuilder @@ -69,12 +66,10 @@ public interface ImportUserEventsRequestOrBuilder * * *
-   * Required. Cloud Storage location for the input content.
+   * Cloud Storage location for the input content.
    * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; * * @return Whether the gcsSource field is set. */ @@ -83,12 +78,10 @@ public interface ImportUserEventsRequestOrBuilder * * *
-   * Required. Cloud Storage location for the input content.
+   * Cloud Storage location for the input content.
    * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; * * @return The gcsSource. */ @@ -97,12 +90,10 @@ public interface ImportUserEventsRequestOrBuilder * * *
-   * Required. Cloud Storage location for the input content.
+   * Cloud Storage location for the input content.
    * 
* - * - * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.GcsSource gcs_source = 3; */ com.google.cloud.discoveryengine.v1.GcsSourceOrBuilder getGcsSourceOrBuilder(); @@ -110,12 +101,10 @@ public interface ImportUserEventsRequestOrBuilder * * *
-   * Required. BigQuery input source.
+   * BigQuery input source.
    * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; * * @return Whether the bigquerySource field is set. */ @@ -124,12 +113,10 @@ public interface ImportUserEventsRequestOrBuilder * * *
-   * Required. BigQuery input source.
+   * BigQuery input source.
    * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; * * @return The bigquerySource. */ @@ -138,12 +125,10 @@ public interface ImportUserEventsRequestOrBuilder * * *
-   * Required. BigQuery input source.
+   * BigQuery input source.
    * 
* - * - * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4 [(.google.api.field_behavior) = REQUIRED]; - * + * .google.cloud.discoveryengine.v1.BigQuerySource bigquery_source = 4; */ com.google.cloud.discoveryengine.v1.BigQuerySourceOrBuilder getBigquerySourceOrBuilder(); diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Interval.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Interval.java new file mode 100644 index 000000000000..b0e98fa59d2d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Interval.java @@ -0,0 +1,1148 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/common.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * A floating point interval.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.Interval} + */ +public final class Interval extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.Interval) + IntervalOrBuilder { + private static final long serialVersionUID = 0L; + // Use Interval.newBuilder() to construct. + private Interval(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Interval() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Interval(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.CommonProto + .internal_static_google_cloud_discoveryengine_v1_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.CommonProto + .internal_static_google_cloud_discoveryengine_v1_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.Interval.class, + com.google.cloud.discoveryengine.v1.Interval.Builder.class); + } + + private int minCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object min_; + + public enum MinCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MINIMUM(1), + EXCLUSIVE_MINIMUM(2), + MIN_NOT_SET(0); + private final int value; + + private MinCase(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 MinCase valueOf(int value) { + return forNumber(value); + } + + public static MinCase forNumber(int value) { + switch (value) { + case 1: + return MINIMUM; + case 2: + return EXCLUSIVE_MINIMUM; + case 0: + return MIN_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MinCase getMinCase() { + return MinCase.forNumber(minCase_); + } + + private int maxCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object max_; + + public enum MaxCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAXIMUM(3), + EXCLUSIVE_MAXIMUM(4), + MAX_NOT_SET(0); + private final int value; + + private MaxCase(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 MaxCase valueOf(int value) { + return forNumber(value); + } + + public static MaxCase forNumber(int value) { + switch (value) { + case 3: + return MAXIMUM; + case 4: + return EXCLUSIVE_MAXIMUM; + case 0: + return MAX_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MaxCase getMaxCase() { + return MaxCase.forNumber(maxCase_); + } + + public static final int MINIMUM_FIELD_NUMBER = 1; + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + @java.lang.Override + public boolean hasMinimum() { + return minCase_ == 1; + } + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + @java.lang.Override + public double getMinimum() { + if (minCase_ == 1) { + return (java.lang.Double) min_; + } + return 0D; + } + + public static final int EXCLUSIVE_MINIMUM_FIELD_NUMBER = 2; + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + @java.lang.Override + public boolean hasExclusiveMinimum() { + return minCase_ == 2; + } + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + @java.lang.Override + public double getExclusiveMinimum() { + if (minCase_ == 2) { + return (java.lang.Double) min_; + } + return 0D; + } + + public static final int MAXIMUM_FIELD_NUMBER = 3; + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + @java.lang.Override + public boolean hasMaximum() { + return maxCase_ == 3; + } + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + @java.lang.Override + public double getMaximum() { + if (maxCase_ == 3) { + return (java.lang.Double) max_; + } + return 0D; + } + + public static final int EXCLUSIVE_MAXIMUM_FIELD_NUMBER = 4; + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + @java.lang.Override + public boolean hasExclusiveMaximum() { + return maxCase_ == 4; + } + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + @java.lang.Override + public double getExclusiveMaximum() { + if (maxCase_ == 4) { + return (java.lang.Double) max_; + } + return 0D; + } + + 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 (minCase_ == 1) { + output.writeDouble(1, (double) ((java.lang.Double) min_)); + } + if (minCase_ == 2) { + output.writeDouble(2, (double) ((java.lang.Double) min_)); + } + if (maxCase_ == 3) { + output.writeDouble(3, (double) ((java.lang.Double) max_)); + } + if (maxCase_ == 4) { + output.writeDouble(4, (double) ((java.lang.Double) max_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 1, (double) ((java.lang.Double) min_)); + } + if (minCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 2, (double) ((java.lang.Double) min_)); + } + if (maxCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 3, (double) ((java.lang.Double) max_)); + } + if (maxCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 4, (double) ((java.lang.Double) max_)); + } + 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.discoveryengine.v1.Interval)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.Interval other = + (com.google.cloud.discoveryengine.v1.Interval) obj; + + if (!getMinCase().equals(other.getMinCase())) return false; + switch (minCase_) { + case 1: + if (java.lang.Double.doubleToLongBits(getMinimum()) + != java.lang.Double.doubleToLongBits(other.getMinimum())) return false; + break; + case 2: + if (java.lang.Double.doubleToLongBits(getExclusiveMinimum()) + != java.lang.Double.doubleToLongBits(other.getExclusiveMinimum())) return false; + break; + case 0: + default: + } + if (!getMaxCase().equals(other.getMaxCase())) return false; + switch (maxCase_) { + case 3: + if (java.lang.Double.doubleToLongBits(getMaximum()) + != java.lang.Double.doubleToLongBits(other.getMaximum())) return false; + break; + case 4: + if (java.lang.Double.doubleToLongBits(getExclusiveMaximum()) + != java.lang.Double.doubleToLongBits(other.getExclusiveMaximum())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (minCase_) { + case 1: + hash = (37 * hash) + MINIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMinimum())); + break; + case 2: + hash = (37 * hash) + EXCLUSIVE_MINIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getExclusiveMinimum())); + break; + case 0: + default: + } + switch (maxCase_) { + case 3: + hash = (37 * hash) + MAXIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMaximum())); + break; + case 4: + hash = (37 * hash) + EXCLUSIVE_MAXIMUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getExclusiveMaximum())); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.Interval parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.Interval 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.discoveryengine.v1.Interval parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.Interval 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.discoveryengine.v1.Interval parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.Interval parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.Interval parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.Interval 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.discoveryengine.v1.Interval parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.Interval 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.discoveryengine.v1.Interval parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.Interval 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.discoveryengine.v1.Interval 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 floating point interval.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.Interval} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.Interval) + com.google.cloud.discoveryengine.v1.IntervalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.CommonProto + .internal_static_google_cloud_discoveryengine_v1_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.CommonProto + .internal_static_google_cloud_discoveryengine_v1_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.Interval.class, + com.google.cloud.discoveryengine.v1.Interval.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.Interval.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minCase_ = 0; + min_ = null; + maxCase_ = 0; + max_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.CommonProto + .internal_static_google_cloud_discoveryengine_v1_Interval_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Interval getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Interval build() { + com.google.cloud.discoveryengine.v1.Interval result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Interval buildPartial() { + com.google.cloud.discoveryengine.v1.Interval result = + new com.google.cloud.discoveryengine.v1.Interval(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1.Interval result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.discoveryengine.v1.Interval result) { + result.minCase_ = minCase_; + result.min_ = this.min_; + result.maxCase_ = maxCase_; + result.max_ = this.max_; + } + + @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.discoveryengine.v1.Interval) { + return mergeFrom((com.google.cloud.discoveryengine.v1.Interval) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.Interval other) { + if (other == com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance()) return this; + switch (other.getMinCase()) { + case MINIMUM: + { + setMinimum(other.getMinimum()); + break; + } + case EXCLUSIVE_MINIMUM: + { + setExclusiveMinimum(other.getExclusiveMinimum()); + break; + } + case MIN_NOT_SET: + { + break; + } + } + switch (other.getMaxCase()) { + case MAXIMUM: + { + setMaximum(other.getMaximum()); + break; + } + case EXCLUSIVE_MAXIMUM: + { + setExclusiveMaximum(other.getExclusiveMaximum()); + break; + } + case MAX_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 9: + { + min_ = input.readDouble(); + minCase_ = 1; + break; + } // case 9 + case 17: + { + min_ = input.readDouble(); + minCase_ = 2; + break; + } // case 17 + case 25: + { + max_ = input.readDouble(); + maxCase_ = 3; + break; + } // case 25 + case 33: + { + max_ = input.readDouble(); + maxCase_ = 4; + break; + } // case 33 + 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 minCase_ = 0; + private java.lang.Object min_; + + public MinCase getMinCase() { + return MinCase.forNumber(minCase_); + } + + public Builder clearMin() { + minCase_ = 0; + min_ = null; + onChanged(); + return this; + } + + private int maxCase_ = 0; + private java.lang.Object max_; + + public MaxCase getMaxCase() { + return MaxCase.forNumber(maxCase_); + } + + public Builder clearMax() { + maxCase_ = 0; + max_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + public boolean hasMinimum() { + return minCase_ == 1; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + public double getMinimum() { + if (minCase_ == 1) { + return (java.lang.Double) min_; + } + return 0D; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @param value The minimum to set. + * @return This builder for chaining. + */ + public Builder setMinimum(double value) { + + minCase_ = 1; + min_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Inclusive lower bound.
+     * 
+ * + * double minimum = 1; + * + * @return This builder for chaining. + */ + public Builder clearMinimum() { + if (minCase_ == 1) { + minCase_ = 0; + min_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + public boolean hasExclusiveMinimum() { + return minCase_ == 2; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + public double getExclusiveMinimum() { + if (minCase_ == 2) { + return (java.lang.Double) min_; + } + return 0D; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @param value The exclusiveMinimum to set. + * @return This builder for chaining. + */ + public Builder setExclusiveMinimum(double value) { + + minCase_ = 2; + min_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Exclusive lower bound.
+     * 
+ * + * double exclusive_minimum = 2; + * + * @return This builder for chaining. + */ + public Builder clearExclusiveMinimum() { + if (minCase_ == 2) { + minCase_ = 0; + min_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + public boolean hasMaximum() { + return maxCase_ == 3; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + public double getMaximum() { + if (maxCase_ == 3) { + return (java.lang.Double) max_; + } + return 0D; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @param value The maximum to set. + * @return This builder for chaining. + */ + public Builder setMaximum(double value) { + + maxCase_ = 3; + max_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Inclusive upper bound.
+     * 
+ * + * double maximum = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaximum() { + if (maxCase_ == 3) { + maxCase_ = 0; + max_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + public boolean hasExclusiveMaximum() { + return maxCase_ == 4; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + public double getExclusiveMaximum() { + if (maxCase_ == 4) { + return (java.lang.Double) max_; + } + return 0D; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @param value The exclusiveMaximum to set. + * @return This builder for chaining. + */ + public Builder setExclusiveMaximum(double value) { + + maxCase_ = 4; + max_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Exclusive upper bound.
+     * 
+ * + * double exclusive_maximum = 4; + * + * @return This builder for chaining. + */ + public Builder clearExclusiveMaximum() { + if (maxCase_ == 4) { + maxCase_ = 0; + max_ = null; + 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.discoveryengine.v1.Interval) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.Interval) + private static final com.google.cloud.discoveryengine.v1.Interval DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.Interval(); + } + + public static com.google.cloud.discoveryengine.v1.Interval getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Interval 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.discoveryengine.v1.Interval getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/IntervalOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/IntervalOrBuilder.java new file mode 100644 index 000000000000..65d94732603b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/IntervalOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/common.proto + +package com.google.cloud.discoveryengine.v1; + +public interface IntervalOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.Interval) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return Whether the minimum field is set. + */ + boolean hasMinimum(); + /** + * + * + *
+   * Inclusive lower bound.
+   * 
+ * + * double minimum = 1; + * + * @return The minimum. + */ + double getMinimum(); + + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return Whether the exclusiveMinimum field is set. + */ + boolean hasExclusiveMinimum(); + /** + * + * + *
+   * Exclusive lower bound.
+   * 
+ * + * double exclusive_minimum = 2; + * + * @return The exclusiveMinimum. + */ + double getExclusiveMinimum(); + + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return Whether the maximum field is set. + */ + boolean hasMaximum(); + /** + * + * + *
+   * Inclusive upper bound.
+   * 
+ * + * double maximum = 3; + * + * @return The maximum. + */ + double getMaximum(); + + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return Whether the exclusiveMaximum field is set. + */ + boolean hasExclusiveMaximum(); + /** + * + * + *
+   * Exclusive upper bound.
+   * 
+ * + * double exclusive_maximum = 4; + * + * @return The exclusiveMaximum. + */ + double getExclusiveMaximum(); + + com.google.cloud.discoveryengine.v1.Interval.MinCase getMinCase(); + + com.google.cloud.discoveryengine.v1.Interval.MaxCase getMaxCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsRequest.java new file mode 100644 index 000000000000..53505b525475 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsRequest.java @@ -0,0 +1,1391 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Request for ListConversations method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ListConversationsRequest} + */ +public final class ListConversationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.ListConversationsRequest) + ListConversationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConversationsRequest.newBuilder() to construct. + private ListConversationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConversationsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConversationsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ListConversationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ListConversationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ListConversationsRequest.class, + com.google.cloud.discoveryengine.v1.ListConversationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The data store resource name. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The data store resource name. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Maximum number of results to return. If unspecified, defaults
+   * to 50. Max allowed value is 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListConversations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListConversations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * A filter to apply on the list results. The supported features are:
+   * user_pseudo_id, state.
+   *
+   * Example:
+   * "user_pseudo_id = some_id"
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filter to apply on the list results. The supported features are:
+   * user_pseudo_id, state.
+   *
+   * Example:
+   * "user_pseudo_id = some_id"
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * A comma-separated list of fields to order by, sorted in ascending order.
+   * Use "desc" after a field name for descending.
+   * Supported fields:
+   *   * `update_time`
+   *   * `create_time`
+   *   * `conversation_name`
+   *
+   * Example:
+   * "update_time desc"
+   * "create_time"
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * A comma-separated list of fields to order by, sorted in ascending order.
+   * Use "desc" after a field name for descending.
+   * Supported fields:
+   *   * `update_time`
+   *   * `create_time`
+   *   * `conversation_name`
+   *
+   * Example:
+   * "update_time desc"
+   * "create_time"
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.discoveryengine.v1.ListConversationsRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.ListConversationsRequest other = + (com.google.cloud.discoveryengine.v1.ListConversationsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsRequest 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.discoveryengine.v1.ListConversationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsRequest 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.discoveryengine.v1.ListConversationsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsRequest 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.discoveryengine.v1.ListConversationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsRequest 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.discoveryengine.v1.ListConversationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsRequest 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.discoveryengine.v1.ListConversationsRequest 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 for ListConversations method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ListConversationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.ListConversationsRequest) + com.google.cloud.discoveryengine.v1.ListConversationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ListConversationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ListConversationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ListConversationsRequest.class, + com.google.cloud.discoveryengine.v1.ListConversationsRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.ListConversationsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ListConversationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ListConversationsRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.ListConversationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ListConversationsRequest build() { + com.google.cloud.discoveryengine.v1.ListConversationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ListConversationsRequest buildPartial() { + com.google.cloud.discoveryengine.v1.ListConversationsRequest result = + new com.google.cloud.discoveryengine.v1.ListConversationsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.ListConversationsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.discoveryengine.v1.ListConversationsRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1.ListConversationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.ListConversationsRequest other) { + if (other + == com.google.cloud.discoveryengine.v1.ListConversationsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The data store resource name. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The data store resource name. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The data store resource name. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The data store resource name. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The data store resource name. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of results to return. If unspecified, defaults
+     * to 50. Max allowed value is 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of results to return. If unspecified, defaults
+     * to 50. Max allowed value is 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of results to return. If unspecified, defaults
+     * to 50. Max allowed value is 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListConversations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListConversations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListConversations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListConversations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListConversations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filter to apply on the list results. The supported features are:
+     * user_pseudo_id, state.
+     *
+     * Example:
+     * "user_pseudo_id = some_id"
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filter to apply on the list results. The supported features are:
+     * user_pseudo_id, state.
+     *
+     * Example:
+     * "user_pseudo_id = some_id"
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filter to apply on the list results. The supported features are:
+     * user_pseudo_id, state.
+     *
+     * Example:
+     * "user_pseudo_id = some_id"
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter to apply on the list results. The supported features are:
+     * user_pseudo_id, state.
+     *
+     * Example:
+     * "user_pseudo_id = some_id"
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter to apply on the list results. The supported features are:
+     * user_pseudo_id, state.
+     *
+     * Example:
+     * "user_pseudo_id = some_id"
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * A comma-separated list of fields to order by, sorted in ascending order.
+     * Use "desc" after a field name for descending.
+     * Supported fields:
+     *   * `update_time`
+     *   * `create_time`
+     *   * `conversation_name`
+     *
+     * Example:
+     * "update_time desc"
+     * "create_time"
+     * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A comma-separated list of fields to order by, sorted in ascending order.
+     * Use "desc" after a field name for descending.
+     * Supported fields:
+     *   * `update_time`
+     *   * `create_time`
+     *   * `conversation_name`
+     *
+     * Example:
+     * "update_time desc"
+     * "create_time"
+     * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A comma-separated list of fields to order by, sorted in ascending order.
+     * Use "desc" after a field name for descending.
+     * Supported fields:
+     *   * `update_time`
+     *   * `create_time`
+     *   * `conversation_name`
+     *
+     * Example:
+     * "update_time desc"
+     * "create_time"
+     * 
+ * + * string order_by = 5; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * A comma-separated list of fields to order by, sorted in ascending order.
+     * Use "desc" after a field name for descending.
+     * Supported fields:
+     *   * `update_time`
+     *   * `create_time`
+     *   * `conversation_name`
+     *
+     * Example:
+     * "update_time desc"
+     * "create_time"
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * A comma-separated list of fields to order by, sorted in ascending order.
+     * Use "desc" after a field name for descending.
+     * Supported fields:
+     *   * `update_time`
+     *   * `create_time`
+     *   * `conversation_name`
+     *
+     * Example:
+     * "update_time desc"
+     * "create_time"
+     * 
+ * + * string order_by = 5; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + 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.discoveryengine.v1.ListConversationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.ListConversationsRequest) + private static final com.google.cloud.discoveryengine.v1.ListConversationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.ListConversationsRequest(); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConversationsRequest 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.discoveryengine.v1.ListConversationsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsRequestOrBuilder.java new file mode 100644 index 000000000000..ed52f56cd58c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsRequestOrBuilder.java @@ -0,0 +1,173 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +public interface ListConversationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.ListConversationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The data store resource name. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The data store resource name. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of results to return. If unspecified, defaults
+   * to 50. Max allowed value is 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListConversations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListConversations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A filter to apply on the list results. The supported features are:
+   * user_pseudo_id, state.
+   *
+   * Example:
+   * "user_pseudo_id = some_id"
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter to apply on the list results. The supported features are:
+   * user_pseudo_id, state.
+   *
+   * Example:
+   * "user_pseudo_id = some_id"
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * A comma-separated list of fields to order by, sorted in ascending order.
+   * Use "desc" after a field name for descending.
+   * Supported fields:
+   *   * `update_time`
+   *   * `create_time`
+   *   * `conversation_name`
+   *
+   * Example:
+   * "update_time desc"
+   * "create_time"
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * A comma-separated list of fields to order by, sorted in ascending order.
+   * Use "desc" after a field name for descending.
+   * Supported fields:
+   *   * `update_time`
+   *   * `create_time`
+   *   * `conversation_name`
+   *
+   * Example:
+   * "update_time desc"
+   * "create_time"
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsResponse.java new file mode 100644 index 000000000000..b6a8110a880c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsResponse.java @@ -0,0 +1,1135 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Response for ListConversations method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ListConversationsResponse} + */ +public final class ListConversationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.ListConversationsResponse) + ListConversationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConversationsResponse.newBuilder() to construct. + private ListConversationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConversationsResponse() { + conversations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConversationsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ListConversationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ListConversationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ListConversationsResponse.class, + com.google.cloud.discoveryengine.v1.ListConversationsResponse.Builder.class); + } + + public static final int CONVERSATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List conversations_; + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + @java.lang.Override + public java.util.List getConversationsList() { + return conversations_; + } + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + @java.lang.Override + public java.util.List + getConversationsOrBuilderList() { + return conversations_; + } + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + @java.lang.Override + public int getConversationsCount() { + return conversations_.size(); + } + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Conversation getConversations(int index) { + return conversations_.get(index); + } + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationsOrBuilder( + int index) { + return conversations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Pagination token, if not returned indicates the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Pagination token, if not returned indicates the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < conversations_.size(); i++) { + output.writeMessage(1, conversations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < conversations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, conversations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1.ListConversationsResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.ListConversationsResponse other = + (com.google.cloud.discoveryengine.v1.ListConversationsResponse) obj; + + if (!getConversationsList().equals(other.getConversationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getConversationsCount() > 0) { + hash = (37 * hash) + CONVERSATIONS_FIELD_NUMBER; + hash = (53 * hash) + getConversationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsResponse 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.discoveryengine.v1.ListConversationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsResponse 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.discoveryengine.v1.ListConversationsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsResponse 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.discoveryengine.v1.ListConversationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsResponse 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.discoveryengine.v1.ListConversationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsResponse 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.discoveryengine.v1.ListConversationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for ListConversations method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.ListConversationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.ListConversationsResponse) + com.google.cloud.discoveryengine.v1.ListConversationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ListConversationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ListConversationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.ListConversationsResponse.class, + com.google.cloud.discoveryengine.v1.ListConversationsResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.ListConversationsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (conversationsBuilder_ == null) { + conversations_ = java.util.Collections.emptyList(); + } else { + conversations_ = null; + conversationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_ListConversationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ListConversationsResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.ListConversationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ListConversationsResponse build() { + com.google.cloud.discoveryengine.v1.ListConversationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ListConversationsResponse buildPartial() { + com.google.cloud.discoveryengine.v1.ListConversationsResponse result = + new com.google.cloud.discoveryengine.v1.ListConversationsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1.ListConversationsResponse result) { + if (conversationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + conversations_ = java.util.Collections.unmodifiableList(conversations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conversations_ = conversations_; + } else { + result.conversations_ = conversationsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.ListConversationsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1.ListConversationsResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1.ListConversationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.ListConversationsResponse other) { + if (other + == com.google.cloud.discoveryengine.v1.ListConversationsResponse.getDefaultInstance()) + return this; + if (conversationsBuilder_ == null) { + if (!other.conversations_.isEmpty()) { + if (conversations_.isEmpty()) { + conversations_ = other.conversations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConversationsIsMutable(); + conversations_.addAll(other.conversations_); + } + onChanged(); + } + } else { + if (!other.conversations_.isEmpty()) { + if (conversationsBuilder_.isEmpty()) { + conversationsBuilder_.dispose(); + conversationsBuilder_ = null; + conversations_ = other.conversations_; + bitField0_ = (bitField0_ & ~0x00000001); + conversationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConversationsFieldBuilder() + : null; + } else { + conversationsBuilder_.addAllMessages(other.conversations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1.Conversation m = + input.readMessage( + com.google.cloud.discoveryengine.v1.Conversation.parser(), + extensionRegistry); + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + conversations_.add(m); + } else { + conversationsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List conversations_ = + java.util.Collections.emptyList(); + + private void ensureConversationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + conversations_ = + new java.util.ArrayList( + conversations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder> + conversationsBuilder_; + + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public java.util.List getConversationsList() { + if (conversationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(conversations_); + } else { + return conversationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public int getConversationsCount() { + if (conversationsBuilder_ == null) { + return conversations_.size(); + } else { + return conversationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public com.google.cloud.discoveryengine.v1.Conversation getConversations(int index) { + if (conversationsBuilder_ == null) { + return conversations_.get(index); + } else { + return conversationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public Builder setConversations( + int index, com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversationsIsMutable(); + conversations_.set(index, value); + onChanged(); + } else { + conversationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public Builder setConversations( + int index, com.google.cloud.discoveryengine.v1.Conversation.Builder builderForValue) { + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + conversations_.set(index, builderForValue.build()); + onChanged(); + } else { + conversationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public Builder addConversations(com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversationsIsMutable(); + conversations_.add(value); + onChanged(); + } else { + conversationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public Builder addConversations( + int index, com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversationsIsMutable(); + conversations_.add(index, value); + onChanged(); + } else { + conversationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public Builder addConversations( + com.google.cloud.discoveryengine.v1.Conversation.Builder builderForValue) { + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + conversations_.add(builderForValue.build()); + onChanged(); + } else { + conversationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public Builder addConversations( + int index, com.google.cloud.discoveryengine.v1.Conversation.Builder builderForValue) { + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + conversations_.add(index, builderForValue.build()); + onChanged(); + } else { + conversationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public Builder addAllConversations( + java.lang.Iterable values) { + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conversations_); + onChanged(); + } else { + conversationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public Builder clearConversations() { + if (conversationsBuilder_ == null) { + conversations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + conversationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public Builder removeConversations(int index) { + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + conversations_.remove(index); + onChanged(); + } else { + conversationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public com.google.cloud.discoveryengine.v1.Conversation.Builder getConversationsBuilder( + int index) { + return getConversationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationsOrBuilder( + int index) { + if (conversationsBuilder_ == null) { + return conversations_.get(index); + } else { + return conversationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public java.util.List + getConversationsOrBuilderList() { + if (conversationsBuilder_ != null) { + return conversationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conversations_); + } + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public com.google.cloud.discoveryengine.v1.Conversation.Builder addConversationsBuilder() { + return getConversationsFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance()); + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public com.google.cloud.discoveryengine.v1.Conversation.Builder addConversationsBuilder( + int index) { + return getConversationsFieldBuilder() + .addBuilder(index, com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance()); + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + public java.util.List + getConversationsBuilderList() { + return getConversationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder> + getConversationsFieldBuilder() { + if (conversationsBuilder_ == null) { + conversationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder>( + conversations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + conversations_ = null; + } + return conversationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Pagination token, if not returned indicates the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Pagination token, if not returned indicates the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Pagination token, if not returned indicates the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Pagination token, if not returned indicates the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Pagination token, if not returned indicates the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.ListConversationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.ListConversationsResponse) + private static final com.google.cloud.discoveryengine.v1.ListConversationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.ListConversationsResponse(); + } + + public static com.google.cloud.discoveryengine.v1.ListConversationsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConversationsResponse 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.discoveryengine.v1.ListConversationsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsResponseOrBuilder.java new file mode 100644 index 000000000000..f1c129ddbadf --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListConversationsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +public interface ListConversationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.ListConversationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + java.util.List getConversationsList(); + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + com.google.cloud.discoveryengine.v1.Conversation getConversations(int index); + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + int getConversationsCount(); + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + java.util.List + getConversationsOrBuilderList(); + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.Conversation conversations = 1; + */ + com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationsOrBuilder(int index); + + /** + * + * + *
+   * Pagination token, if not returned indicates the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Pagination token, if not returned indicates the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListDocumentsRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListDocumentsRequest.java index 13dadd839a38..9186ecc9e07f 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListDocumentsRequest.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListDocumentsRequest.java @@ -78,9 +78,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Use `default_branch` as the branch ID, to list documents under the default * branch. * - * If the caller does not have permission to list [Documents][]s under this - * branch, regardless of whether or not this branch exists, a - * `PERMISSION_DENIED` error is returned. + * If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, + * regardless of whether or not this branch exists, a `PERMISSION_DENIED` + * error is returned. * * * @@ -110,9 +111,10 @@ public java.lang.String getParent() { * Use `default_branch` as the branch ID, to list documents under the default * branch. * - * If the caller does not have permission to list [Documents][]s under this - * branch, regardless of whether or not this branch exists, a - * `PERMISSION_DENIED` error is returned. + * If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, + * regardless of whether or not this branch exists, a `PERMISSION_DENIED` + * error is returned. * * * @@ -626,9 +628,10 @@ public Builder mergeFrom( * Use `default_branch` as the branch ID, to list documents under the default * branch. * - * If the caller does not have permission to list [Documents][]s under this - * branch, regardless of whether or not this branch exists, a - * `PERMISSION_DENIED` error is returned. + * If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, + * regardless of whether or not this branch exists, a `PERMISSION_DENIED` + * error is returned. * * * @@ -657,9 +660,10 @@ public java.lang.String getParent() { * Use `default_branch` as the branch ID, to list documents under the default * branch. * - * If the caller does not have permission to list [Documents][]s under this - * branch, regardless of whether or not this branch exists, a - * `PERMISSION_DENIED` error is returned. + * If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, + * regardless of whether or not this branch exists, a `PERMISSION_DENIED` + * error is returned. * * * @@ -688,9 +692,10 @@ public com.google.protobuf.ByteString getParentBytes() { * Use `default_branch` as the branch ID, to list documents under the default * branch. * - * If the caller does not have permission to list [Documents][]s under this - * branch, regardless of whether or not this branch exists, a - * `PERMISSION_DENIED` error is returned. + * If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, + * regardless of whether or not this branch exists, a `PERMISSION_DENIED` + * error is returned. * * * @@ -718,9 +723,10 @@ public Builder setParent(java.lang.String value) { * Use `default_branch` as the branch ID, to list documents under the default * branch. * - * If the caller does not have permission to list [Documents][]s under this - * branch, regardless of whether or not this branch exists, a - * `PERMISSION_DENIED` error is returned. + * If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, + * regardless of whether or not this branch exists, a `PERMISSION_DENIED` + * error is returned. * * * @@ -744,9 +750,10 @@ public Builder clearParent() { * Use `default_branch` as the branch ID, to list documents under the default * branch. * - * If the caller does not have permission to list [Documents][]s under this - * branch, regardless of whether or not this branch exists, a - * `PERMISSION_DENIED` error is returned. + * If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, + * regardless of whether or not this branch exists, a `PERMISSION_DENIED` + * error is returned. * * * diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListDocumentsRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListDocumentsRequestOrBuilder.java index d1eced1546e9..76fd57c9b09c 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListDocumentsRequestOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ListDocumentsRequestOrBuilder.java @@ -32,9 +32,10 @@ public interface ListDocumentsRequestOrBuilder * Use `default_branch` as the branch ID, to list documents under the default * branch. * - * If the caller does not have permission to list [Documents][]s under this - * branch, regardless of whether or not this branch exists, a - * `PERMISSION_DENIED` error is returned. + * If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, + * regardless of whether or not this branch exists, a `PERMISSION_DENIED` + * error is returned. * * * @@ -53,9 +54,10 @@ public interface ListDocumentsRequestOrBuilder * Use `default_branch` as the branch ID, to list documents under the default * branch. * - * If the caller does not have permission to list [Documents][]s under this - * branch, regardless of whether or not this branch exists, a - * `PERMISSION_DENIED` error is returned. + * If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1.Document]s under this branch, + * regardless of whether or not this branch exists, a `PERMISSION_DENIED` + * error is returned. * * * diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/MediaInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/MediaInfo.java index b4f349a354df..c25f6d4b4e7c 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/MediaInfo.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/MediaInfo.java @@ -69,8 +69,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { *
    * The media progress time in seconds, if applicable.
    * For example, if the end user has finished 90 seconds of a playback video,
-   * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-   * be set to 90.
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
    * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -87,8 +88,9 @@ public boolean hasMediaProgressDuration() { *
    * The media progress time in seconds, if applicable.
    * For example, if the end user has finished 90 seconds of a playback video,
-   * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-   * be set to 90.
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
    * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -107,8 +109,9 @@ public com.google.protobuf.Duration getMediaProgressDuration() { *
    * The media progress time in seconds, if applicable.
    * For example, if the end user has finished 90 seconds of a playback video,
-   * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-   * be set to 90.
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
    * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -126,7 +129,8 @@ public com.google.protobuf.DurationOrBuilder getMediaProgressDurationOrBuilder() * * *
-   * Media progress should be computed using only the media_progress_duration
+   * Media progress should be computed using only the
+   * [media_progress_duration][google.cloud.discoveryengine.v1.MediaInfo.media_progress_duration]
    * relative to the media total length.
    *
    * This value must be between `[0, 1.0]` inclusive.
@@ -147,7 +151,8 @@ public boolean hasMediaProgressPercentage() {
    *
    *
    * 
-   * Media progress should be computed using only the media_progress_duration
+   * Media progress should be computed using only the
+   * [media_progress_duration][google.cloud.discoveryengine.v1.MediaInfo.media_progress_duration]
    * relative to the media total length.
    *
    * This value must be between `[0, 1.0]` inclusive.
@@ -561,8 +566,9 @@ public Builder mergeFrom(
      * 
      * The media progress time in seconds, if applicable.
      * For example, if the end user has finished 90 seconds of a playback video,
-     * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-     * be set to 90.
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
      * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -578,8 +584,9 @@ public boolean hasMediaProgressDuration() { *
      * The media progress time in seconds, if applicable.
      * For example, if the end user has finished 90 seconds of a playback video,
-     * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-     * be set to 90.
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
      * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -601,8 +608,9 @@ public com.google.protobuf.Duration getMediaProgressDuration() { *
      * The media progress time in seconds, if applicable.
      * For example, if the end user has finished 90 seconds of a playback video,
-     * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-     * be set to 90.
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
      * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -626,8 +634,9 @@ public Builder setMediaProgressDuration(com.google.protobuf.Duration value) { *
      * The media progress time in seconds, if applicable.
      * For example, if the end user has finished 90 seconds of a playback video,
-     * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-     * be set to 90.
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
      * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -648,8 +657,9 @@ public Builder setMediaProgressDuration(com.google.protobuf.Duration.Builder bui *
      * The media progress time in seconds, if applicable.
      * For example, if the end user has finished 90 seconds of a playback video,
-     * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-     * be set to 90.
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
      * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -676,8 +686,9 @@ public Builder mergeMediaProgressDuration(com.google.protobuf.Duration value) { *
      * The media progress time in seconds, if applicable.
      * For example, if the end user has finished 90 seconds of a playback video,
-     * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-     * be set to 90.
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
      * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -698,8 +709,9 @@ public Builder clearMediaProgressDuration() { *
      * The media progress time in seconds, if applicable.
      * For example, if the end user has finished 90 seconds of a playback video,
-     * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-     * be set to 90.
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
      * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -715,8 +727,9 @@ public com.google.protobuf.Duration.Builder getMediaProgressDurationBuilder() { *
      * The media progress time in seconds, if applicable.
      * For example, if the end user has finished 90 seconds of a playback video,
-     * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-     * be set to 90.
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
      * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -736,8 +749,9 @@ public com.google.protobuf.DurationOrBuilder getMediaProgressDurationOrBuilder() *
      * The media progress time in seconds, if applicable.
      * For example, if the end user has finished 90 seconds of a playback video,
-     * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-     * be set to 90.
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
      * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -764,7 +778,8 @@ public com.google.protobuf.DurationOrBuilder getMediaProgressDurationOrBuilder() * * *
-     * Media progress should be computed using only the media_progress_duration
+     * Media progress should be computed using only the
+     * [media_progress_duration][google.cloud.discoveryengine.v1.MediaInfo.media_progress_duration]
      * relative to the media total length.
      *
      * This value must be between `[0, 1.0]` inclusive.
@@ -785,7 +800,8 @@ public boolean hasMediaProgressPercentage() {
      *
      *
      * 
-     * Media progress should be computed using only the media_progress_duration
+     * Media progress should be computed using only the
+     * [media_progress_duration][google.cloud.discoveryengine.v1.MediaInfo.media_progress_duration]
      * relative to the media total length.
      *
      * This value must be between `[0, 1.0]` inclusive.
@@ -806,7 +822,8 @@ public float getMediaProgressPercentage() {
      *
      *
      * 
-     * Media progress should be computed using only the media_progress_duration
+     * Media progress should be computed using only the
+     * [media_progress_duration][google.cloud.discoveryengine.v1.MediaInfo.media_progress_duration]
      * relative to the media total length.
      *
      * This value must be between `[0, 1.0]` inclusive.
@@ -831,7 +848,8 @@ public Builder setMediaProgressPercentage(float value) {
      *
      *
      * 
-     * Media progress should be computed using only the media_progress_duration
+     * Media progress should be computed using only the
+     * [media_progress_duration][google.cloud.discoveryengine.v1.MediaInfo.media_progress_duration]
      * relative to the media total length.
      *
      * This value must be between `[0, 1.0]` inclusive.
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/MediaInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/MediaInfoOrBuilder.java
index 364a0b3dafe8..92fb31ef9d0f 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/MediaInfoOrBuilder.java
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/MediaInfoOrBuilder.java
@@ -29,8 +29,9 @@ public interface MediaInfoOrBuilder
    * 
    * The media progress time in seconds, if applicable.
    * For example, if the end user has finished 90 seconds of a playback video,
-   * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-   * be set to 90.
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
    * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -44,8 +45,9 @@ public interface MediaInfoOrBuilder *
    * The media progress time in seconds, if applicable.
    * For example, if the end user has finished 90 seconds of a playback video,
-   * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-   * be set to 90.
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
    * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -59,8 +61,9 @@ public interface MediaInfoOrBuilder *
    * The media progress time in seconds, if applicable.
    * For example, if the end user has finished 90 seconds of a playback video,
-   * then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-   * be set to 90.
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
    * 
* * .google.protobuf.Duration media_progress_duration = 1; @@ -71,7 +74,8 @@ public interface MediaInfoOrBuilder * * *
-   * Media progress should be computed using only the media_progress_duration
+   * Media progress should be computed using only the
+   * [media_progress_duration][google.cloud.discoveryengine.v1.MediaInfo.media_progress_duration]
    * relative to the media total length.
    *
    * This value must be between `[0, 1.0]` inclusive.
@@ -89,7 +93,8 @@ public interface MediaInfoOrBuilder
    *
    *
    * 
-   * Media progress should be computed using only the media_progress_duration
+   * Media progress should be computed using only the
+   * [media_progress_duration][google.cloud.discoveryengine.v1.MediaInfo.media_progress_duration]
    * relative to the media total length.
    *
    * This value must be between `[0, 1.0]` inclusive.
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/PageInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/PageInfo.java
index 5824a09fc243..b11d431f1b13 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/PageInfo.java
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/PageInfo.java
@@ -77,7 +77,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    *
    * This should be kept the same for all user events triggered from the same
    * pageview. For example, an item detail page view could trigger multiple
-   * events as the user is browsing the page. The `pageViewId` property should
+   * events as the user is browsing the page. The `pageview_id` property should
    * be kept the same for all these events so that they can be grouped together
    * properly.
    *
@@ -109,7 +109,7 @@ public java.lang.String getPageviewId() {
    *
    * This should be kept the same for all user events triggered from the same
    * pageview. For example, an item detail page view could trigger multiple
-   * events as the user is browsing the page. The `pageViewId` property should
+   * events as the user is browsing the page. The `pageview_id` property should
    * be kept the same for all these events so that they can be grouped together
    * properly.
    *
@@ -150,10 +150,10 @@ public com.google.protobuf.ByteString getPageviewIdBytes() {
    *
    * Category pages include special pages such as sales or promotions. For
    * instance, a special sale page may have the category hierarchy:
-   * "pageCategory" : "Sales > 2017 Black Friday Deals".
+   * `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
    *
    * Required for `view-category-page` events. Other event types should not set
-   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
    * 
* * string page_category = 2; @@ -184,10 +184,10 @@ public java.lang.String getPageCategory() { * * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: - * "pageCategory" : "Sales > 2017 Black Friday Deals". + * `"pageCategory" : "Sales > 2017 Black Friday Deals"`. * * Required for `view-category-page` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string page_category = 2; @@ -747,7 +747,7 @@ public Builder mergeFrom( * * This should be kept the same for all user events triggered from the same * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. The `pageViewId` property should + * events as the user is browsing the page. The `pageview_id` property should * be kept the same for all these events so that they can be grouped together * properly. * @@ -778,7 +778,7 @@ public java.lang.String getPageviewId() { * * This should be kept the same for all user events triggered from the same * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. The `pageViewId` property should + * events as the user is browsing the page. The `pageview_id` property should * be kept the same for all these events so that they can be grouped together * properly. * @@ -809,7 +809,7 @@ public com.google.protobuf.ByteString getPageviewIdBytes() { * * This should be kept the same for all user events triggered from the same * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. The `pageViewId` property should + * events as the user is browsing the page. The `pageview_id` property should * be kept the same for all these events so that they can be grouped together * properly. * @@ -839,7 +839,7 @@ public Builder setPageviewId(java.lang.String value) { * * This should be kept the same for all user events triggered from the same * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. The `pageViewId` property should + * events as the user is browsing the page. The `pageview_id` property should * be kept the same for all these events so that they can be grouped together * properly. * @@ -865,7 +865,7 @@ public Builder clearPageviewId() { * * This should be kept the same for all user events triggered from the same * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. The `pageViewId` property should + * events as the user is browsing the page. The `pageview_id` property should * be kept the same for all these events so that they can be grouped together * properly. * @@ -902,10 +902,10 @@ public Builder setPageviewIdBytes(com.google.protobuf.ByteString value) { * * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: - * "pageCategory" : "Sales > 2017 Black Friday Deals". + * `"pageCategory" : "Sales > 2017 Black Friday Deals"`. * * Required for `view-category-page` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string page_category = 2; @@ -935,10 +935,10 @@ public java.lang.String getPageCategory() { * * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: - * "pageCategory" : "Sales > 2017 Black Friday Deals". + * `"pageCategory" : "Sales > 2017 Black Friday Deals"`. * * Required for `view-category-page` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string page_category = 2; @@ -968,10 +968,10 @@ public com.google.protobuf.ByteString getPageCategoryBytes() { * * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: - * "pageCategory" : "Sales > 2017 Black Friday Deals". + * `"pageCategory" : "Sales > 2017 Black Friday Deals"`. * * Required for `view-category-page` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string page_category = 2; @@ -1000,10 +1000,10 @@ public Builder setPageCategory(java.lang.String value) { * * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: - * "pageCategory" : "Sales > 2017 Black Friday Deals". + * `"pageCategory" : "Sales > 2017 Black Friday Deals"`. * * Required for `view-category-page` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string page_category = 2; @@ -1028,10 +1028,10 @@ public Builder clearPageCategory() { * * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: - * "pageCategory" : "Sales > 2017 Black Friday Deals". + * `"pageCategory" : "Sales > 2017 Black Friday Deals"`. * * Required for `view-category-page` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string page_category = 2; diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/PageInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/PageInfoOrBuilder.java index 8bf21af73ce1..39029c0e157e 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/PageInfoOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/PageInfoOrBuilder.java @@ -31,7 +31,7 @@ public interface PageInfoOrBuilder * * This should be kept the same for all user events triggered from the same * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. The `pageViewId` property should + * events as the user is browsing the page. The `pageview_id` property should * be kept the same for all these events so that they can be grouped together * properly. * @@ -52,7 +52,7 @@ public interface PageInfoOrBuilder * * This should be kept the same for all user events triggered from the same * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. The `pageViewId` property should + * events as the user is browsing the page. The `pageview_id` property should * be kept the same for all these events so that they can be grouped together * properly. * @@ -78,10 +78,10 @@ public interface PageInfoOrBuilder * * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: - * "pageCategory" : "Sales > 2017 Black Friday Deals". + * `"pageCategory" : "Sales > 2017 Black Friday Deals"`. * * Required for `view-category-page` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string page_category = 2; @@ -101,10 +101,10 @@ public interface PageInfoOrBuilder * * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: - * "pageCategory" : "Sales > 2017 Black Friday Deals". + * `"pageCategory" : "Sales > 2017 Black Friday Deals"`. * * Required for `view-category-page` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string page_category = 2; diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Reply.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Reply.java new file mode 100644 index 000000000000..09a4265269a1 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/Reply.java @@ -0,0 +1,708 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Defines a reply message to user.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.Reply} + */ +public final class Reply extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.Reply) + ReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Reply.newBuilder() to construct. + private Reply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Reply() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Reply(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_Reply_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_Reply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.Reply.class, + com.google.cloud.discoveryengine.v1.Reply.Builder.class); + } + + public static final int SUMMARY_FIELD_NUMBER = 3; + private com.google.cloud.discoveryengine.v1.SearchResponse.Summary summary_; + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + * + * @return Whether the summary field is set. + */ + @java.lang.Override + public boolean hasSummary() { + return summary_ != null; + } + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + * + * @return The summary. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary getSummary() { + return summary_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder getSummaryOrBuilder() { + return summary_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + + 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 (summary_ != null) { + output.writeMessage(3, getSummary()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (summary_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSummary()); + } + 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.discoveryengine.v1.Reply)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.Reply other = + (com.google.cloud.discoveryengine.v1.Reply) obj; + + if (hasSummary() != other.hasSummary()) return false; + if (hasSummary()) { + if (!getSummary().equals(other.getSummary())) 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 (hasSummary()) { + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummary().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.Reply parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.Reply 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.discoveryengine.v1.Reply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.Reply 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.discoveryengine.v1.Reply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.Reply parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.Reply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.Reply 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.discoveryengine.v1.Reply parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.Reply 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.discoveryengine.v1.Reply parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.Reply 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.discoveryengine.v1.Reply 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; + } + /** + * + * + *
+   * Defines a reply message to user.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.Reply} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.Reply) + com.google.cloud.discoveryengine.v1.ReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_Reply_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_Reply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.Reply.class, + com.google.cloud.discoveryengine.v1.Reply.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.Reply.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_Reply_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Reply getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Reply build() { + com.google.cloud.discoveryengine.v1.Reply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Reply buildPartial() { + com.google.cloud.discoveryengine.v1.Reply result = + new com.google.cloud.discoveryengine.v1.Reply(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1.Reply result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.summary_ = summaryBuilder_ == null ? summary_ : summaryBuilder_.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.discoveryengine.v1.Reply) { + return mergeFrom((com.google.cloud.discoveryengine.v1.Reply) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.Reply other) { + if (other == com.google.cloud.discoveryengine.v1.Reply.getDefaultInstance()) return this; + if (other.hasSummary()) { + mergeSummary(other.getSummary()); + } + 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 26: + { + input.readMessage(getSummaryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.discoveryengine.v1.SearchResponse.Summary summary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder> + summaryBuilder_; + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + * + * @return Whether the summary field is set. + */ + public boolean hasSummary() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + * + * @return The summary. + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary getSummary() { + if (summaryBuilder_ == null) { + return summary_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.getDefaultInstance() + : summary_; + } else { + return summaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + */ + public Builder setSummary(com.google.cloud.discoveryengine.v1.SearchResponse.Summary value) { + if (summaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summary_ = value; + } else { + summaryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + */ + public Builder setSummary( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder builderForValue) { + if (summaryBuilder_ == null) { + summary_ = builderForValue.build(); + } else { + summaryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + */ + public Builder mergeSummary(com.google.cloud.discoveryengine.v1.SearchResponse.Summary value) { + if (summaryBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && summary_ != null + && summary_ + != com.google.cloud.discoveryengine.v1.SearchResponse.Summary + .getDefaultInstance()) { + getSummaryBuilder().mergeFrom(value); + } else { + summary_ = value; + } + } else { + summaryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + */ + public Builder clearSummary() { + bitField0_ = (bitField0_ & ~0x00000001); + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder getSummaryBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder + getSummaryOrBuilder() { + if (summaryBuilder_ != null) { + return summaryBuilder_.getMessageOrBuilder(); + } else { + return summary_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder> + getSummaryFieldBuilder() { + if (summaryBuilder_ == null) { + summaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder>( + getSummary(), getParentForChildren(), isClean()); + summary_ = null; + } + return summaryBuilder_; + } + + @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.discoveryengine.v1.Reply) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.Reply) + private static final com.google.cloud.discoveryengine.v1.Reply DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.Reply(); + } + + public static com.google.cloud.discoveryengine.v1.Reply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Reply 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.discoveryengine.v1.Reply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ReplyOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ReplyOrBuilder.java new file mode 100644 index 000000000000..fd61a12982ef --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/ReplyOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +public interface ReplyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.Reply) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + * + * @return Whether the summary field is set. + */ + boolean hasSummary(); + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + * + * @return The summary. + */ + com.google.cloud.discoveryengine.v1.SearchResponse.Summary getSummary(); + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 3; + */ + com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder getSummaryOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchInfo.java index 81fe5696adb0..634bf47e8032 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchInfo.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchInfo.java @@ -79,13 +79,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * for definition. * * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * At least one of * [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or * [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category] * is required for `search` events. Other event types should not set this - * field. Otherwise, an INVALID_ARGUMENT error is returned. + * field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string search_query = 1; @@ -115,13 +115,13 @@ public java.lang.String getSearchQuery() { * for definition. * * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * At least one of * [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or * [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category] * is required for `search` events. Other event types should not set this - * field. Otherwise, an INVALID_ARGUMENT error is returned. + * field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string search_query = 1; @@ -151,13 +151,15 @@ public com.google.protobuf.ByteString getSearchQueryBytes() { *
    * The order in which products are returned, if applicable.
    *
-   * See [SearchRequest.order_by][] for definition and syntax.
+   * See
+   * [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
+   * for definition and syntax.
    *
    * The value must be a UTF-8 encoded string with a length limit of 1,000
-   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
    *
    * This can only be set for `search` events. Other event types should not set
-   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
    * 
* * string order_by = 2; @@ -182,13 +184,15 @@ public java.lang.String getOrderBy() { *
    * The order in which products are returned, if applicable.
    *
-   * See [SearchRequest.order_by][] for definition and syntax.
+   * See
+   * [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
+   * for definition and syntax.
    *
    * The value must be a UTF-8 encoded string with a length limit of 1,000
-   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
    *
    * This can only be set for `search` events. Other event types should not set
-   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
    * 
* * string order_by = 2; @@ -221,10 +225,10 @@ public com.google.protobuf.ByteString getOrderByBytes() { * [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset] * for definition. * - * If this field is negative, an INVALID_ARGUMENT is returned. + * If this field is negative, an `INVALID_ARGUMENT` is returned. * * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * optional int32 offset = 3; @@ -246,10 +250,10 @@ public boolean hasOffset() { * [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset] * for definition. * - * If this field is negative, an INVALID_ARGUMENT is returned. + * If this field is negative, an `INVALID_ARGUMENT` is returned. * * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * optional int32 offset = 3; @@ -668,13 +672,13 @@ public Builder mergeFrom( * for definition. * * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * At least one of * [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or * [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category] * is required for `search` events. Other event types should not set this - * field. Otherwise, an INVALID_ARGUMENT error is returned. + * field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string search_query = 1; @@ -703,13 +707,13 @@ public java.lang.String getSearchQuery() { * for definition. * * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * At least one of * [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or * [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category] * is required for `search` events. Other event types should not set this - * field. Otherwise, an INVALID_ARGUMENT error is returned. + * field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string search_query = 1; @@ -738,13 +742,13 @@ public com.google.protobuf.ByteString getSearchQueryBytes() { * for definition. * * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * At least one of * [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or * [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category] * is required for `search` events. Other event types should not set this - * field. Otherwise, an INVALID_ARGUMENT error is returned. + * field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string search_query = 1; @@ -772,13 +776,13 @@ public Builder setSearchQuery(java.lang.String value) { * for definition. * * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * At least one of * [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or * [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category] * is required for `search` events. Other event types should not set this - * field. Otherwise, an INVALID_ARGUMENT error is returned. + * field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string search_query = 1; @@ -802,13 +806,13 @@ public Builder clearSearchQuery() { * for definition. * * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * At least one of * [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or * [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category] * is required for `search` events. Other event types should not set this - * field. Otherwise, an INVALID_ARGUMENT error is returned. + * field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string search_query = 1; @@ -834,13 +838,15 @@ public Builder setSearchQueryBytes(com.google.protobuf.ByteString value) { *
      * The order in which products are returned, if applicable.
      *
-     * See [SearchRequest.order_by][] for definition and syntax.
+     * See
+     * [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
+     * for definition and syntax.
      *
      * The value must be a UTF-8 encoded string with a length limit of 1,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
      *
      * This can only be set for `search` events. Other event types should not set
-     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
      * 
* * string order_by = 2; @@ -864,13 +870,15 @@ public java.lang.String getOrderBy() { *
      * The order in which products are returned, if applicable.
      *
-     * See [SearchRequest.order_by][] for definition and syntax.
+     * See
+     * [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
+     * for definition and syntax.
      *
      * The value must be a UTF-8 encoded string with a length limit of 1,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
      *
      * This can only be set for `search` events. Other event types should not set
-     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
      * 
* * string order_by = 2; @@ -894,13 +902,15 @@ public com.google.protobuf.ByteString getOrderByBytes() { *
      * The order in which products are returned, if applicable.
      *
-     * See [SearchRequest.order_by][] for definition and syntax.
+     * See
+     * [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
+     * for definition and syntax.
      *
      * The value must be a UTF-8 encoded string with a length limit of 1,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
      *
      * This can only be set for `search` events. Other event types should not set
-     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
      * 
* * string order_by = 2; @@ -923,13 +933,15 @@ public Builder setOrderBy(java.lang.String value) { *
      * The order in which products are returned, if applicable.
      *
-     * See [SearchRequest.order_by][] for definition and syntax.
+     * See
+     * [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
+     * for definition and syntax.
      *
      * The value must be a UTF-8 encoded string with a length limit of 1,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
      *
      * This can only be set for `search` events. Other event types should not set
-     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
      * 
* * string order_by = 2; @@ -948,13 +960,15 @@ public Builder clearOrderBy() { *
      * The order in which products are returned, if applicable.
      *
-     * See [SearchRequest.order_by][] for definition and syntax.
+     * See
+     * [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
+     * for definition and syntax.
      *
      * The value must be a UTF-8 encoded string with a length limit of 1,000
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
      *
      * This can only be set for `search` events. Other event types should not set
-     * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+     * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
      * 
* * string order_by = 2; @@ -985,10 +999,10 @@ public Builder setOrderByBytes(com.google.protobuf.ByteString value) { * [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset] * for definition. * - * If this field is negative, an INVALID_ARGUMENT is returned. + * If this field is negative, an `INVALID_ARGUMENT` is returned. * * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * optional int32 offset = 3; @@ -1010,10 +1024,10 @@ public boolean hasOffset() { * [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset] * for definition. * - * If this field is negative, an INVALID_ARGUMENT is returned. + * If this field is negative, an `INVALID_ARGUMENT` is returned. * * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * optional int32 offset = 3; @@ -1035,10 +1049,10 @@ public int getOffset() { * [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset] * for definition. * - * If this field is negative, an INVALID_ARGUMENT is returned. + * If this field is negative, an `INVALID_ARGUMENT` is returned. * * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * optional int32 offset = 3; @@ -1064,10 +1078,10 @@ public Builder setOffset(int value) { * [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset] * for definition. * - * If this field is negative, an INVALID_ARGUMENT is returned. + * If this field is negative, an `INVALID_ARGUMENT` is returned. * * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * optional int32 offset = 3; diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchInfoOrBuilder.java index 9b90c8a7394d..36173caaa92f 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchInfoOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchInfoOrBuilder.java @@ -34,13 +34,13 @@ public interface SearchInfoOrBuilder * for definition. * * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * At least one of * [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or * [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category] * is required for `search` events. Other event types should not set this - * field. Otherwise, an INVALID_ARGUMENT error is returned. + * field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string search_query = 1; @@ -59,13 +59,13 @@ public interface SearchInfoOrBuilder * for definition. * * The value must be a UTF-8 encoded string with a length limit of 5,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * At least one of * [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or * [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category] * is required for `search` events. Other event types should not set this - * field. Otherwise, an INVALID_ARGUMENT error is returned. + * field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string search_query = 1; @@ -80,13 +80,15 @@ public interface SearchInfoOrBuilder *
    * The order in which products are returned, if applicable.
    *
-   * See [SearchRequest.order_by][] for definition and syntax.
+   * See
+   * [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
+   * for definition and syntax.
    *
    * The value must be a UTF-8 encoded string with a length limit of 1,000
-   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
    *
    * This can only be set for `search` events. Other event types should not set
-   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
    * 
* * string order_by = 2; @@ -100,13 +102,15 @@ public interface SearchInfoOrBuilder *
    * The order in which products are returned, if applicable.
    *
-   * See [SearchRequest.order_by][] for definition and syntax.
+   * See
+   * [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
+   * for definition and syntax.
    *
    * The value must be a UTF-8 encoded string with a length limit of 1,000
-   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
    *
    * This can only be set for `search` events. Other event types should not set
-   * this field. Otherwise, an INVALID_ARGUMENT error is returned.
+   * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
    * 
* * string order_by = 2; @@ -126,10 +130,10 @@ public interface SearchInfoOrBuilder * [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset] * for definition. * - * If this field is negative, an INVALID_ARGUMENT is returned. + * If this field is negative, an `INVALID_ARGUMENT` is returned. * * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * optional int32 offset = 3; @@ -148,10 +152,10 @@ public interface SearchInfoOrBuilder * [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset] * for definition. * - * If this field is negative, an INVALID_ARGUMENT is returned. + * If this field is negative, an `INVALID_ARGUMENT` is returned. * * This can only be set for `search` events. Other event types should not set - * this field. Otherwise, an INVALID_ARGUMENT error is returned. + * this field. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * optional int32 offset = 3; diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchRequest.java index 4d548b6f499a..93eb842f4a88 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchRequest.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchRequest.java @@ -44,6 +44,9 @@ private SearchRequest() { branch_ = ""; query_ = ""; pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + facetSpecs_ = java.util.Collections.emptyList(); userPseudoId_ = ""; } @@ -81,299 +84,212 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.cloud.discoveryengine.v1.SearchRequest.Builder.class); } - public interface QueryExpansionSpecOrBuilder + public interface ImageQueryOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.ImageQuery) com.google.protobuf.MessageOrBuilder { /** * * *
-     * The condition under which query expansion should occur. Default to
-     * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
      * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * + * string image_bytes = 1; * - * @return The enum numeric value on the wire for condition. + * @return Whether the imageBytes field is set. */ - int getConditionValue(); + boolean hasImageBytes(); /** * * *
-     * The condition under which query expansion should occur. Default to
-     * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
      * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * + * string image_bytes = 1; * - * @return The condition. + * @return The imageBytes. */ - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition getCondition(); + java.lang.String getImageBytes(); + /** + * + * + *
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
+     * 
+ * + * string image_bytes = 1; + * + * @return The bytes for imageBytes. + */ + com.google.protobuf.ByteString getImageBytesBytes(); + + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.ImageCase getImageCase(); } /** * * *
-   * Specification to determine under which conditions query expansion should
-   * occur.
+   * Specifies the image query input.
    * 
* - * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.ImageQuery} */ - public static final class QueryExpansionSpec extends com.google.protobuf.GeneratedMessageV3 + public static final class ImageQuery extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) - QueryExpansionSpecOrBuilder { + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.ImageQuery) + ImageQueryOrBuilder { private static final long serialVersionUID = 0L; - // Use QueryExpansionSpec.newBuilder() to construct. - private QueryExpansionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ImageQuery.newBuilder() to construct. + private ImageQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private QueryExpansionSpec() { - condition_ = 0; - } + private ImageQuery() {} @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new QueryExpansionSpec(); + return new ImageQuery(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_descriptor; + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ImageQuery_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ImageQuery_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.class, - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Builder.class); + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.class, + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.Builder.class); } - /** - * - * - *
-     * Enum describing under which condition query expansion should occur.
-     * 
- * - * Protobuf enum {@code - * google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition} - */ - public enum Condition implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-       * Unspecified query expansion condition. In this case, server behavior
-       * defaults to
-       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
-       * 
- * - * CONDITION_UNSPECIFIED = 0; - */ - CONDITION_UNSPECIFIED(0), - /** - * - * - *
-       * Disabled query expansion. Only the exact search query is used, even if
-       * [SearchResponse.total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size]
-       * is zero.
-       * 
- * - * DISABLED = 1; - */ - DISABLED(1), - /** - * - * - *
-       * Automatic query expansion built by the Search API.
-       * 
- * - * AUTO = 2; - */ - AUTO(2), - UNRECOGNIZED(-1), - ; + private int imageCase_ = 0; - /** - * - * - *
-       * Unspecified query expansion condition. In this case, server behavior
-       * defaults to
-       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
-       * 
- * - * CONDITION_UNSPECIFIED = 0; - */ - public static final int CONDITION_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-       * Disabled query expansion. Only the exact search query is used, even if
-       * [SearchResponse.total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size]
-       * is zero.
-       * 
- * - * DISABLED = 1; - */ - public static final int DISABLED_VALUE = 1; - /** - * - * - *
-       * Automatic query expansion built by the Search API.
-       * 
- * - * AUTO = 2; - */ - public static final int AUTO_VALUE = 2; + @SuppressWarnings("serial") + private java.lang.Object image_; - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } + public enum ImageCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + IMAGE_BYTES(1), + IMAGE_NOT_SET(0); + private final int value; + private ImageCase(int value) { + this.value = value; + } /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire 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 Condition valueOf(int value) { + public static ImageCase 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 Condition forNumber(int value) { + public static ImageCase forNumber(int value) { switch (value) { - case 0: - return CONDITION_UNSPECIFIED; case 1: - return DISABLED; - case 2: - return AUTO; + return IMAGE_BYTES; + case 0: + return IMAGE_NOT_SET; 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 Condition findValueByNumber(int number) { - return Condition.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.discoveryengine.v1.SearchRequest.QueryExpansionSpec.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final Condition[] VALUES = values(); - - public static Condition 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 Condition(int value) { - this.value = value; + public int getNumber() { + return this.value; } + }; - // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition) + public ImageCase getImageCase() { + return ImageCase.forNumber(imageCase_); } - public static final int CONDITION_FIELD_NUMBER = 1; - private int condition_ = 0; + public static final int IMAGE_BYTES_FIELD_NUMBER = 1; /** * * *
-     * The condition under which query expansion should occur. Default to
-     * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
      * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * + * string image_bytes = 1; * - * @return The enum numeric value on the wire for condition. + * @return Whether the imageBytes field is set. */ - @java.lang.Override - public int getConditionValue() { - return condition_; + public boolean hasImageBytes() { + return imageCase_ == 1; } /** * * *
-     * The condition under which query expansion should occur. Default to
-     * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
      * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * + * string image_bytes = 1; * - * @return The condition. + * @return The imageBytes. */ - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition - getCondition() { - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition result = - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.forNumber( - condition_); - return result == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition - .UNRECOGNIZED - : result; + public java.lang.String getImageBytes() { + java.lang.Object ref = ""; + if (imageCase_ == 1) { + ref = image_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (imageCase_ == 1) { + image_ = s; + } + return s; + } + } + /** + * + * + *
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
+     * 
+ * + * string image_bytes = 1; + * + * @return The bytes for imageBytes. + */ + public com.google.protobuf.ByteString getImageBytesBytes() { + java.lang.Object ref = ""; + if (imageCase_ == 1) { + ref = image_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (imageCase_ == 1) { + image_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -390,11 +306,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (condition_ - != com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition - .CONDITION_UNSPECIFIED - .getNumber()) { - output.writeEnum(1, condition_); + if (imageCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, image_); } getUnknownFields().writeTo(output); } @@ -405,11 +318,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (condition_ - != com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition - .CONDITION_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, condition_); + if (imageCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, image_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -421,13 +331,20 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec)) { + if (!(obj instanceof com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery)) { return super.equals(obj); } - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec other = - (com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) obj; - - if (condition_ != other.condition_) return false; + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery other = + (com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery) obj; + + if (!getImageCase().equals(other.getImageCase())) return false; + switch (imageCase_) { + case 1: + if (!getImageBytes().equals(other.getImageBytes())) return false; + break; + case 0: + default: + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -439,79 +356,84 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONDITION_FIELD_NUMBER; - hash = (53 * hash) + condition_; + switch (imageCase_) { + case 1: + hash = (37 * hash) + IMAGE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getImageBytes().hashCode(); + break; + case 0: + default: + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery parseFrom( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -529,7 +451,7 @@ public static Builder newBuilder() { } public static Builder newBuilder( - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec prototype) { + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -548,34 +470,32 @@ protected Builder newBuilderForType( * * *
-     * Specification to determine under which conditions query expansion should
-     * occur.
+     * Specifies the image query input.
      * 
* - * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.ImageQuery} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpecOrBuilder { + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.ImageQuery) + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQueryOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_descriptor; + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ImageQuery_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ImageQuery_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.class, - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Builder.class); + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.class, + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.Builder.class); } - // Construct using - // com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.newBuilder() + // Construct using com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { @@ -586,27 +506,26 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { public Builder clear() { super.clear(); bitField0_ = 0; - condition_ = 0; + imageCase_ = 0; + image_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_descriptor; + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ImageQuery_descriptor; } @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + public com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery getDefaultInstanceForType() { - return com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec - .getDefaultInstance(); + return com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.getDefaultInstance(); } @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec build() { - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec result = - buildPartial(); + public com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery build() { + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -614,22 +533,26 @@ public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec buil } @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec buildPartial() { - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec result = - new com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec(this); + public com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery buildPartial() { + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery result = + new com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery(this); if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); onBuilt(); return result; } private void buildPartial0( - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec result) { + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery result) { int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.condition_ = condition_; - } + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery result) { + result.imageCase_ = imageCase_; + result.image_ = this.image_; } @java.lang.Override @@ -669,22 +592,30 @@ public Builder addRepeatedField( @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) { - return mergeFrom( - (com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) other); + if (other instanceof com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery) { + return mergeFrom((com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery) other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom( - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec other) { + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery other) { if (other - == com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec - .getDefaultInstance()) return this; - if (other.condition_ != 0) { - setConditionValue(other.getConditionValue()); + == com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.getDefaultInstance()) + return this; + switch (other.getImageCase()) { + case IMAGE_BYTES: + { + imageCase_ = 1; + image_ = other.image_; + onChanged(); + break; + } + case IMAGE_NOT_SET: + { + break; + } } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); @@ -712,12 +643,13 @@ public Builder mergeFrom( case 0: done = true; break; - case 8: + case 10: { - condition_ = input.readEnum(); - bitField0_ |= 0x00000001; + java.lang.String s = input.readStringRequireUtf8(); + imageCase_ = 1; + image_ = s; break; - } // case 8 + } // case 10 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -735,95 +667,115 @@ public Builder mergeFrom( return this; } + private int imageCase_ = 0; + private java.lang.Object image_; + + public ImageCase getImageCase() { + return ImageCase.forNumber(imageCase_); + } + + public Builder clearImage() { + imageCase_ = 0; + image_ = null; + onChanged(); + return this; + } + private int bitField0_; - private int condition_ = 0; /** * * *
-       * The condition under which query expansion should occur. Default to
-       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
        * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * + * string image_bytes = 1; * - * @return The enum numeric value on the wire for condition. + * @return Whether the imageBytes field is set. */ @java.lang.Override - public int getConditionValue() { - return condition_; + public boolean hasImageBytes() { + return imageCase_ == 1; } /** * * *
-       * The condition under which query expansion should occur. Default to
-       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
        * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * + * string image_bytes = 1; * - * @param value The enum numeric value on the wire for condition to set. - * @return This builder for chaining. + * @return The imageBytes. */ - public Builder setConditionValue(int value) { - condition_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; + @java.lang.Override + public java.lang.String getImageBytes() { + java.lang.Object ref = ""; + if (imageCase_ == 1) { + ref = image_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (imageCase_ == 1) { + image_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } } /** * * *
-       * The condition under which query expansion should occur. Default to
-       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
        * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * + * string image_bytes = 1; * - * @return The condition. + * @return The bytes for imageBytes. */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition - getCondition() { - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition result = - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition - .forNumber(condition_); - return result == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition - .UNRECOGNIZED - : result; + public com.google.protobuf.ByteString getImageBytesBytes() { + java.lang.Object ref = ""; + if (imageCase_ == 1) { + ref = image_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (imageCase_ == 1) { + image_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** * * *
-       * The condition under which query expansion should occur. Default to
-       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
        * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * + * string image_bytes = 1; * - * @param value The condition to set. + * @param value The imageBytes to set. * @return This builder for chaining. */ - public Builder setCondition( - com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition value) { + public Builder setImageBytes(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; - condition_ = value.getNumber(); + imageCase_ = 1; + image_ = value; onChanged(); return this; } @@ -831,19 +783,42 @@ public Builder setCondition( * * *
-       * The condition under which query expansion should occur. Default to
-       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
        * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; - * + * string image_bytes = 1; * * @return This builder for chaining. */ - public Builder clearCondition() { - bitField0_ = (bitField0_ & ~0x00000001); - condition_ = 0; + public Builder clearImageBytes() { + if (imageCase_ == 1) { + imageCase_ = 0; + image_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
+       * 
+ * + * string image_bytes = 1; + * + * @param value The bytes for imageBytes to set. + * @return This builder for chaining. + */ + public Builder setImageBytesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + imageCase_ = 1; + image_ = value; onChanged(); return this; } @@ -860,26 +835,26 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.SearchRequest.ImageQuery) } - // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) - private static final com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.ImageQuery) + private static final com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec(); + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery(); } - public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + public static com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public QueryExpansionSpec parsePartialFrom( + public ImageQuery parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -899,1419 +874,1738 @@ public QueryExpansionSpec parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + public com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface SpellCorrectionSpecOrBuilder + public interface FacetSpecOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.FacetSpec) com.google.protobuf.MessageOrBuilder { /** * * *
-     * The mode under which spell correction should take effect to
-     * replace the original search query. Default to
-     * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * Required. The facet key specification.
      * 
* - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; * * - * @return The enum numeric value on the wire for mode. + * @return Whether the facetKey field is set. */ - int getModeValue(); + boolean hasFacetKey(); /** * * *
-     * The mode under which spell correction should take effect to
-     * replace the original search query. Default to
-     * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * Required. The facet key specification.
      * 
* - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; * * - * @return The mode. + * @return The facetKey. */ - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode getMode(); - } - /** - * - * - *
-   * The specification for query spell correction.
-   * 
- * - * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} - */ - public static final class SpellCorrectionSpec extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) - SpellCorrectionSpecOrBuilder { - private static final long serialVersionUID = 0L; - // Use SpellCorrectionSpec.newBuilder() to construct. - private SpellCorrectionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SpellCorrectionSpec() { - mode_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SpellCorrectionSpec(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_descriptor; - } + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey getFacetKey(); + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder(); - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.class, - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Builder.class); - } + /** + * + * + *
+     * Maximum of facet values that should be returned for this facet. If
+     * unspecified, defaults to 20. The maximum allowed value is 300. Values
+     * above 300 are coerced to 300.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + int getLimit(); /** * * *
-     * Enum describing under which mode spell correction should occur.
+     * List of keys to exclude when faceting.
+     *
+     *
+     * By default,
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * Protobuf enum {@code google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode} + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. */ - public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + java.util.List getExcludedFilterKeysList(); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     *
+     *
+     * By default,
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + int getExcludedFilterKeysCount(); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     *
+     *
+     * By default,
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + java.lang.String getExcludedFilterKeys(int index); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     *
+     *
+     * By default,
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index); + + /** + * + * + *
+     * Enables dynamic position for this facet. If set to true, the position of
+     * this facet among all facets in the response is determined automatically.
+     * If dynamic facets are enabled, it is ordered together.
+     * If set to false, the position of this facet in the
+     * response is the same as in the request, and it is ranked before
+     * the facets with dynamic position enable and all dynamic facets.
+     *
+     * For example, you may always want to have rating facet returned in
+     * the response, but it's not necessarily to always display the rating facet
+     * at the top. In that case, you can set enable_dynamic_position to true so
+     * that the position of rating facet in response is determined
+     * automatically.
+     *
+     * Another example, assuming you have the following facets in the request:
+     *
+     * * "rating", enable_dynamic_position = true
+     *
+     * * "price", enable_dynamic_position = false
+     *
+     * * "brands", enable_dynamic_position = false
+     *
+     * And also you have a dynamic facets enabled, which generates a facet
+     * `gender`. Then the final order of the facets in the response can be
+     * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+     * "rating") depends on how API orders "gender" and "rating" facets.
+     * However, notice that "price" and "brands" are always
+     * ranked at first and second position because their enable_dynamic_position
+     * is false.
+     * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + boolean getEnableDynamicPosition(); + } + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.FacetSpec} + */ + public static final class FacetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.FacetSpec) + FacetSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetSpec.newBuilder() to construct. + private FacetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetSpec() { + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.class, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder.class); + } + + public interface FacetKeyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey) + com.google.protobuf.MessageOrBuilder { + /** * * *
-       * Unspecified spell correction mode. In this case, server behavior
-       * defaults to
-       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * Required. Supported textual and numerical facet keys in
+       * [Document][google.cloud.discoveryengine.v1.Document] object, over which
+       * the facet values are computed. Facet key is case-sensitive.
        * 
* - * MODE_UNSPECIFIED = 0; + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. */ - MODE_UNSPECIFIED(0), + java.lang.String getKey(); /** * * *
-       * Search API will try to find a spell suggestion if there
-       * is any and put in the
-       * [SearchResponse.corrected_query][google.cloud.discoveryengine.v1.SearchResponse.corrected_query].
-       * The spell suggestion will not be used as the search query.
+       * Required. Supported textual and numerical facet keys in
+       * [Document][google.cloud.discoveryengine.v1.Document] object, over which
+       * the facet values are computed. Facet key is case-sensitive.
        * 
* - * SUGGESTION_ONLY = 1; + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. */ - SUGGESTION_ONLY(1), + com.google.protobuf.ByteString getKeyBytes(); + /** * * *
-       * Automatic spell correction built by the Search API. Search will
-       * be based on the corrected query if found.
+       * Set only if values should be bucketed into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
        * 
* - * AUTO = 2; + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; */ - AUTO(2), - UNRECOGNIZED(-1), - ; - + java.util.List getIntervalsList(); /** * * *
-       * Unspecified spell correction mode. In this case, server behavior
-       * defaults to
-       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * Set only if values should be bucketed into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
        * 
* - * MODE_UNSPECIFIED = 0; + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; */ - public static final int MODE_UNSPECIFIED_VALUE = 0; + com.google.cloud.discoveryengine.v1.Interval getIntervals(int index); /** * * *
-       * Search API will try to find a spell suggestion if there
-       * is any and put in the
-       * [SearchResponse.corrected_query][google.cloud.discoveryengine.v1.SearchResponse.corrected_query].
-       * The spell suggestion will not be used as the search query.
+       * Set only if values should be bucketed into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
        * 
* - * SUGGESTION_ONLY = 1; + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; */ - public static final int SUGGESTION_ONLY_VALUE = 1; + int getIntervalsCount(); /** * * *
-       * Automatic spell correction built by the Search API. Search will
-       * be based on the corrected query if found.
+       * Set only if values should be bucketed into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
        * 
* - * AUTO = 2; + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; */ - public static final int AUTO_VALUE = 2; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } + java.util.List + getIntervalsOrBuilderList(); + /** + * + * + *
+       * Set only if values should be bucketed into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + com.google.cloud.discoveryengine.v1.IntervalOrBuilder getIntervalsOrBuilder(int index); /** - * @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. + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. */ - @java.lang.Deprecated - public static Mode valueOf(int value) { - return forNumber(value); - } + java.util.List getRestrictedValuesList(); + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + int getRestrictedValuesCount(); + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + java.lang.String getRestrictedValues(int index); + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + com.google.protobuf.ByteString getRestrictedValuesBytes(int index); /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @return A list containing the prefixes. */ - public static Mode forNumber(int value) { - switch (value) { - case 0: - return MODE_UNSPECIFIED; - case 1: - return SUGGESTION_ONLY; - case 2: - return AUTO; - default: - return null; - } - } + java.util.List getPrefixesList(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @return The count of prefixes. + */ + int getPrefixesCount(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + java.lang.String getPrefixes(int index); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + com.google.protobuf.ByteString getPrefixesBytes(int index); - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @return A list containing the contains. + */ + java.util.List getContainsList(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @return The count of contains. + */ + int getContainsCount(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + java.lang.String getContains(int index); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + com.google.protobuf.ByteString getContainsBytes(int index); - private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Mode findValueByNumber(int number) { - return Mode.forNumber(number); - } - }; + /** + * + * + *
+       * True to make facet keys case insensitive when getting faceting
+       * values with prefixes or contains; false otherwise.
+       * 
+ * + * bool case_insensitive = 6; + * + * @return The caseInsensitive. + */ + boolean getCaseInsensitive(); - 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final Mode[] VALUES = values(); - - public static Mode 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 Mode(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode) - } - - public static final int MODE_FIELD_NUMBER = 1; - private int mode_ = 0; - /** - * - * - *
-     * The mode under which spell correction should take effect to
-     * replace the original search query. Default to
-     * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
-     * 
- * - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; - * - * - * @return The enum numeric value on the wire for mode. - */ - @java.lang.Override - public int getModeValue() { - return mode_; + /** + * + * + *
+       * The order in which documents are returned.
+       *
+       * Allowed values are:
+       *
+       * * "count desc", which means order by
+       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
+       * descending.
+       *
+       * * "value desc", which means order by
+       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
+       * descending.
+       *   Only applies to textual facets.
+       *
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * string order_by = 7; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+       * The order in which documents are returned.
+       *
+       * Allowed values are:
+       *
+       * * "count desc", which means order by
+       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
+       * descending.
+       *
+       * * "value desc", which means order by
+       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
+       * descending.
+       *   Only applies to textual facets.
+       *
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * string order_by = 7; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); } /** * * *
-     * The mode under which spell correction should take effect to
-     * replace the original search query. Default to
-     * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * Specifies how a facet is computed.
      * 
* - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; - * - * - * @return The mode. + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey} */ - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode getMode() { - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode result = - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.forNumber( - mode_); - return result == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.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 (mode_ - != com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode - .MODE_UNSPECIFIED - .getNumber()) { - output.writeEnum(1, mode_); + public static final class FacetKey extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey) + FacetKeyOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetKey.newBuilder() to construct. + private FacetKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); } - getUnknownFields().writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + private FacetKey() { + key_ = ""; + intervals_ = java.util.Collections.emptyList(); + restrictedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + prefixes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + contains_ = com.google.protobuf.LazyStringArrayList.emptyList(); + orderBy_ = ""; + } - size = 0; - if (mode_ - != com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode - .MODE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetKey(); } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_FacetKey_descriptor; } - if (!(obj instanceof com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec)) { - return super.equals(obj); + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.class, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.Builder.class); } - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec other = - (com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) obj; - if (mode_ != other.mode_) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } + public static final int KEY_FIELD_NUMBER = 1; - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Document][google.cloud.discoveryengine.v1.Document] object, over which
+       * the facet values are computed. Facet key is case-sensitive.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Document][google.cloud.discoveryengine.v1.Document] object, over which
+       * the facet values are computed. Facet key is case-sensitive.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MODE_FIELD_NUMBER; - hash = (53 * hash) + mode_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + public static final int INTERVALS_FIELD_NUMBER = 2; - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @SuppressWarnings("serial") + private java.util.List intervals_; + /** + * + * + *
+       * Set only if values should be bucketed into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + @java.lang.Override + public java.util.List getIntervalsList() { + return intervals_; + } + /** + * + * + *
+       * Set only if values should be bucketed into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + @java.lang.Override + public java.util.List + getIntervalsOrBuilderList() { + return intervals_; + } + /** + * + * + *
+       * Set only if values should be bucketed into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + @java.lang.Override + public int getIntervalsCount() { + return intervals_.size(); + } + /** + * + * + *
+       * Set only if values should be bucketed into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Interval getIntervals(int index) { + return intervals_.get(index); + } + /** + * + * + *
+       * Set only if values should be bucketed into intervals. Must be set
+       * for facets with numerical values. Must not be set for facet with text
+       * values. Maximum number of intervals is 30.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.IntervalOrBuilder getIntervalsOrBuilder( + int index) { + return intervals_.get(index); + } - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + public static final int RESTRICTED_VALUES_FIELD_NUMBER = 3; - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec - 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList restrictedValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + public com.google.protobuf.ProtocolStringList getRestrictedValuesList() { + return restrictedValues_; + } + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + public int getRestrictedValuesCount() { + return restrictedValues_.size(); + } + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + public java.lang.String getRestrictedValues(int index) { + return restrictedValues_.get(index); + } + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + public com.google.protobuf.ByteString getRestrictedValuesBytes(int index) { + return restrictedValues_.getByteString(index); + } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + public static final int PREFIXES_FIELD_NUMBER = 4; - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * The specification for query spell correction.
-     * 
- * - * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpecOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_descriptor; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList prefixes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @return A list containing the prefixes. + */ + public com.google.protobuf.ProtocolStringList getPrefixesList() { + return prefixes_; } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.class, - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Builder - .class); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @return The count of prefixes. + */ + public int getPrefixesCount() { + return prefixes_.size(); + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + public java.lang.String getPrefixes(int index) { + return prefixes_.get(index); + } + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + public com.google.protobuf.ByteString getPrefixesBytes(int index) { + return prefixes_.getByteString(index); } - // Construct using - // com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.newBuilder() - private Builder() {} + public static final int CONTAINS_FIELD_NUMBER = 5; - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList contains_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @return A list containing the contains. + */ + public com.google.protobuf.ProtocolStringList getContainsList() { + return contains_; } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - mode_ = 0; - return this; + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @return The count of contains. + */ + public int getContainsCount() { + return contains_.size(); } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_descriptor; + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + public java.lang.String getContains(int index) { + return contains_.get(index); + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + public com.google.protobuf.ByteString getContainsBytes(int index) { + return contains_.getByteString(index); } + public static final int CASE_INSENSITIVE_FIELD_NUMBER = 6; + private boolean caseInsensitive_ = false; + /** + * + * + *
+       * True to make facet keys case insensitive when getting faceting
+       * values with prefixes or contains; false otherwise.
+       * 
+ * + * bool case_insensitive = 6; + * + * @return The caseInsensitive. + */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec - getDefaultInstanceForType() { - return com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec - .getDefaultInstance(); + public boolean getCaseInsensitive() { + return caseInsensitive_; } + public static final int ORDER_BY_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+       * The order in which documents are returned.
+       *
+       * Allowed values are:
+       *
+       * * "count desc", which means order by
+       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
+       * descending.
+       *
+       * * "value desc", which means order by
+       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
+       * descending.
+       *   Only applies to textual facets.
+       *
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * string order_by = 7; + * + * @return The orderBy. + */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec build() { - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; } - return result; } - - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec buildPartial() { - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec result = - new com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec(this); - if (bitField0_ != 0) { - buildPartial0(result); + /** + * + * + *
+       * The order in which documents are returned.
+       *
+       * Allowed values are:
+       *
+       * * "count desc", which means order by
+       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
+       * descending.
+       *
+       * * "value desc", which means order by
+       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
+       * descending.
+       *   Only applies to textual facets.
+       *
+       * If not set, textual values are sorted in [natural
+       * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+       * intervals are sorted in the order given by
+       * [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * string order_by = 7; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - onBuilt(); - return result; } - private void buildPartial0( - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.mode_ = mode_; - } - } + private byte memoizedIsInitialized = -1; @java.lang.Override - public Builder clone() { - return super.clone(); + 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 Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + for (int i = 0; i < intervals_.size(); i++) { + output.writeMessage(2, intervals_.get(i)); + } + for (int i = 0; i < restrictedValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, restrictedValues_.getRaw(i)); + } + for (int i = 0; i < prefixes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, prefixes_.getRaw(i)); + } + for (int i = 0; i < contains_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, contains_.getRaw(i)); + } + if (caseInsensitive_ != false) { + output.writeBool(6, caseInsensitive_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, orderBy_); + } + getUnknownFields().writeTo(output); } @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + for (int i = 0; i < intervals_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, intervals_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < restrictedValues_.size(); i++) { + dataSize += computeStringSizeNoTag(restrictedValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getRestrictedValuesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < prefixes_.size(); i++) { + dataSize += computeStringSizeNoTag(prefixes_.getRaw(i)); + } + size += dataSize; + size += 1 * getPrefixesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < contains_.size(); i++) { + dataSize += computeStringSizeNoTag(contains_.getRaw(i)); + } + size += dataSize; + size += 1 * getContainsList().size(); + } + if (caseInsensitive_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, caseInsensitive_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; } @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey other = + (com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getIntervalsList().equals(other.getIntervalsList())) return false; + if (!getRestrictedValuesList().equals(other.getRestrictedValuesList())) return false; + if (!getPrefixesList().equals(other.getPrefixesList())) return false; + if (!getContainsList().equals(other.getContainsList())) return false; + if (getCaseInsensitive() != other.getCaseInsensitive()) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; } @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getIntervalsCount() > 0) { + hash = (37 * hash) + INTERVALS_FIELD_NUMBER; + hash = (53 * hash) + getIntervalsList().hashCode(); + } + if (getRestrictedValuesCount() > 0) { + hash = (37 * hash) + RESTRICTED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getRestrictedValuesList().hashCode(); + } + if (getPrefixesCount() > 0) { + hash = (37 * hash) + PREFIXES_FIELD_NUMBER; + hash = (53 * hash) + getPrefixesList().hashCode(); + } + if (getContainsCount() > 0) { + hash = (37 * hash) + CONTAINS_FIELD_NUMBER; + hash = (53 * hash) + getContainsList().hashCode(); + } + hash = (37 * hash) + CASE_INSENSITIVE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCaseInsensitive()); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) { - return mergeFrom( - (com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) other); - } else { - super.mergeFrom(other); - return this; - } + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - public Builder mergeFrom( - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec other) { - if (other - == com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec - .getDefaultInstance()) return this; - if (other.mode_ != 0) { - setModeValue(other.getModeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - @java.lang.Override - public final boolean isInitialized() { - return true; + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - @java.lang.Override - public Builder mergeFrom( + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey 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.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + 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.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey parseFrom( 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: - { - mode_ = input.readEnum(); - bitField0_ |= 0x00000001; - break; - } // case 8 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - private int bitField0_; + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } - private int mode_ = 0; - /** - * - * - *
-       * The mode under which spell correction should take effect to
-       * replace the original search query. Default to
-       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
-       * 
- * - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; - * - * - * @return The enum numeric value on the wire for mode. - */ @java.lang.Override - public int getModeValue() { - return mode_; + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - /** - * - * - *
-       * The mode under which spell correction should take effect to
-       * replace the original search query. Default to
-       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
-       * 
- * - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; - * - * - * @param value The enum numeric value on the wire for mode to set. - * @return This builder for chaining. - */ - public Builder setModeValue(int value) { - mode_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; } /** * * *
-       * The mode under which spell correction should take effect to
-       * replace the original search query. Default to
-       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * Specifies how a facet is computed.
        * 
* - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; - * - * - * @return The mode. - */ - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode getMode() { - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode result = - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.forNumber( - mode_); - return result == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode - .UNRECOGNIZED - : result; - } - /** - * - * - *
-       * The mode under which spell correction should take effect to
-       * replace the original search query. Default to
-       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
-       * 
- * - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; - * - * - * @param value The mode to set. - * @return This builder for chaining. + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey} */ - public Builder setMode( - com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode value) { - if (value == null) { - throw new NullPointerException(); + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey) + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_FacetKey_descriptor; } - bitField0_ |= 0x00000001; - mode_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-       * The mode under which spell correction should take effect to
-       * replace the original search query. Default to
-       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
-       * 
- * - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; - * - * - * @return This builder for chaining. - */ - public Builder clearMode() { - bitField0_ = (bitField0_ & ~0x00000001); - mode_ = 0; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.class, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.Builder + .class); + } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } + // Construct using + // com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.newBuilder() + private Builder() {} - // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) - } + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } - // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) - private static final com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec - DEFAULT_INSTANCE; + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + if (intervalsBuilder_ == null) { + intervals_ = java.util.Collections.emptyList(); + } else { + intervals_ = null; + intervalsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + restrictedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + prefixes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + contains_ = com.google.protobuf.LazyStringArrayList.emptyList(); + caseInsensitive_ = false; + orderBy_ = ""; + return this; + } - static { - DEFAULT_INSTANCE = - new com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec(); - } + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_FacetKey_descriptor; + } - public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec - getDefaultInstance() { - return DEFAULT_INSTANCE; - } + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance(); + } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpellCorrectionSpec 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(); + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey build() { + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } + return result; + } - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey buildPartial() { + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey result = + new com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey result) { + if (intervalsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + intervals_ = java.util.Collections.unmodifiableList(intervals_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.intervals_ = intervals_; + } else { + result.intervals_ = intervalsBuilder_.build(); + } + } - public interface ContentSearchSpecOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec) - com.google.protobuf.MessageOrBuilder { + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + restrictedValues_.makeImmutable(); + result.restrictedValues_ = restrictedValues_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + prefixes_.makeImmutable(); + result.prefixes_ = prefixes_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + contains_.makeImmutable(); + result.contains_ = contains_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.caseInsensitive_ = caseInsensitive_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.orderBy_ = orderBy_; + } + } - /** - * - * - *
-     * If there is no snippet spec provided, there will be no snippet in the
-     * search result.
-     * 
- * - * - * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; - * - * - * @return Whether the snippetSpec field is set. - */ - boolean hasSnippetSpec(); - /** - * - * - *
-     * If there is no snippet spec provided, there will be no snippet in the
-     * search result.
-     * 
- * - * - * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; - * - * - * @return The snippetSpec. - */ - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - getSnippetSpec(); - /** - * - * - *
-     * If there is no snippet spec provided, there will be no snippet in the
-     * search result.
-     * 
- * - * - * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; - * - */ - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpecOrBuilder - getSnippetSpecOrBuilder(); - } - /** - * - * - *
-   * The specification that configs the desired behavior of the UCS content
-   * search.
-   * 
- * - * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} - */ - public static final class ContentSearchSpec extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec) - ContentSearchSpecOrBuilder { - private static final long serialVersionUID = 0L; - // Use ContentSearchSpec.newBuilder() to construct. - private ContentSearchSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } + @java.lang.Override + public Builder clone() { + return super.clone(); + } - private ContentSearchSpec() {} + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ContentSearchSpec(); - } + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.class, - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.Builder.class); - } - - public interface SnippetSpecOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-       * Max number of snippets returned in each search result.
-       * If the matching snippets is less than the max_snippet_count, return all
-       * of the snippets; otherwise, return the max_snippet_count.
-       *
-       * At most 5 snippets will be returned for each SearchResult.
-       * 
- * - * int32 max_snippet_count = 1; - * - * @return The maxSnippetCount. - */ - int getMaxSnippetCount(); - - /** - * - * - *
-       * if true, only snippet reference is returned.
-       * 
- * - * bool reference_only = 2; - * - * @return The referenceOnly. - */ - boolean getReferenceOnly(); - } - /** - * - * - *
-     * The specification that configs the snippet in the search results.
-     * 
- * - * Protobuf type {@code - * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec} - */ - public static final class SnippetSpec extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) - SnippetSpecOrBuilder { - private static final long serialVersionUID = 0L; - // Use SnippetSpec.newBuilder() to construct. - private SnippetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SnippetSpec() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SnippetSpec(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - .class, - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - .Builder.class); - } - - public static final int MAX_SNIPPET_COUNT_FIELD_NUMBER = 1; - private int maxSnippetCount_ = 0; - /** - * - * - *
-       * Max number of snippets returned in each search result.
-       * If the matching snippets is less than the max_snippet_count, return all
-       * of the snippets; otherwise, return the max_snippet_count.
-       *
-       * At most 5 snippets will be returned for each SearchResult.
-       * 
- * - * int32 max_snippet_count = 1; - * - * @return The maxSnippetCount. - */ - @java.lang.Override - public int getMaxSnippetCount() { - return maxSnippetCount_; - } - - public static final int REFERENCE_ONLY_FIELD_NUMBER = 2; - private boolean referenceOnly_ = false; - /** - * - * - *
-       * if true, only snippet reference is returned.
-       * 
- * - * bool reference_only = 2; - * - * @return The referenceOnly. - */ - @java.lang.Override - public boolean getReferenceOnly() { - return referenceOnly_; - } - - 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 (maxSnippetCount_ != 0) { - output.writeInt32(1, maxSnippetCount_); - } - if (referenceOnly_ != false) { - output.writeBool(2, referenceOnly_); + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - size = 0; - if (maxSnippetCount_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, maxSnippetCount_); - } - if (referenceOnly_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, referenceOnly_); + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec)) { - return super.equals(obj); + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); } - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec other = - (com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) obj; - - if (getMaxSnippetCount() != other.getMaxSnippetCount()) return false; - if (getReferenceOnly() != other.getReferenceOnly()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey) other); + } else { + super.mergeFrom(other); + return this; + } } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MAX_SNIPPET_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getMaxSnippetCount(); - hash = (37 * hash) + REFERENCE_ONLY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReferenceOnly()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (intervalsBuilder_ == null) { + if (!other.intervals_.isEmpty()) { + if (intervals_.isEmpty()) { + intervals_ = other.intervals_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureIntervalsIsMutable(); + intervals_.addAll(other.intervals_); + } + onChanged(); + } + } else { + if (!other.intervals_.isEmpty()) { + if (intervalsBuilder_.isEmpty()) { + intervalsBuilder_.dispose(); + intervalsBuilder_ = null; + intervals_ = other.intervals_; + bitField0_ = (bitField0_ & ~0x00000002); + intervalsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIntervalsFieldBuilder() + : null; + } else { + intervalsBuilder_.addAllMessages(other.intervals_); + } + } + } + if (!other.restrictedValues_.isEmpty()) { + if (restrictedValues_.isEmpty()) { + restrictedValues_ = other.restrictedValues_; + bitField0_ |= 0x00000004; + } else { + ensureRestrictedValuesIsMutable(); + restrictedValues_.addAll(other.restrictedValues_); + } + onChanged(); + } + if (!other.prefixes_.isEmpty()) { + if (prefixes_.isEmpty()) { + prefixes_ = other.prefixes_; + bitField0_ |= 0x00000008; + } else { + ensurePrefixesIsMutable(); + prefixes_.addAll(other.prefixes_); + } + onChanged(); + } + if (!other.contains_.isEmpty()) { + if (contains_.isEmpty()) { + contains_ = other.contains_; + bitField0_ |= 0x00000010; + } else { + ensureContainsIsMutable(); + contains_.addAll(other.contains_); + } + onChanged(); + } + if (other.getCaseInsensitive() != false) { + setCaseInsensitive(other.getCaseInsensitive()); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } - public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - 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 specification that configs the snippet in the search results.
-       * 
- * - * Protobuf type {@code - * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpecOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - .class, - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - .Builder.class); - } - - // Construct using - // com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - maxSnippetCount_ = 0; - referenceOnly_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; - } - - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - getDefaultInstanceForType() { - return com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - build() { - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - buildPartial() { - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec result = - new com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec( - this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.maxSnippetCount_ = maxSnippetCount_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.referenceOnly_ = referenceOnly_; - } - } - - @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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) { - return mergeFrom( - (com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec other) { - if (other - == com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec - .getDefaultInstance()) return this; - if (other.getMaxSnippetCount() != 0) { - setMaxSnippetCount(other.getMaxSnippetCount()); - } - if (other.getReferenceOnly() != false) { - setReferenceOnly(other.getReferenceOnly()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } + @java.lang.Override + public final boolean isInitialized() { + return true; + } @java.lang.Override public Builder mergeFrom( @@ -2329,18 +2623,59 @@ public Builder mergeFrom( case 0: done = true; break; - case 8: + case 10: { - maxSnippetCount_ = input.readInt32(); + key_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; - } // case 8 - case 16: + } // case 10 + case 18: { - referenceOnly_ = input.readBool(); - bitField0_ |= 0x00000002; + com.google.cloud.discoveryengine.v1.Interval m = + input.readMessage( + com.google.cloud.discoveryengine.v1.Interval.parser(), + extensionRegistry); + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.add(m); + } else { + intervalsBuilder_.addMessage(m); + } break; - } // case 16 + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRestrictedValuesIsMutable(); + restrictedValues_.add(s); + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePrefixesIsMutable(); + prefixes_.add(s); + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureContainsIsMutable(); + contains_.add(s); + break; + } // case 42 + case 48: + { + caseInsensitive_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2360,45 +2695,74 @@ public Builder mergeFrom( private int bitField0_; - private int maxSnippetCount_; + private java.lang.Object key_ = ""; /** * * *
-         * Max number of snippets returned in each search result.
-         * If the matching snippets is less than the max_snippet_count, return all
-         * of the snippets; otherwise, return the max_snippet_count.
-         *
-         * At most 5 snippets will be returned for each SearchResult.
+         * Required. Supported textual and numerical facet keys in
+         * [Document][google.cloud.discoveryengine.v1.Document] object, over which
+         * the facet values are computed. Facet key is case-sensitive.
          * 
* - * int32 max_snippet_count = 1; + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; * - * @return The maxSnippetCount. + * @return The key. */ - @java.lang.Override - public int getMaxSnippetCount() { - return maxSnippetCount_; + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** * * *
-         * Max number of snippets returned in each search result.
-         * If the matching snippets is less than the max_snippet_count, return all
-         * of the snippets; otherwise, return the max_snippet_count.
+         * Required. Supported textual and numerical facet keys in
+         * [Document][google.cloud.discoveryengine.v1.Document] object, over which
+         * the facet values are computed. Facet key is case-sensitive.
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; * - * At most 5 snippets will be returned for each SearchResult. + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Document][google.cloud.discoveryengine.v1.Document] object, over which
+         * the facet values are computed. Facet key is case-sensitive.
          * 
* - * int32 max_snippet_count = 1; + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; * - * @param value The maxSnippetCount to set. + * @param value The key to set. * @return This builder for chaining. */ - public Builder setMaxSnippetCount(int value) { - - maxSnippetCount_ = value; + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; bitField0_ |= 0x00000001; onChanged(); return this; @@ -2407,111 +2771,9216 @@ public Builder setMaxSnippetCount(int value) { * * *
-         * Max number of snippets returned in each search result.
-         * If the matching snippets is less than the max_snippet_count, return all
-         * of the snippets; otherwise, return the max_snippet_count.
-         *
-         * At most 5 snippets will be returned for each SearchResult.
+         * Required. Supported textual and numerical facet keys in
+         * [Document][google.cloud.discoveryengine.v1.Document] object, over which
+         * the facet values are computed. Facet key is case-sensitive.
          * 
* - * int32 max_snippet_count = 1; + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ - public Builder clearMaxSnippetCount() { + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); bitField0_ = (bitField0_ & ~0x00000001); - maxSnippetCount_ = 0; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Document][google.cloud.discoveryengine.v1.Document] object, over which
+         * the facet values are computed. Facet key is case-sensitive.
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private boolean referenceOnly_; + private java.util.List intervals_ = + java.util.Collections.emptyList(); + + private void ensureIntervalsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + intervals_ = + new java.util.ArrayList(intervals_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Interval, + com.google.cloud.discoveryengine.v1.Interval.Builder, + com.google.cloud.discoveryengine.v1.IntervalOrBuilder> + intervalsBuilder_; + /** * * *
-         * if true, only snippet reference is returned.
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
          * 
* - * bool reference_only = 2; + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public java.util.List getIntervalsList() { + if (intervalsBuilder_ == null) { + return java.util.Collections.unmodifiableList(intervals_); + } else { + return intervalsBuilder_.getMessageList(); + } + } + /** * - * @return The referenceOnly. + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; */ - @java.lang.Override - public boolean getReferenceOnly() { - return referenceOnly_; + public int getIntervalsCount() { + if (intervalsBuilder_ == null) { + return intervals_.size(); + } else { + return intervalsBuilder_.getCount(); + } } /** * * *
-         * if true, only snippet reference is returned.
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
          * 
* - * bool reference_only = 2; + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public com.google.cloud.discoveryengine.v1.Interval getIntervals(int index) { + if (intervalsBuilder_ == null) { + return intervals_.get(index); + } else { + return intervalsBuilder_.getMessage(index); + } + } + /** + * * - * @param value The referenceOnly to set. - * @return This builder for chaining. + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; */ - public Builder setReferenceOnly(boolean value) { - - referenceOnly_ = value; - bitField0_ |= 0x00000002; - onChanged(); + public Builder setIntervals(int index, com.google.cloud.discoveryengine.v1.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.set(index, value); + onChanged(); + } else { + intervalsBuilder_.setMessage(index, value); + } return this; } /** * * *
-         * if true, only snippet reference is returned.
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
          * 
* - * bool reference_only = 2; + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public Builder setIntervals( + int index, com.google.cloud.discoveryengine.v1.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.set(index, builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * * - * @return This builder for chaining. + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; */ - public Builder clearReferenceOnly() { - bitField0_ = (bitField0_ & ~0x00000002); - referenceOnly_ = false; - onChanged(); + public Builder addIntervals(com.google.cloud.discoveryengine.v1.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.add(value); + onChanged(); + } else { + intervalsBuilder_.addMessage(value); + } return this; } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public Builder addIntervals(int index, com.google.cloud.discoveryengine.v1.Interval value) { + if (intervalsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIntervalsIsMutable(); + intervals_.add(index, value); + onChanged(); + } else { + intervalsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public Builder addIntervals( + com.google.cloud.discoveryengine.v1.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.add(builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public Builder addIntervals( + int index, com.google.cloud.discoveryengine.v1.Interval.Builder builderForValue) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.add(index, builderForValue.build()); + onChanged(); + } else { + intervalsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public Builder addAllIntervals( + java.lang.Iterable values) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intervals_); + onChanged(); + } else { + intervalsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public Builder clearIntervals() { + if (intervalsBuilder_ == null) { + intervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + intervalsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public Builder removeIntervals(int index) { + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.remove(index); + onChanged(); + } else { + intervalsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public com.google.cloud.discoveryengine.v1.Interval.Builder getIntervalsBuilder(int index) { + return getIntervalsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public com.google.cloud.discoveryengine.v1.IntervalOrBuilder getIntervalsOrBuilder( + int index) { + if (intervalsBuilder_ == null) { + return intervals_.get(index); + } else { + return intervalsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public java.util.List + getIntervalsOrBuilderList() { + if (intervalsBuilder_ != null) { + return intervalsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(intervals_); + } + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public com.google.cloud.discoveryengine.v1.Interval.Builder addIntervalsBuilder() { + return getIntervalsFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance()); + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public com.google.cloud.discoveryengine.v1.Interval.Builder addIntervalsBuilder(int index) { + return getIntervalsFieldBuilder() + .addBuilder(index, com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance()); + } + /** + * + * + *
+         * Set only if values should be bucketed into intervals. Must be set
+         * for facets with numerical values. Must not be set for facet with text
+         * values. Maximum number of intervals is 30.
+         * 
+ * + * repeated .google.cloud.discoveryengine.v1.Interval intervals = 2; + */ + public java.util.List + getIntervalsBuilderList() { + return getIntervalsFieldBuilder().getBuilderList(); } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Interval, + com.google.cloud.discoveryengine.v1.Interval.Builder, + com.google.cloud.discoveryengine.v1.IntervalOrBuilder> + getIntervalsFieldBuilder() { + if (intervalsBuilder_ == null) { + intervalsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Interval, + com.google.cloud.discoveryengine.v1.Interval.Builder, + com.google.cloud.discoveryengine.v1.IntervalOrBuilder>( + intervals_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + intervals_ = null; + } + return intervalsBuilder_; } - // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) - } + private com.google.protobuf.LazyStringArrayList restrictedValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); - // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) + private void ensureRestrictedValuesIsMutable() { + if (!restrictedValues_.isModifiable()) { + restrictedValues_ = new com.google.protobuf.LazyStringArrayList(restrictedValues_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + public com.google.protobuf.ProtocolStringList getRestrictedValuesList() { + restrictedValues_.makeImmutable(); + return restrictedValues_; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + public int getRestrictedValuesCount() { + return restrictedValues_.size(); + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the element to return. + * @return The restrictedValues at the given index. + */ + public java.lang.String getRestrictedValues(int index) { + return restrictedValues_.get(index); + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedValues at the given index. + */ + public com.google.protobuf.ByteString getRestrictedValuesBytes(int index) { + return restrictedValues_.getByteString(index); + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param index The index to set the value at. + * @param value The restrictedValues to set. + * @return This builder for chaining. + */ + public Builder setRestrictedValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedValuesIsMutable(); + restrictedValues_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param value The restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addRestrictedValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedValuesIsMutable(); + restrictedValues_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param values The restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addAllRestrictedValues(java.lang.Iterable values) { + ensureRestrictedValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, restrictedValues_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return This builder for chaining. + */ + public Builder clearRestrictedValues() { + restrictedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @param value The bytes of the restrictedValues to add. + * @return This builder for chaining. + */ + public Builder addRestrictedValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRestrictedValuesIsMutable(); + restrictedValues_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList prefixes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensurePrefixesIsMutable() { + if (!prefixes_.isModifiable()) { + prefixes_ = new com.google.protobuf.LazyStringArrayList(prefixes_); + } + bitField0_ |= 0x00000008; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @return A list containing the prefixes. + */ + public com.google.protobuf.ProtocolStringList getPrefixesList() { + prefixes_.makeImmutable(); + return prefixes_; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @return The count of prefixes. + */ + public int getPrefixesCount() { + return prefixes_.size(); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @param index The index of the element to return. + * @return The prefixes at the given index. + */ + public java.lang.String getPrefixes(int index) { + return prefixes_.get(index); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @param index The index of the value to return. + * @return The bytes of the prefixes at the given index. + */ + public com.google.protobuf.ByteString getPrefixesBytes(int index) { + return prefixes_.getByteString(index); + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @param index The index to set the value at. + * @param value The prefixes to set. + * @return This builder for chaining. + */ + public Builder setPrefixes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrefixesIsMutable(); + prefixes_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @param value The prefixes to add. + * @return This builder for chaining. + */ + public Builder addPrefixes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrefixesIsMutable(); + prefixes_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @param values The prefixes to add. + * @return This builder for chaining. + */ + public Builder addAllPrefixes(java.lang.Iterable values) { + ensurePrefixesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, prefixes_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @return This builder for chaining. + */ + public Builder clearPrefixes() { + prefixes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @param value The bytes of the prefixes to add. + * @return This builder for chaining. + */ + public Builder addPrefixesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePrefixesIsMutable(); + prefixes_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList contains_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureContainsIsMutable() { + if (!contains_.isModifiable()) { + contains_ = new com.google.protobuf.LazyStringArrayList(contains_); + } + bitField0_ |= 0x00000010; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @return A list containing the contains. + */ + public com.google.protobuf.ProtocolStringList getContainsList() { + contains_.makeImmutable(); + return contains_; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @return The count of contains. + */ + public int getContainsCount() { + return contains_.size(); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @param index The index of the element to return. + * @return The contains at the given index. + */ + public java.lang.String getContains(int index) { + return contains_.get(index); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @param index The index of the value to return. + * @return The bytes of the contains at the given index. + */ + public com.google.protobuf.ByteString getContainsBytes(int index) { + return contains_.getByteString(index); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @param index The index to set the value at. + * @param value The contains to set. + * @return This builder for chaining. + */ + public Builder setContains(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainsIsMutable(); + contains_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @param value The contains to add. + * @return This builder for chaining. + */ + public Builder addContains(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainsIsMutable(); + contains_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @param values The contains to add. + * @return This builder for chaining. + */ + public Builder addAllContains(java.lang.Iterable values) { + ensureContainsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contains_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @return This builder for chaining. + */ + public Builder clearContains() { + contains_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @param value The bytes of the contains to add. + * @return This builder for chaining. + */ + public Builder addContainsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureContainsIsMutable(); + contains_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean caseInsensitive_; + /** + * + * + *
+         * True to make facet keys case insensitive when getting faceting
+         * values with prefixes or contains; false otherwise.
+         * 
+ * + * bool case_insensitive = 6; + * + * @return The caseInsensitive. + */ + @java.lang.Override + public boolean getCaseInsensitive() { + return caseInsensitive_; + } + /** + * + * + *
+         * True to make facet keys case insensitive when getting faceting
+         * values with prefixes or contains; false otherwise.
+         * 
+ * + * bool case_insensitive = 6; + * + * @param value The caseInsensitive to set. + * @return This builder for chaining. + */ + public Builder setCaseInsensitive(boolean value) { + + caseInsensitive_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+         * True to make facet keys case insensitive when getting faceting
+         * values with prefixes or contains; false otherwise.
+         * 
+ * + * bool case_insensitive = 6; + * + * @return This builder for chaining. + */ + public Builder clearCaseInsensitive() { + bitField0_ = (bitField0_ & ~0x00000020); + caseInsensitive_ = false; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+         * The order in which documents are returned.
+         *
+         * Allowed values are:
+         *
+         * * "count desc", which means order by
+         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
+         * descending.
+         *
+         * * "value desc", which means order by
+         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
+         * descending.
+         *   Only applies to textual facets.
+         *
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * string order_by = 7; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The order in which documents are returned.
+         *
+         * Allowed values are:
+         *
+         * * "count desc", which means order by
+         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
+         * descending.
+         *
+         * * "value desc", which means order by
+         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
+         * descending.
+         *   Only applies to textual facets.
+         *
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * string order_by = 7; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The order in which documents are returned.
+         *
+         * Allowed values are:
+         *
+         * * "count desc", which means order by
+         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
+         * descending.
+         *
+         * * "value desc", which means order by
+         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
+         * descending.
+         *   Only applies to textual facets.
+         *
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * string order_by = 7; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+         * The order in which documents are returned.
+         *
+         * Allowed values are:
+         *
+         * * "count desc", which means order by
+         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
+         * descending.
+         *
+         * * "value desc", which means order by
+         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
+         * descending.
+         *   Only applies to textual facets.
+         *
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * string order_by = 7; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+         * The order in which documents are returned.
+         *
+         * Allowed values are:
+         *
+         * * "count desc", which means order by
+         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
+         * descending.
+         *
+         * * "value desc", which means order by
+         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
+         * descending.
+         *   Only applies to textual facets.
+         *
+         * If not set, textual values are sorted in [natural
+         * order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+         * intervals are sorted in the order given by
+         * [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * string order_by = 7; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey) + private static final com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey(); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetKey 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.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int FACET_KEY_FIELD_NUMBER = 1; + private com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facetKey_; + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + @java.lang.Override + public boolean hasFacetKey() { + return facetKey_ != null; + } + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey getFacetKey() { + return facetKey_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance() + : facetKey_; + } + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder() { + return facetKey_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance() + : facetKey_; + } + + public static final int LIMIT_FIELD_NUMBER = 2; + private int limit_ = 0; + /** + * + * + *
+     * Maximum of facet values that should be returned for this facet. If
+     * unspecified, defaults to 20. The maximum allowed value is 300. Values
+     * above 300 are coerced to 300.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + + public static final int EXCLUDED_FILTER_KEYS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList excludedFilterKeys_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     *
+     *
+     * By default,
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() { + return excludedFilterKeys_; + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     *
+     *
+     * By default,
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + public int getExcludedFilterKeysCount() { + return excludedFilterKeys_.size(); + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     *
+     *
+     * By default,
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + public java.lang.String getExcludedFilterKeys(int index) { + return excludedFilterKeys_.get(index); + } + /** + * + * + *
+     * List of keys to exclude when faceting.
+     *
+     *
+     * By default,
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
+     * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + public com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index) { + return excludedFilterKeys_.getByteString(index); + } + + public static final int ENABLE_DYNAMIC_POSITION_FIELD_NUMBER = 4; + private boolean enableDynamicPosition_ = false; + /** + * + * + *
+     * Enables dynamic position for this facet. If set to true, the position of
+     * this facet among all facets in the response is determined automatically.
+     * If dynamic facets are enabled, it is ordered together.
+     * If set to false, the position of this facet in the
+     * response is the same as in the request, and it is ranked before
+     * the facets with dynamic position enable and all dynamic facets.
+     *
+     * For example, you may always want to have rating facet returned in
+     * the response, but it's not necessarily to always display the rating facet
+     * at the top. In that case, you can set enable_dynamic_position to true so
+     * that the position of rating facet in response is determined
+     * automatically.
+     *
+     * Another example, assuming you have the following facets in the request:
+     *
+     * * "rating", enable_dynamic_position = true
+     *
+     * * "price", enable_dynamic_position = false
+     *
+     * * "brands", enable_dynamic_position = false
+     *
+     * And also you have a dynamic facets enabled, which generates a facet
+     * `gender`. Then the final order of the facets in the response can be
+     * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+     * "rating") depends on how API orders "gender" and "rating" facets.
+     * However, notice that "price" and "brands" are always
+     * ranked at first and second position because their enable_dynamic_position
+     * is false.
+     * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + @java.lang.Override + public boolean getEnableDynamicPosition() { + return enableDynamicPosition_; + } + + 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 (facetKey_ != null) { + output.writeMessage(1, getFacetKey()); + } + if (limit_ != 0) { + output.writeInt32(2, limit_); + } + for (int i = 0; i < excludedFilterKeys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, excludedFilterKeys_.getRaw(i)); + } + if (enableDynamicPosition_ != false) { + output.writeBool(4, enableDynamicPosition_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (facetKey_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFacetKey()); + } + if (limit_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, limit_); + } + { + int dataSize = 0; + for (int i = 0; i < excludedFilterKeys_.size(); i++) { + dataSize += computeStringSizeNoTag(excludedFilterKeys_.getRaw(i)); + } + size += dataSize; + size += 1 * getExcludedFilterKeysList().size(); + } + if (enableDynamicPosition_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, enableDynamicPosition_); + } + 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.discoveryengine.v1.SearchRequest.FacetSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec other = + (com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec) obj; + + if (hasFacetKey() != other.hasFacetKey()) return false; + if (hasFacetKey()) { + if (!getFacetKey().equals(other.getFacetKey())) return false; + } + if (getLimit() != other.getLimit()) return false; + if (!getExcludedFilterKeysList().equals(other.getExcludedFilterKeysList())) return false; + if (getEnableDynamicPosition() != other.getEnableDynamicPosition()) 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 (hasFacetKey()) { + hash = (37 * hash) + FACET_KEY_FIELD_NUMBER; + hash = (53 * hash) + getFacetKey().hashCode(); + } + hash = (37 * hash) + LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getLimit(); + if (getExcludedFilterKeysCount() > 0) { + hash = (37 * hash) + EXCLUDED_FILTER_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getExcludedFilterKeysList().hashCode(); + } + hash = (37 * hash) + ENABLE_DYNAMIC_POSITION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableDynamicPosition()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec 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.discoveryengine.v1.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec 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.discoveryengine.v1.SearchRequest.FacetSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec 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.discoveryengine.v1.SearchRequest.FacetSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec 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.discoveryengine.v1.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec 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.discoveryengine.v1.SearchRequest.FacetSpec 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 facet specification to perform faceted search.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.FacetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.FacetSpec) + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.class, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + facetKey_ = null; + if (facetKeyBuilder_ != null) { + facetKeyBuilder_.dispose(); + facetKeyBuilder_ = null; + } + limit_ = 0; + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.emptyList(); + enableDynamicPosition_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec build() { + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec buildPartial() { + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec result = + new com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.facetKey_ = facetKeyBuilder_ == null ? facetKey_ : facetKeyBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.limit_ = limit_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + excludedFilterKeys_.makeImmutable(); + result.excludedFilterKeys_ = excludedFilterKeys_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.enableDynamicPosition_ = enableDynamicPosition_; + } + } + + @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.discoveryengine.v1.SearchRequest.FacetSpec) { + return mergeFrom((com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.getDefaultInstance()) + return this; + if (other.hasFacetKey()) { + mergeFacetKey(other.getFacetKey()); + } + if (other.getLimit() != 0) { + setLimit(other.getLimit()); + } + if (!other.excludedFilterKeys_.isEmpty()) { + if (excludedFilterKeys_.isEmpty()) { + excludedFilterKeys_ = other.excludedFilterKeys_; + bitField0_ |= 0x00000004; + } else { + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.addAll(other.excludedFilterKeys_); + } + onChanged(); + } + if (other.getEnableDynamicPosition() != false) { + setEnableDynamicPosition(other.getEnableDynamicPosition()); + } + 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(getFacetKeyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + limit_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.add(s); + break; + } // case 26 + case 32: + { + enableDynamicPosition_ = 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 com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facetKey_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyOrBuilder> + facetKeyBuilder_; + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + public boolean hasFacetKey() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey getFacetKey() { + if (facetKeyBuilder_ == null) { + return facetKey_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance() + : facetKey_; + } else { + return facetKeyBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFacetKey( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey value) { + if (facetKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + facetKey_ = value; + } else { + facetKeyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFacetKey( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.Builder + builderForValue) { + if (facetKeyBuilder_ == null) { + facetKey_ = builderForValue.build(); + } else { + facetKeyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFacetKey( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey value) { + if (facetKeyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && facetKey_ != null + && facetKey_ + != com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance()) { + getFacetKeyBuilder().mergeFrom(value); + } else { + facetKey_ = value; + } + } else { + facetKeyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFacetKey() { + bitField0_ = (bitField0_ & ~0x00000001); + facetKey_ = null; + if (facetKeyBuilder_ != null) { + facetKeyBuilder_.dispose(); + facetKeyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.Builder + getFacetKeyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getFacetKeyFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder() { + if (facetKeyBuilder_ != null) { + return facetKeyBuilder_.getMessageOrBuilder(); + } else { + return facetKey_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance() + : facetKey_; + } + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyOrBuilder> + getFacetKeyFieldBuilder() { + if (facetKeyBuilder_ == null) { + facetKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyOrBuilder>( + getFacetKey(), getParentForChildren(), isClean()); + facetKey_ = null; + } + return facetKeyBuilder_; + } + + private int limit_; + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 are coerced to 300.
+       *
+       * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+       * 
+ * + * int32 limit = 2; + * + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 are coerced to 300.
+       *
+       * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+       * 
+ * + * int32 limit = 2; + * + * @param value The limit to set. + * @return This builder for chaining. + */ + public Builder setLimit(int value) { + + limit_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Maximum of facet values that should be returned for this facet. If
+       * unspecified, defaults to 20. The maximum allowed value is 300. Values
+       * above 300 are coerced to 300.
+       *
+       * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+       * 
+ * + * int32 limit = 2; + * + * @return This builder for chaining. + */ + public Builder clearLimit() { + bitField0_ = (bitField0_ & ~0x00000002); + limit_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList excludedFilterKeys_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureExcludedFilterKeysIsMutable() { + if (!excludedFilterKeys_.isModifiable()) { + excludedFilterKeys_ = new com.google.protobuf.LazyStringArrayList(excludedFilterKeys_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+       * error is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return A list containing the excludedFilterKeys. + */ + public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() { + excludedFilterKeys_.makeImmutable(); + return excludedFilterKeys_; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+       * error is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return The count of excludedFilterKeys. + */ + public int getExcludedFilterKeysCount() { + return excludedFilterKeys_.size(); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+       * error is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the element to return. + * @return The excludedFilterKeys at the given index. + */ + public java.lang.String getExcludedFilterKeys(int index) { + return excludedFilterKeys_.get(index); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+       * error is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index of the value to return. + * @return The bytes of the excludedFilterKeys at the given index. + */ + public com.google.protobuf.ByteString getExcludedFilterKeysBytes(int index) { + return excludedFilterKeys_.getByteString(index); + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+       * error is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param index The index to set the value at. + * @param value The excludedFilterKeys to set. + * @return This builder for chaining. + */ + public Builder setExcludedFilterKeys(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+       * error is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param value The excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addExcludedFilterKeys(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+       * error is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param values The excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addAllExcludedFilterKeys(java.lang.Iterable values) { + ensureExcludedFilterKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, excludedFilterKeys_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+       * error is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @return This builder for chaining. + */ + public Builder clearExcludedFilterKeys() { + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+       * error is returned.
+       * 
+ * + * repeated string excluded_filter_keys = 3; + * + * @param value The bytes of the excludedFilterKeys to add. + * @return This builder for chaining. + */ + public Builder addExcludedFilterKeysBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean enableDynamicPosition_; + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined automatically.
+       * If dynamic facets are enabled, it is ordered together.
+       * If set to false, the position of this facet in the
+       * response is the same as in the request, and it is ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       *
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response is determined
+       * automatically.
+       *
+       * Another example, assuming you have the following facets in the request:
+       *
+       * * "rating", enable_dynamic_position = true
+       *
+       * * "price", enable_dynamic_position = false
+       *
+       * * "brands", enable_dynamic_position = false
+       *
+       * And also you have a dynamic facets enabled, which generates a facet
+       * `gender`. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how API orders "gender" and "rating" facets.
+       * However, notice that "price" and "brands" are always
+       * ranked at first and second position because their enable_dynamic_position
+       * is false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + @java.lang.Override + public boolean getEnableDynamicPosition() { + return enableDynamicPosition_; + } + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined automatically.
+       * If dynamic facets are enabled, it is ordered together.
+       * If set to false, the position of this facet in the
+       * response is the same as in the request, and it is ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       *
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response is determined
+       * automatically.
+       *
+       * Another example, assuming you have the following facets in the request:
+       *
+       * * "rating", enable_dynamic_position = true
+       *
+       * * "price", enable_dynamic_position = false
+       *
+       * * "brands", enable_dynamic_position = false
+       *
+       * And also you have a dynamic facets enabled, which generates a facet
+       * `gender`. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how API orders "gender" and "rating" facets.
+       * However, notice that "price" and "brands" are always
+       * ranked at first and second position because their enable_dynamic_position
+       * is false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @param value The enableDynamicPosition to set. + * @return This builder for chaining. + */ + public Builder setEnableDynamicPosition(boolean value) { + + enableDynamicPosition_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Enables dynamic position for this facet. If set to true, the position of
+       * this facet among all facets in the response is determined automatically.
+       * If dynamic facets are enabled, it is ordered together.
+       * If set to false, the position of this facet in the
+       * response is the same as in the request, and it is ranked before
+       * the facets with dynamic position enable and all dynamic facets.
+       *
+       * For example, you may always want to have rating facet returned in
+       * the response, but it's not necessarily to always display the rating facet
+       * at the top. In that case, you can set enable_dynamic_position to true so
+       * that the position of rating facet in response is determined
+       * automatically.
+       *
+       * Another example, assuming you have the following facets in the request:
+       *
+       * * "rating", enable_dynamic_position = true
+       *
+       * * "price", enable_dynamic_position = false
+       *
+       * * "brands", enable_dynamic_position = false
+       *
+       * And also you have a dynamic facets enabled, which generates a facet
+       * `gender`. Then the final order of the facets in the response can be
+       * ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+       * "rating") depends on how API orders "gender" and "rating" facets.
+       * However, notice that "price" and "brands" are always
+       * ranked at first and second position because their enable_dynamic_position
+       * is false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @return This builder for chaining. + */ + public Builder clearEnableDynamicPosition() { + bitField0_ = (bitField0_ & ~0x00000008); + enableDynamicPosition_ = 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.discoveryengine.v1.SearchRequest.FacetSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.FacetSpec) + private static final com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec(); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetSpec 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.discoveryengine.v1.SearchRequest.FacetSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BoostSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.BoostSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Condition boost specifications. If a document matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + java.util.List + getConditionBoostSpecsList(); + /** + * + * + *
+     * Condition boost specifications. If a document matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index); + /** + * + * + *
+     * Condition boost specifications. If a document matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + int getConditionBoostSpecsCount(); + /** + * + * + *
+     * Condition boost specifications. If a document matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList(); + /** + * + * + *
+     * Condition boost specifications. If a document matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index); + } + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.BoostSpec} + */ + public static final class BoostSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.BoostSpec) + BoostSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use BoostSpec.newBuilder() to construct. + private BoostSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BoostSpec() { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BoostSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.class, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.Builder.class); + } + + public interface ConditionBoostSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+       * for detail syntax and limitations.
+       *
+       * Examples:
+       *
+       * * To boost documents with document ID "doc_1" or "doc_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The condition. + */ + java.lang.String getCondition(); + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+       * for detail syntax and limitations.
+       *
+       * Examples:
+       *
+       * * To boost documents with document ID "doc_1" or "doc_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + com.google.protobuf.ByteString getConditionBytes(); + + /** + * + * + *
+       * Strength of the condition boost, which should be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       *
+       * Setting to 1.0 gives the document a big promotion. However, it does not
+       * necessarily mean that the boosted document will be the top result at
+       * all times, nor that other documents will be excluded. Results could
+       * still be shown even when none of them matches the condition. And
+       * results that are significantly more relevant to the search query can
+       * still trump your heavily favored but irrelevant documents.
+       *
+       * Setting to -1.0 gives the document a big demotion. However, results
+       * that are deeply relevant might still be shown. The document will have
+       * an upstream battle to get a fairly high ranking, but it is not blocked
+       * out completely.
+       *
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 2; + * + * @return The boost. + */ + float getBoost(); + } + /** + * + * + *
+     * Boost applies to documents which match a condition.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec} + */ + public static final class ConditionBoostSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec) + ConditionBoostSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConditionBoostSpec.newBuilder() to construct. + private ConditionBoostSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConditionBoostSpec() { + condition_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConditionBoostSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .class, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder.class); + } + + public static final int CONDITION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object condition_ = ""; + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+       * for detail syntax and limitations.
+       *
+       * Examples:
+       *
+       * * To boost documents with document ID "doc_1" or "doc_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The condition. + */ + @java.lang.Override + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + 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(); + condition_ = s; + return s; + } + } + /** + * + * + *
+       * An expression which specifies a boost condition. The syntax and
+       * supported fields are the same as a filter expression. See
+       * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+       * for detail syntax and limitations.
+       *
+       * Examples:
+       *
+       * * To boost documents with document ID "doc_1" or "doc_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+       * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOST_FIELD_NUMBER = 2; + private float boost_ = 0F; + /** + * + * + *
+       * Strength of the condition boost, which should be in [-1, 1]. Negative
+       * boost means demotion. Default is 0.0.
+       *
+       * Setting to 1.0 gives the document a big promotion. However, it does not
+       * necessarily mean that the boosted document will be the top result at
+       * all times, nor that other documents will be excluded. Results could
+       * still be shown even when none of them matches the condition. And
+       * results that are significantly more relevant to the search query can
+       * still trump your heavily favored but irrelevant documents.
+       *
+       * Setting to -1.0 gives the document a big demotion. However, results
+       * that are deeply relevant might still be shown. The document will have
+       * an upstream battle to get a fairly high ranking, but it is not blocked
+       * out completely.
+       *
+       * Setting to 0.0 means no boost applied. The boosting condition is
+       * ignored.
+       * 
+ * + * float boost = 2; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + 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(condition_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, condition_); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(2, boost_); + } + 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(condition_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, condition_); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, boost_); + } + 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.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec other = + (com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec) obj; + + if (!getCondition().equals(other.getCondition())) return false; + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits(other.getBoost())) 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) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + hash = (37 * hash) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getBoost()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + 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.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + 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.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + 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.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + 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.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + 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.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + 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; + } + /** + * + * + *
+       * Boost applies to documents which match a condition.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec) + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .class, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + condition_ = ""; + boost_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + build() { + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + buildPartial() { + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec result = + new com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.condition_ = condition_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.boost_ = boost_; + } + } + + @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.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()) return this; + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + 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: + { + condition_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: + { + boost_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object condition_ = ""; + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+         * for detail syntax and limitations.
+         *
+         * Examples:
+         *
+         * * To boost documents with document ID "doc_1" or "doc_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @return The condition. + */ + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+         * for detail syntax and limitations.
+         *
+         * Examples:
+         *
+         * * To boost documents with document ID "doc_1" or "doc_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @return The bytes for condition. + */ + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+         * for detail syntax and limitations.
+         *
+         * Examples:
+         *
+         * * To boost documents with document ID "doc_1" or "doc_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+         * for detail syntax and limitations.
+         *
+         * Examples:
+         *
+         * * To boost documents with document ID "doc_1" or "doc_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + condition_ = getDefaultInstance().getCondition(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * An expression which specifies a boost condition. The syntax and
+         * supported fields are the same as a filter expression. See
+         * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+         * for detail syntax and limitations.
+         *
+         * Examples:
+         *
+         * * To boost documents with document ID "doc_1" or "doc_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @param value The bytes for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + condition_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private float boost_; + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         *
+         * Setting to 1.0 gives the document a big promotion. However, it does not
+         * necessarily mean that the boosted document will be the top result at
+         * all times, nor that other documents will be excluded. Results could
+         * still be shown even when none of them matches the condition. And
+         * results that are significantly more relevant to the search query can
+         * still trump your heavily favored but irrelevant documents.
+         *
+         * Setting to -1.0 gives the document a big demotion. However, results
+         * that are deeply relevant might still be shown. The document will have
+         * an upstream battle to get a fairly high ranking, but it is not blocked
+         * out completely.
+         *
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         *
+         * Setting to 1.0 gives the document a big promotion. However, it does not
+         * necessarily mean that the boosted document will be the top result at
+         * all times, nor that other documents will be excluded. Results could
+         * still be shown even when none of them matches the condition. And
+         * results that are significantly more relevant to the search query can
+         * still trump your heavily favored but irrelevant documents.
+         *
+         * Setting to -1.0 gives the document a big demotion. However, results
+         * that are deeply relevant might still be shown. The document will have
+         * an upstream battle to get a fairly high ranking, but it is not blocked
+         * out completely.
+         *
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Strength of the condition boost, which should be in [-1, 1]. Negative
+         * boost means demotion. Default is 0.0.
+         *
+         * Setting to 1.0 gives the document a big promotion. However, it does not
+         * necessarily mean that the boosted document will be the top result at
+         * all times, nor that other documents will be excluded. Results could
+         * still be shown even when none of them matches the condition. And
+         * results that are significantly more relevant to the search query can
+         * still trump your heavily favored but irrelevant documents.
+         *
+         * Setting to -1.0 gives the document a big demotion. However, results
+         * that are deeply relevant might still be shown. The document will have
+         * an upstream battle to get a fairly high ranking, but it is not blocked
+         * out completely.
+         *
+         * Setting to 0.0 means no boost applied. The boosting condition is
+         * ignored.
+         * 
+ * + * float boost = 2; + * + * @return This builder for chaining. + */ + public Builder clearBoost() { + bitField0_ = (bitField0_ & ~0x00000002); + boost_ = 0F; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec) + private static final com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + .ConditionBoostSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec(); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConditionBoostSpec 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.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CONDITION_BOOST_SPECS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec> + conditionBoostSpecs_; + /** + * + * + *
+     * Condition boost specifications. If a document matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec> + getConditionBoostSpecsList() { + return conditionBoostSpecs_; + } + /** + * + * + *
+     * Condition boost specifications. If a document matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList() { + return conditionBoostSpecs_; + } + /** + * + * + *
+     * Condition boost specifications. If a document matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public int getConditionBoostSpecsCount() { + return conditionBoostSpecs_.size(); + } + /** + * + * + *
+     * Condition boost specifications. If a document matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index) { + return conditionBoostSpecs_.get(index); + } + /** + * + * + *
+     * Condition boost specifications. If a document matches multiple conditions
+     * in the specifictions, boost scores from these specifications are all
+     * applied and combined in a non-linear way. Maximum number of
+     * specifications is 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index) { + return conditionBoostSpecs_.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 < conditionBoostSpecs_.size(); i++) { + output.writeMessage(1, conditionBoostSpecs_.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 < conditionBoostSpecs_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, conditionBoostSpecs_.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.discoveryengine.v1.SearchRequest.BoostSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec other = + (com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec) obj; + + if (!getConditionBoostSpecsList().equals(other.getConditionBoostSpecsList())) 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 (getConditionBoostSpecsCount() > 0) { + hash = (37 * hash) + CONDITION_BOOST_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getConditionBoostSpecsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec 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.discoveryengine.v1.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec 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.discoveryengine.v1.SearchRequest.BoostSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec 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.discoveryengine.v1.SearchRequest.BoostSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec 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.discoveryengine.v1.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec 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.discoveryengine.v1.SearchRequest.BoostSpec 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; + } + /** + * + * + *
+     * Boost specification to boost certain documents.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.BoostSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.BoostSpec) + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.class, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + } else { + conditionBoostSpecs_ = null; + conditionBoostSpecsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec build() { + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec buildPartial() { + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec result = + new com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec result) { + if (conditionBoostSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = java.util.Collections.unmodifiableList(conditionBoostSpecs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conditionBoostSpecs_ = conditionBoostSpecs_; + } else { + result.conditionBoostSpecs_ = conditionBoostSpecsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec 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.discoveryengine.v1.SearchRequest.BoostSpec) { + return mergeFrom((com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.getDefaultInstance()) + return this; + if (conditionBoostSpecsBuilder_ == null) { + if (!other.conditionBoostSpecs_.isEmpty()) { + if (conditionBoostSpecs_.isEmpty()) { + conditionBoostSpecs_ = other.conditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.addAll(other.conditionBoostSpecs_); + } + onChanged(); + } + } else { + if (!other.conditionBoostSpecs_.isEmpty()) { + if (conditionBoostSpecsBuilder_.isEmpty()) { + conditionBoostSpecsBuilder_.dispose(); + conditionBoostSpecsBuilder_ = null; + conditionBoostSpecs_ = other.conditionBoostSpecs_; + bitField0_ = (bitField0_ & ~0x00000001); + conditionBoostSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConditionBoostSpecsFieldBuilder() + : null; + } else { + conditionBoostSpecsBuilder_.addAllMessages(other.conditionBoostSpecs_); + } + } + } + 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.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec m = + input.readMessage( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + .ConditionBoostSpec.parser(), + extensionRegistry); + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(m); + } else { + conditionBoostSpecsBuilder_.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< + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec> + conditionBoostSpecs_ = java.util.Collections.emptyList(); + + private void ensureConditionBoostSpecsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec>( + conditionBoostSpecs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + conditionBoostSpecsBuilder_; + + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec> + getConditionBoostSpecsList() { + if (conditionBoostSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } else { + return conditionBoostSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public int getConditionBoostSpecsCount() { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.size(); + } else { + return conditionBoostSpecsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index) { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.get(index); + } else { + return conditionBoostSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder setConditionBoostSpecs( + int index, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.set(index, value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder setConditionBoostSpecs( + int index, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + int index, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec value) { + if (conditionBoostSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(index, value); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + int index, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + builderForValue) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addAllConditionBoostSpecs( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + .ConditionBoostSpec> + values) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditionBoostSpecs_); + onChanged(); + } else { + conditionBoostSpecsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder clearConditionBoostSpecs() { + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + conditionBoostSpecsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder removeConditionBoostSpecs(int index) { + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.remove(index); + onChanged(); + } else { + conditionBoostSpecsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + getConditionBoostSpecsBuilder(int index) { + return getConditionBoostSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index) { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.get(index); + } else { + return conditionBoostSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList() { + if (conditionBoostSpecsBuilder_ != null) { + return conditionBoostSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addConditionBoostSpecsBuilder() { + return getConditionBoostSpecsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.Builder + addConditionBoostSpecsBuilder(int index) { + return getConditionBoostSpecsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+       * Condition boost specifications. If a document matches multiple conditions
+       * in the specifictions, boost scores from these specifications are all
+       * applied and combined in a non-linear way. Maximum number of
+       * specifications is 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder> + getConditionBoostSpecsBuilderList() { + return getConditionBoostSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + getConditionBoostSpecsFieldBuilder() { + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder>( + conditionBoostSpecs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + conditionBoostSpecs_ = null; + } + return conditionBoostSpecsBuilder_; + } + + @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.discoveryengine.v1.SearchRequest.BoostSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.BoostSpec) + private static final com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec(); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoostSpec 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.discoveryengine.v1.SearchRequest.BoostSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + int getConditionValue(); + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition getCondition(); + + /** + * + * + *
+     * Whether to pin unexpanded results. If this field is set to true,
+     * unexpanded products are always at the top of the search results, followed
+     * by the expanded results.
+     * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + boolean getPinUnexpandedResults(); + } + /** + * + * + *
+   * Specification to determine under which conditions query expansion should
+   * occur.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} + */ + public static final class QueryExpansionSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) + QueryExpansionSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryExpansionSpec.newBuilder() to construct. + private QueryExpansionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryExpansionSpec() { + condition_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryExpansionSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.class, + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Builder.class); + } + + /** + * + * + *
+     * Enum describing under which condition query expansion should occur.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition} + */ + public enum Condition implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified query expansion condition. In this case, server behavior
+       * defaults to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * CONDITION_UNSPECIFIED = 0; + */ + CONDITION_UNSPECIFIED(0), + /** + * + * + *
+       * Disabled query expansion. Only the exact search query is used, even if
+       * [SearchResponse.total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size]
+       * is zero.
+       * 
+ * + * DISABLED = 1; + */ + DISABLED(1), + /** + * + * + *
+       * Automatic query expansion built by the Search API.
+       * 
+ * + * AUTO = 2; + */ + AUTO(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified query expansion condition. In this case, server behavior
+       * defaults to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * CONDITION_UNSPECIFIED = 0; + */ + public static final int CONDITION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Disabled query expansion. Only the exact search query is used, even if
+       * [SearchResponse.total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size]
+       * is zero.
+       * 
+ * + * DISABLED = 1; + */ + public static final int DISABLED_VALUE = 1; + /** + * + * + *
+       * Automatic query expansion built by the Search API.
+       * 
+ * + * AUTO = 2; + */ + public static final int AUTO_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Condition 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 Condition forNumber(int value) { + switch (value) { + case 0: + return CONDITION_UNSPECIFIED; + case 1: + return DISABLED; + case 2: + return AUTO; + 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 Condition findValueByNumber(int number) { + return Condition.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.discoveryengine.v1.SearchRequest.QueryExpansionSpec.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Condition[] VALUES = values(); + + public static Condition 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 Condition(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition) + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private int condition_ = 0; + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + @java.lang.Override + public int getConditionValue() { + return condition_; + } + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition + getCondition() { + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition result = + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.forNumber( + condition_); + return result == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition + .UNRECOGNIZED + : result; + } + + public static final int PIN_UNEXPANDED_RESULTS_FIELD_NUMBER = 2; + private boolean pinUnexpandedResults_ = false; + /** + * + * + *
+     * Whether to pin unexpanded results. If this field is set to true,
+     * unexpanded products are always at the top of the search results, followed
+     * by the expanded results.
+     * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + @java.lang.Override + public boolean getPinUnexpandedResults() { + return pinUnexpandedResults_; + } + + 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 (condition_ + != com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition + .CONDITION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, condition_); + } + if (pinUnexpandedResults_ != false) { + output.writeBool(2, pinUnexpandedResults_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (condition_ + != com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition + .CONDITION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, condition_); + } + if (pinUnexpandedResults_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, pinUnexpandedResults_); + } + 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec other = + (com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) obj; + + if (condition_ != other.condition_) return false; + if (getPinUnexpandedResults() != other.getPinUnexpandedResults()) 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) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + condition_; + hash = (37 * hash) + PIN_UNEXPANDED_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPinUnexpandedResults()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Specification to determine under which conditions query expansion should
+     * occur.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.class, + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + condition_ = 0; + pinUnexpandedResults_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec build() { + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec buildPartial() { + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec result = + new com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.condition_ = condition_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pinUnexpandedResults_ = pinUnexpandedResults_; + } + } + + @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.discoveryengine.v1.SearchRequest.QueryExpansionSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + .getDefaultInstance()) return this; + if (other.condition_ != 0) { + setConditionValue(other.getConditionValue()); + } + if (other.getPinUnexpandedResults() != false) { + setPinUnexpandedResults(other.getPinUnexpandedResults()); + } + 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: + { + condition_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + pinUnexpandedResults_ = input.readBool(); + 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 condition_ = 0; + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The enum numeric value on the wire for condition. + */ + @java.lang.Override + public int getConditionValue() { + return condition_; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @param value The enum numeric value on the wire for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionValue(int value) { + condition_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition + getCondition() { + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition result = + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition + .forNumber(condition_); + return result == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition( + com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + condition_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + bitField0_ = (bitField0_ & ~0x00000001); + condition_ = 0; + onChanged(); + return this; + } + + private boolean pinUnexpandedResults_; + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + @java.lang.Override + public boolean getPinUnexpandedResults() { + return pinUnexpandedResults_; + } + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @param value The pinUnexpandedResults to set. + * @return This builder for chaining. + */ + public Builder setPinUnexpandedResults(boolean value) { + + pinUnexpandedResults_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearPinUnexpandedResults() { + bitField0_ = (bitField0_ & ~0x00000002); + pinUnexpandedResults_ = 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) + private static final com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec(); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryExpansionSpec 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.discoveryengine.v1.SearchRequest.QueryExpansionSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SpellCorrectionSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The mode under which spell correction should take effect to
+     * replace the original search query. Default to
+     * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+     * The mode under which spell correction should take effect to
+     * replace the original search query. Default to
+     * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The mode. + */ + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode getMode(); + } + /** + * + * + *
+   * The specification for query spell correction.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} + */ + public static final class SpellCorrectionSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) + SpellCorrectionSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use SpellCorrectionSpec.newBuilder() to construct. + private SpellCorrectionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SpellCorrectionSpec() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SpellCorrectionSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.class, + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Builder.class); + } + + /** + * + * + *
+     * Enum describing under which mode spell correction should occur.
+     * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified spell correction mode. In this case, server behavior
+       * defaults to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Search API will try to find a spell suggestion if there
+       * is any and put in the
+       * [SearchResponse.corrected_query][google.cloud.discoveryengine.v1.SearchResponse.corrected_query].
+       * The spell suggestion will not be used as the search query.
+       * 
+ * + * SUGGESTION_ONLY = 1; + */ + SUGGESTION_ONLY(1), + /** + * + * + *
+       * Automatic spell correction built by the Search API. Search will
+       * be based on the corrected query if found.
+       * 
+ * + * AUTO = 2; + */ + AUTO(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified spell correction mode. In this case, server behavior
+       * defaults to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Search API will try to find a spell suggestion if there
+       * is any and put in the
+       * [SearchResponse.corrected_query][google.cloud.discoveryengine.v1.SearchResponse.corrected_query].
+       * The spell suggestion will not be used as the search query.
+       * 
+ * + * SUGGESTION_ONLY = 1; + */ + public static final int SUGGESTION_ONLY_VALUE = 1; + /** + * + * + *
+       * Automatic spell correction built by the Search API. Search will
+       * be based on the corrected query if found.
+       * 
+ * + * AUTO = 2; + */ + public static final int AUTO_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Mode 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 Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return SUGGESTION_ONLY; + case 2: + return AUTO; + 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 Mode findValueByNumber(int number) { + return Mode.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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Mode[] VALUES = values(); + + public static Mode 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 Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode) + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_ = 0; + /** + * + * + *
+     * The mode under which spell correction should take effect to
+     * replace the original search query. Default to
+     * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * The mode under which spell correction should take effect to
+     * replace the original search query. Default to
+     * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode getMode() { + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode result = + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.forNumber( + mode_); + return result == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.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 (mode_ + != com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode + .MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode + .MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec other = + (com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) obj; + + if (mode_ != other.mode_) 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) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec 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 specification for query spell correction.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.class, + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec build() { + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec buildPartial() { + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec result = + new com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mode_ = mode_; + } + } + + @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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + .getDefaultInstance()) return this; + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + 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: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int mode_ = 0; + /** + * + * + *
+       * The mode under which spell correction should take effect to
+       * replace the original search query. Default to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+       * The mode under which spell correction should take effect to
+       * replace the original search query. Default to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The mode under which spell correction should take effect to
+       * replace the original search query. Default to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode getMode() { + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode result = + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.forNumber( + mode_); + return result == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The mode under which spell correction should take effect to
+       * replace the original search query. Default to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The mode under which spell correction should take effect to
+       * replace the original search query. Default to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000001); + mode_ = 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) + private static final com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec(); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpellCorrectionSpec 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.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ContentSearchSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + * + * @return Whether the snippetSpec field is set. + */ + boolean hasSnippetSpec(); + /** + * + * + *
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + * + * @return The snippetSpec. + */ + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + getSnippetSpec(); + /** + * + * + *
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpecOrBuilder + getSnippetSpecOrBuilder(); + + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return Whether the summarySpec field is set. + */ + boolean hasSummarySpec(); + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return The summarySpec. + */ + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec(); + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpecOrBuilder + getSummarySpecOrBuilder(); + } + /** + * + * + *
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} + */ + public static final class ContentSearchSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec) + ContentSearchSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContentSearchSpec.newBuilder() to construct. + private ContentSearchSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContentSearchSpec() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContentSearchSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.class, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.Builder.class); + } + + public interface SnippetSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * [DEPRECATED] This field is deprecated. To control snippet return, use
+       * `return_snippet` field. For backwards compatibility, we will return
+       * snippet if max_snippet_count > 0.
+       * 
+ * + * int32 max_snippet_count = 1 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count + * is deprecated. See google/cloud/discoveryengine/v1/search_service.proto;l=304 + * @return The maxSnippetCount. + */ + @java.lang.Deprecated + int getMaxSnippetCount(); + + /** + * + * + *
+       * [DEPRECATED] This field is deprecated and will have no affect on the
+       * snippet.
+       * 
+ * + * bool reference_only = 2 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only + * is deprecated. See google/cloud/discoveryengine/v1/search_service.proto;l=308 + * @return The referenceOnly. + */ + @java.lang.Deprecated + boolean getReferenceOnly(); + + /** + * + * + *
+       * If `true`, then return snippet. If no snippet can be generated, we
+       * return "No snippet is available for this page." A `snippet_status` with
+       * `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+       * 
+ * + * bool return_snippet = 3; + * + * @return The returnSnippet. + */ + boolean getReturnSnippet(); + } + /** + * + * + *
+     * A specification for configuring snippets in a search response.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec} + */ + public static final class SnippetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) + SnippetSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use SnippetSpec.newBuilder() to construct. + private SnippetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SnippetSpec() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SnippetSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + .class, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + .Builder.class); + } + + public static final int MAX_SNIPPET_COUNT_FIELD_NUMBER = 1; + private int maxSnippetCount_ = 0; + /** + * + * + *
+       * [DEPRECATED] This field is deprecated. To control snippet return, use
+       * `return_snippet` field. For backwards compatibility, we will return
+       * snippet if max_snippet_count > 0.
+       * 
+ * + * int32 max_snippet_count = 1 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count + * is deprecated. See google/cloud/discoveryengine/v1/search_service.proto;l=304 + * @return The maxSnippetCount. + */ + @java.lang.Override + @java.lang.Deprecated + public int getMaxSnippetCount() { + return maxSnippetCount_; + } + + public static final int REFERENCE_ONLY_FIELD_NUMBER = 2; + private boolean referenceOnly_ = false; + /** + * + * + *
+       * [DEPRECATED] This field is deprecated and will have no affect on the
+       * snippet.
+       * 
+ * + * bool reference_only = 2 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only + * is deprecated. See google/cloud/discoveryengine/v1/search_service.proto;l=308 + * @return The referenceOnly. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getReferenceOnly() { + return referenceOnly_; + } + + public static final int RETURN_SNIPPET_FIELD_NUMBER = 3; + private boolean returnSnippet_ = false; + /** + * + * + *
+       * If `true`, then return snippet. If no snippet can be generated, we
+       * return "No snippet is available for this page." A `snippet_status` with
+       * `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+       * 
+ * + * bool return_snippet = 3; + * + * @return The returnSnippet. + */ + @java.lang.Override + public boolean getReturnSnippet() { + return returnSnippet_; + } + + 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 (maxSnippetCount_ != 0) { + output.writeInt32(1, maxSnippetCount_); + } + if (referenceOnly_ != false) { + output.writeBool(2, referenceOnly_); + } + if (returnSnippet_ != false) { + output.writeBool(3, returnSnippet_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (maxSnippetCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, maxSnippetCount_); + } + if (referenceOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, referenceOnly_); + } + if (returnSnippet_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, returnSnippet_); + } + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec other = + (com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) obj; + + if (getMaxSnippetCount() != other.getMaxSnippetCount()) return false; + if (getReferenceOnly() != other.getReferenceOnly()) return false; + if (getReturnSnippet() != other.getReturnSnippet()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAX_SNIPPET_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxSnippetCount(); + hash = (37 * hash) + REFERENCE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReferenceOnly()); + hash = (37 * hash) + RETURN_SNIPPET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReturnSnippet()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + 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 specification for configuring snippets in a search response.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + .class, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + .Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maxSnippetCount_ = 0; + referenceOnly_ = false; + returnSnippet_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + build() { + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + buildPartial() { + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec result = + new com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maxSnippetCount_ = maxSnippetCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.referenceOnly_ = referenceOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.returnSnippet_ = returnSnippet_; + } + } + + @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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + .getDefaultInstance()) return this; + if (other.getMaxSnippetCount() != 0) { + setMaxSnippetCount(other.getMaxSnippetCount()); + } + if (other.getReferenceOnly() != false) { + setReferenceOnly(other.getReferenceOnly()); + } + if (other.getReturnSnippet() != false) { + setReturnSnippet(other.getReturnSnippet()); + } + 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: + { + maxSnippetCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + referenceOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + returnSnippet_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int maxSnippetCount_; + /** + * + * + *
+         * [DEPRECATED] This field is deprecated. To control snippet return, use
+         * `return_snippet` field. For backwards compatibility, we will return
+         * snippet if max_snippet_count > 0.
+         * 
+ * + * int32 max_snippet_count = 1 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count + * is deprecated. See google/cloud/discoveryengine/v1/search_service.proto;l=304 + * @return The maxSnippetCount. + */ + @java.lang.Override + @java.lang.Deprecated + public int getMaxSnippetCount() { + return maxSnippetCount_; + } + /** + * + * + *
+         * [DEPRECATED] This field is deprecated. To control snippet return, use
+         * `return_snippet` field. For backwards compatibility, we will return
+         * snippet if max_snippet_count > 0.
+         * 
+ * + * int32 max_snippet_count = 1 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count + * is deprecated. See google/cloud/discoveryengine/v1/search_service.proto;l=304 + * @param value The maxSnippetCount to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setMaxSnippetCount(int value) { + + maxSnippetCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * [DEPRECATED] This field is deprecated. To control snippet return, use
+         * `return_snippet` field. For backwards compatibility, we will return
+         * snippet if max_snippet_count > 0.
+         * 
+ * + * int32 max_snippet_count = 1 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count + * is deprecated. See google/cloud/discoveryengine/v1/search_service.proto;l=304 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearMaxSnippetCount() { + bitField0_ = (bitField0_ & ~0x00000001); + maxSnippetCount_ = 0; + onChanged(); + return this; + } + + private boolean referenceOnly_; + /** + * + * + *
+         * [DEPRECATED] This field is deprecated and will have no affect on the
+         * snippet.
+         * 
+ * + * bool reference_only = 2 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only + * is deprecated. See google/cloud/discoveryengine/v1/search_service.proto;l=308 + * @return The referenceOnly. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getReferenceOnly() { + return referenceOnly_; + } + /** + * + * + *
+         * [DEPRECATED] This field is deprecated and will have no affect on the
+         * snippet.
+         * 
+ * + * bool reference_only = 2 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only + * is deprecated. See google/cloud/discoveryengine/v1/search_service.proto;l=308 + * @param value The referenceOnly to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setReferenceOnly(boolean value) { + + referenceOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * [DEPRECATED] This field is deprecated and will have no affect on the
+         * snippet.
+         * 
+ * + * bool reference_only = 2 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only + * is deprecated. See google/cloud/discoveryengine/v1/search_service.proto;l=308 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearReferenceOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + referenceOnly_ = false; + onChanged(); + return this; + } + + private boolean returnSnippet_; + /** + * + * + *
+         * If `true`, then return snippet. If no snippet can be generated, we
+         * return "No snippet is available for this page." A `snippet_status` with
+         * `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+         * 
+ * + * bool return_snippet = 3; + * + * @return The returnSnippet. + */ + @java.lang.Override + public boolean getReturnSnippet() { + return returnSnippet_; + } + /** + * + * + *
+         * If `true`, then return snippet. If no snippet can be generated, we
+         * return "No snippet is available for this page." A `snippet_status` with
+         * `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+         * 
+ * + * bool return_snippet = 3; + * + * @param value The returnSnippet to set. + * @return This builder for chaining. + */ + public Builder setReturnSnippet(boolean value) { + + returnSnippet_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * If `true`, then return snippet. If no snippet can be generated, we
+         * return "No snippet is available for this page." A `snippet_status` with
+         * `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+         * 
+ * + * bool return_snippet = 3; + * + * @return This builder for chaining. + */ + public Builder clearReturnSnippet() { + bitField0_ = (bitField0_ & ~0x00000004); + returnSnippet_ = 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) + private static final com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + .SnippetSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec(); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SnippetSpec 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SummarySpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The number of top results to generate the summary from. If the number
+       * of results returned is less than `summaryResultCount`, the summary is
+       * generated from all of the results.
+       *
+       * At most five results can be used to generate a summary.
+       * 
+ * + * int32 summary_result_count = 1; + * + * @return The summaryResultCount. + */ + int getSummaryResultCount(); + + /** + * + * + *
+       * Specifies whether to include citations in the summary. The default
+       * value is `false`.
+       *
+       * When this field is set to `true`, summaries include in-line citation
+       * numbers.
+       *
+       * Example summary including citations:
+       *
+       * BigQuery is Google Cloud's fully managed and completely serverless
+       * enterprise data warehouse [1]. BigQuery supports all data types, works
+       * across clouds, and has built-in machine learning and business
+       * intelligence, all within a unified platform [2, 3].
+       *
+       * The citation numbers refer to the returned search results and are
+       * 1-indexed. For example, [1] means that the sentence is attributed to
+       * the first search result. [2, 3] means that the sentence is attributed
+       * to both the second and third search results.
+       * 
+ * + * bool include_citations = 2; + * + * @return The includeCitations. + */ + boolean getIncludeCitations(); + + /** + * + * + *
+       * Specifies whether to filter out adversarial queries. The default value
+       * is `false`.
+       *
+       * Google employs search-query classification to detect adversarial
+       * queries. No summary is returned if the search query is classified as an
+       * adversarial query. For example, a user might ask a question regarding
+       * negative comments about the company or submit a query designed to
+       * generate unsafe, policy-violating output. If this field is set to
+       * `true`, we skip generating summaries for adversarial queries and return
+       * fallback messages instead.
+       * 
+ * + * bool ignore_adversarial_query = 3; + * + * @return The ignoreAdversarialQuery. + */ + boolean getIgnoreAdversarialQuery(); + + /** + * + * + *
+       * Specifies whether to filter out queries that are not summary-seeking.
+       * The default value is `false`.
+       *
+       * Google employs search-query classification to detect summary-seeking
+       * queries. No summary is returned if the search query is classified as a
+       * non-summary seeking query. For example, `why is the sky blue` and `Who
+       * is the best soccer player in the world?` are summary-seeking queries,
+       * but `SFO airport` and `world cup 2026` are not. They are most likely
+       * navigational queries. If this field is set to `true`, we skip
+       * generating summaries for non-summary seeking queries and return
+       * fallback messages instead.
+       * 
+ * + * bool ignore_non_summary_seeking_query = 4; + * + * @return The ignoreNonSummarySeekingQuery. + */ + boolean getIgnoreNonSummarySeekingQuery(); + + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+       * 
+ * + * string language_code = 6; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+       * 
+ * + * string language_code = 6; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + } + /** + * + * + *
+     * A specification for configuring a summary returned in a search
+     * response.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec} + */ + public static final class SummarySpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec) + SummarySpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use SummarySpec.newBuilder() to construct. + private SummarySpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SummarySpec() { + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SummarySpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SummarySpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SummarySpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .class, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .Builder.class); + } + + public static final int SUMMARY_RESULT_COUNT_FIELD_NUMBER = 1; + private int summaryResultCount_ = 0; + /** + * + * + *
+       * The number of top results to generate the summary from. If the number
+       * of results returned is less than `summaryResultCount`, the summary is
+       * generated from all of the results.
+       *
+       * At most five results can be used to generate a summary.
+       * 
+ * + * int32 summary_result_count = 1; + * + * @return The summaryResultCount. + */ + @java.lang.Override + public int getSummaryResultCount() { + return summaryResultCount_; + } + + public static final int INCLUDE_CITATIONS_FIELD_NUMBER = 2; + private boolean includeCitations_ = false; + /** + * + * + *
+       * Specifies whether to include citations in the summary. The default
+       * value is `false`.
+       *
+       * When this field is set to `true`, summaries include in-line citation
+       * numbers.
+       *
+       * Example summary including citations:
+       *
+       * BigQuery is Google Cloud's fully managed and completely serverless
+       * enterprise data warehouse [1]. BigQuery supports all data types, works
+       * across clouds, and has built-in machine learning and business
+       * intelligence, all within a unified platform [2, 3].
+       *
+       * The citation numbers refer to the returned search results and are
+       * 1-indexed. For example, [1] means that the sentence is attributed to
+       * the first search result. [2, 3] means that the sentence is attributed
+       * to both the second and third search results.
+       * 
+ * + * bool include_citations = 2; + * + * @return The includeCitations. + */ + @java.lang.Override + public boolean getIncludeCitations() { + return includeCitations_; + } + + public static final int IGNORE_ADVERSARIAL_QUERY_FIELD_NUMBER = 3; + private boolean ignoreAdversarialQuery_ = false; + /** + * + * + *
+       * Specifies whether to filter out adversarial queries. The default value
+       * is `false`.
+       *
+       * Google employs search-query classification to detect adversarial
+       * queries. No summary is returned if the search query is classified as an
+       * adversarial query. For example, a user might ask a question regarding
+       * negative comments about the company or submit a query designed to
+       * generate unsafe, policy-violating output. If this field is set to
+       * `true`, we skip generating summaries for adversarial queries and return
+       * fallback messages instead.
+       * 
+ * + * bool ignore_adversarial_query = 3; + * + * @return The ignoreAdversarialQuery. + */ + @java.lang.Override + public boolean getIgnoreAdversarialQuery() { + return ignoreAdversarialQuery_; + } + + public static final int IGNORE_NON_SUMMARY_SEEKING_QUERY_FIELD_NUMBER = 4; + private boolean ignoreNonSummarySeekingQuery_ = false; + /** + * + * + *
+       * Specifies whether to filter out queries that are not summary-seeking.
+       * The default value is `false`.
+       *
+       * Google employs search-query classification to detect summary-seeking
+       * queries. No summary is returned if the search query is classified as a
+       * non-summary seeking query. For example, `why is the sky blue` and `Who
+       * is the best soccer player in the world?` are summary-seeking queries,
+       * but `SFO airport` and `world cup 2026` are not. They are most likely
+       * navigational queries. If this field is set to `true`, we skip
+       * generating summaries for non-summary seeking queries and return
+       * fallback messages instead.
+       * 
+ * + * bool ignore_non_summary_seeking_query = 4; + * + * @return The ignoreNonSummarySeekingQuery. + */ + @java.lang.Override + public boolean getIgnoreNonSummarySeekingQuery() { + return ignoreNonSummarySeekingQuery_; + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object languageCode_ = ""; + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+       * 
+ * + * string language_code = 6; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+       * 
+ * + * string language_code = 6; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (summaryResultCount_ != 0) { + output.writeInt32(1, summaryResultCount_); + } + if (includeCitations_ != false) { + output.writeBool(2, includeCitations_); + } + if (ignoreAdversarialQuery_ != false) { + output.writeBool(3, ignoreAdversarialQuery_); + } + if (ignoreNonSummarySeekingQuery_ != false) { + output.writeBool(4, ignoreNonSummarySeekingQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, languageCode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (summaryResultCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, summaryResultCount_); + } + if (includeCitations_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, includeCitations_); + } + if (ignoreAdversarialQuery_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ignoreAdversarialQuery_); + } + if (ignoreNonSummarySeekingQuery_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 4, ignoreNonSummarySeekingQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, languageCode_); + } + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec other = + (com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec) obj; + + if (getSummaryResultCount() != other.getSummaryResultCount()) return false; + if (getIncludeCitations() != other.getIncludeCitations()) return false; + if (getIgnoreAdversarialQuery() != other.getIgnoreAdversarialQuery()) return false; + if (getIgnoreNonSummarySeekingQuery() != other.getIgnoreNonSummarySeekingQuery()) + return false; + if (!getLanguageCode().equals(other.getLanguageCode())) 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) + SUMMARY_RESULT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getSummaryResultCount(); + hash = (37 * hash) + INCLUDE_CITATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeCitations()); + hash = (37 * hash) + IGNORE_ADVERSARIAL_QUERY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreAdversarialQuery()); + hash = (37 * hash) + IGNORE_NON_SUMMARY_SEEKING_QUERY_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getIgnoreNonSummarySeekingQuery()); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + 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 specification for configuring a summary returned in a search
+       * response.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec) + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SummarySpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SummarySpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .class, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + summaryResultCount_ = 0; + includeCitations_ = false; + ignoreAdversarialQuery_ = false; + ignoreNonSummarySeekingQuery_ = false; + languageCode_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SummarySpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + build() { + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + buildPartial() { + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec result = + new com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.summaryResultCount_ = summaryResultCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.includeCitations_ = includeCitations_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ignoreAdversarialQuery_ = ignoreAdversarialQuery_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ignoreNonSummarySeekingQuery_ = ignoreNonSummarySeekingQuery_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.languageCode_ = languageCode_; + } + } + + @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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance()) return this; + if (other.getSummaryResultCount() != 0) { + setSummaryResultCount(other.getSummaryResultCount()); + } + if (other.getIncludeCitations() != false) { + setIncludeCitations(other.getIncludeCitations()); + } + if (other.getIgnoreAdversarialQuery() != false) { + setIgnoreAdversarialQuery(other.getIgnoreAdversarialQuery()); + } + if (other.getIgnoreNonSummarySeekingQuery() != false) { + setIgnoreNonSummarySeekingQuery(other.getIgnoreNonSummarySeekingQuery()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + summaryResultCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + includeCitations_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + ignoreAdversarialQuery_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + ignoreNonSummarySeekingQuery_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 50: + { + languageCode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int summaryResultCount_; + /** + * + * + *
+         * The number of top results to generate the summary from. If the number
+         * of results returned is less than `summaryResultCount`, the summary is
+         * generated from all of the results.
+         *
+         * At most five results can be used to generate a summary.
+         * 
+ * + * int32 summary_result_count = 1; + * + * @return The summaryResultCount. + */ + @java.lang.Override + public int getSummaryResultCount() { + return summaryResultCount_; + } + /** + * + * + *
+         * The number of top results to generate the summary from. If the number
+         * of results returned is less than `summaryResultCount`, the summary is
+         * generated from all of the results.
+         *
+         * At most five results can be used to generate a summary.
+         * 
+ * + * int32 summary_result_count = 1; + * + * @param value The summaryResultCount to set. + * @return This builder for chaining. + */ + public Builder setSummaryResultCount(int value) { + + summaryResultCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The number of top results to generate the summary from. If the number
+         * of results returned is less than `summaryResultCount`, the summary is
+         * generated from all of the results.
+         *
+         * At most five results can be used to generate a summary.
+         * 
+ * + * int32 summary_result_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearSummaryResultCount() { + bitField0_ = (bitField0_ & ~0x00000001); + summaryResultCount_ = 0; + onChanged(); + return this; + } + + private boolean includeCitations_; + /** + * + * + *
+         * Specifies whether to include citations in the summary. The default
+         * value is `false`.
+         *
+         * When this field is set to `true`, summaries include in-line citation
+         * numbers.
+         *
+         * Example summary including citations:
+         *
+         * BigQuery is Google Cloud's fully managed and completely serverless
+         * enterprise data warehouse [1]. BigQuery supports all data types, works
+         * across clouds, and has built-in machine learning and business
+         * intelligence, all within a unified platform [2, 3].
+         *
+         * The citation numbers refer to the returned search results and are
+         * 1-indexed. For example, [1] means that the sentence is attributed to
+         * the first search result. [2, 3] means that the sentence is attributed
+         * to both the second and third search results.
+         * 
+ * + * bool include_citations = 2; + * + * @return The includeCitations. + */ + @java.lang.Override + public boolean getIncludeCitations() { + return includeCitations_; + } + /** + * + * + *
+         * Specifies whether to include citations in the summary. The default
+         * value is `false`.
+         *
+         * When this field is set to `true`, summaries include in-line citation
+         * numbers.
+         *
+         * Example summary including citations:
+         *
+         * BigQuery is Google Cloud's fully managed and completely serverless
+         * enterprise data warehouse [1]. BigQuery supports all data types, works
+         * across clouds, and has built-in machine learning and business
+         * intelligence, all within a unified platform [2, 3].
+         *
+         * The citation numbers refer to the returned search results and are
+         * 1-indexed. For example, [1] means that the sentence is attributed to
+         * the first search result. [2, 3] means that the sentence is attributed
+         * to both the second and third search results.
+         * 
+ * + * bool include_citations = 2; + * + * @param value The includeCitations to set. + * @return This builder for chaining. + */ + public Builder setIncludeCitations(boolean value) { + + includeCitations_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Specifies whether to include citations in the summary. The default
+         * value is `false`.
+         *
+         * When this field is set to `true`, summaries include in-line citation
+         * numbers.
+         *
+         * Example summary including citations:
+         *
+         * BigQuery is Google Cloud's fully managed and completely serverless
+         * enterprise data warehouse [1]. BigQuery supports all data types, works
+         * across clouds, and has built-in machine learning and business
+         * intelligence, all within a unified platform [2, 3].
+         *
+         * The citation numbers refer to the returned search results and are
+         * 1-indexed. For example, [1] means that the sentence is attributed to
+         * the first search result. [2, 3] means that the sentence is attributed
+         * to both the second and third search results.
+         * 
+ * + * bool include_citations = 2; + * + * @return This builder for chaining. + */ + public Builder clearIncludeCitations() { + bitField0_ = (bitField0_ & ~0x00000002); + includeCitations_ = false; + onChanged(); + return this; + } + + private boolean ignoreAdversarialQuery_; + /** + * + * + *
+         * Specifies whether to filter out adversarial queries. The default value
+         * is `false`.
+         *
+         * Google employs search-query classification to detect adversarial
+         * queries. No summary is returned if the search query is classified as an
+         * adversarial query. For example, a user might ask a question regarding
+         * negative comments about the company or submit a query designed to
+         * generate unsafe, policy-violating output. If this field is set to
+         * `true`, we skip generating summaries for adversarial queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_adversarial_query = 3; + * + * @return The ignoreAdversarialQuery. + */ + @java.lang.Override + public boolean getIgnoreAdversarialQuery() { + return ignoreAdversarialQuery_; + } + /** + * + * + *
+         * Specifies whether to filter out adversarial queries. The default value
+         * is `false`.
+         *
+         * Google employs search-query classification to detect adversarial
+         * queries. No summary is returned if the search query is classified as an
+         * adversarial query. For example, a user might ask a question regarding
+         * negative comments about the company or submit a query designed to
+         * generate unsafe, policy-violating output. If this field is set to
+         * `true`, we skip generating summaries for adversarial queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_adversarial_query = 3; + * + * @param value The ignoreAdversarialQuery to set. + * @return This builder for chaining. + */ + public Builder setIgnoreAdversarialQuery(boolean value) { + + ignoreAdversarialQuery_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Specifies whether to filter out adversarial queries. The default value
+         * is `false`.
+         *
+         * Google employs search-query classification to detect adversarial
+         * queries. No summary is returned if the search query is classified as an
+         * adversarial query. For example, a user might ask a question regarding
+         * negative comments about the company or submit a query designed to
+         * generate unsafe, policy-violating output. If this field is set to
+         * `true`, we skip generating summaries for adversarial queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_adversarial_query = 3; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreAdversarialQuery() { + bitField0_ = (bitField0_ & ~0x00000004); + ignoreAdversarialQuery_ = false; + onChanged(); + return this; + } + + private boolean ignoreNonSummarySeekingQuery_; + /** + * + * + *
+         * Specifies whether to filter out queries that are not summary-seeking.
+         * The default value is `false`.
+         *
+         * Google employs search-query classification to detect summary-seeking
+         * queries. No summary is returned if the search query is classified as a
+         * non-summary seeking query. For example, `why is the sky blue` and `Who
+         * is the best soccer player in the world?` are summary-seeking queries,
+         * but `SFO airport` and `world cup 2026` are not. They are most likely
+         * navigational queries. If this field is set to `true`, we skip
+         * generating summaries for non-summary seeking queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_non_summary_seeking_query = 4; + * + * @return The ignoreNonSummarySeekingQuery. + */ + @java.lang.Override + public boolean getIgnoreNonSummarySeekingQuery() { + return ignoreNonSummarySeekingQuery_; + } + /** + * + * + *
+         * Specifies whether to filter out queries that are not summary-seeking.
+         * The default value is `false`.
+         *
+         * Google employs search-query classification to detect summary-seeking
+         * queries. No summary is returned if the search query is classified as a
+         * non-summary seeking query. For example, `why is the sky blue` and `Who
+         * is the best soccer player in the world?` are summary-seeking queries,
+         * but `SFO airport` and `world cup 2026` are not. They are most likely
+         * navigational queries. If this field is set to `true`, we skip
+         * generating summaries for non-summary seeking queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_non_summary_seeking_query = 4; + * + * @param value The ignoreNonSummarySeekingQuery to set. + * @return This builder for chaining. + */ + public Builder setIgnoreNonSummarySeekingQuery(boolean value) { + + ignoreNonSummarySeekingQuery_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Specifies whether to filter out queries that are not summary-seeking.
+         * The default value is `false`.
+         *
+         * Google employs search-query classification to detect summary-seeking
+         * queries. No summary is returned if the search query is classified as a
+         * non-summary seeking query. For example, `why is the sky blue` and `Who
+         * is the best soccer player in the world?` are summary-seeking queries,
+         * but `SFO airport` and `world cup 2026` are not. They are most likely
+         * navigational queries. If this field is set to `true`, we skip
+         * generating summaries for non-summary seeking queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_non_summary_seeking_query = 4; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreNonSummarySeekingQuery() { + bitField0_ = (bitField0_ & ~0x00000008); + ignoreNonSummarySeekingQuery_ = false; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+         * 
+ * + * string language_code = 6; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+         * 
+ * + * string language_code = 6; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+         * 
+ * + * string language_code = 6; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + languageCode_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+         * 
+ * + * string language_code = 6; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + languageCode_ = getDefaultInstance().getLanguageCode(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+         * 
+ * + * string language_code = 6; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + languageCode_ = value; + bitField0_ |= 0x00000010; + 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.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec) private static final com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec - .SnippetSpec + .SummarySpec DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = - new com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec(); + new com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec(); } - public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + public static com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public SnippetSpec parsePartialFrom( + public SummarySpec parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2531,17 +12000,17 @@ public SnippetSpec parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -2554,8 +12023,8 @@ public com.google.protobuf.Parser getParserForType() { * * *
-     * If there is no snippet spec provided, there will be no snippet in the
-     * search result.
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
      * 
* * @@ -2572,8 +12041,8 @@ public boolean hasSnippetSpec() { * * *
-     * If there is no snippet spec provided, there will be no snippet in the
-     * search result.
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
      * 
* * @@ -2594,8 +12063,8 @@ public boolean hasSnippetSpec() { * * *
-     * If there is no snippet spec provided, there will be no snippet in the
-     * search result.
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
      * 
* * @@ -2611,6 +12080,70 @@ public boolean hasSnippetSpec() { : snippetSpec_; } + public static final int SUMMARY_SPEC_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + summarySpec_; + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return Whether the summarySpec field is set. + */ + @java.lang.Override + public boolean hasSummarySpec() { + return summarySpec_ != null; + } + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return The summarySpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec() { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpecOrBuilder + getSummarySpecOrBuilder() { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -2628,6 +12161,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (snippetSpec_ != null) { output.writeMessage(1, getSnippetSpec()); } + if (summarySpec_ != null) { + output.writeMessage(2, getSummarySpec()); + } getUnknownFields().writeTo(output); } @@ -2640,6 +12176,9 @@ public int getSerializedSize() { if (snippetSpec_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSnippetSpec()); } + if (summarySpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSummarySpec()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -2660,6 +12199,10 @@ public boolean equals(final java.lang.Object obj) { if (hasSnippetSpec()) { if (!getSnippetSpec().equals(other.getSnippetSpec())) return false; } + if (hasSummarySpec() != other.hasSummarySpec()) return false; + if (hasSummarySpec()) { + if (!getSummarySpec().equals(other.getSummarySpec())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2675,6 +12218,10 @@ public int hashCode() { hash = (37 * hash) + SNIPPET_SPEC_FIELD_NUMBER; hash = (53 * hash) + getSnippetSpec().hashCode(); } + if (hasSummarySpec()) { + hash = (37 * hash) + SUMMARY_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSummarySpec().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -2782,8 +12329,7 @@ protected Builder newBuilderForType( * * *
-     * The specification that configs the desired behavior of the UCS content
-     * search.
+     * A specification for configuring the behavior of content search.
      * 
* * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} @@ -2825,6 +12371,11 @@ public Builder clear() { snippetSpecBuilder_.dispose(); snippetSpecBuilder_ = null; } + summarySpec_ = null; + if (summarySpecBuilder_ != null) { + summarySpecBuilder_.dispose(); + summarySpecBuilder_ = null; + } return this; } @@ -2868,6 +12419,10 @@ private void buildPartial0( result.snippetSpec_ = snippetSpecBuilder_ == null ? snippetSpec_ : snippetSpecBuilder_.build(); } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.summarySpec_ = + summarySpecBuilder_ == null ? summarySpec_ : summarySpecBuilder_.build(); + } } @java.lang.Override @@ -2924,6 +12479,9 @@ public Builder mergeFrom( if (other.hasSnippetSpec()) { mergeSnippetSpec(other.getSnippetSpec()); } + if (other.hasSummarySpec()) { + mergeSummarySpec(other.getSummarySpec()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -2956,6 +12514,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 10 + case 18: + { + input.readMessage(getSummarySpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2988,8 +12552,8 @@ public Builder mergeFrom( * * *
-       * If there is no snippet spec provided, there will be no snippet in the
-       * search result.
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
        * 
* * @@ -3005,8 +12569,8 @@ public boolean hasSnippetSpec() { * * *
-       * If there is no snippet spec provided, there will be no snippet in the
-       * search result.
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
        * 
* * @@ -3030,8 +12594,8 @@ public boolean hasSnippetSpec() { * * *
-       * If there is no snippet spec provided, there will be no snippet in the
-       * search result.
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
        * 
* * @@ -3056,8 +12620,8 @@ public Builder setSnippetSpec( * * *
-       * If there is no snippet spec provided, there will be no snippet in the
-       * search result.
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
        * 
* * @@ -3080,8 +12644,8 @@ public Builder setSnippetSpec( * * *
-       * If there is no snippet spec provided, there will be no snippet in the
-       * search result.
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
        * 
* * @@ -3111,8 +12675,8 @@ public Builder mergeSnippetSpec( * * *
-       * If there is no snippet spec provided, there will be no snippet in the
-       * search result.
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
        * 
* * @@ -3133,8 +12697,8 @@ public Builder clearSnippetSpec() { * * *
-       * If there is no snippet spec provided, there will be no snippet in the
-       * search result.
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
        * 
* * @@ -3145,62 +12709,290 @@ public Builder clearSnippetSpec() { getSnippetSpecBuilder() { bitField0_ |= 0x00000001; onChanged(); - return getSnippetSpecFieldBuilder().getBuilder(); + return getSnippetSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + .SnippetSpecOrBuilder + getSnippetSpecOrBuilder() { + if (snippetSpecBuilder_ != null) { + return snippetSpecBuilder_.getMessageOrBuilder(); + } else { + return snippetSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + .getDefaultInstance() + : snippetSpec_; + } + } + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + .Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + .SnippetSpecOrBuilder> + getSnippetSpecFieldBuilder() { + if (snippetSpecBuilder_ == null) { + snippetSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + .Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + .SnippetSpecOrBuilder>(getSnippetSpec(), getParentForChildren(), isClean()); + snippetSpec_ = null; + } + return snippetSpecBuilder_; + } + + private com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + summarySpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder> + summarySpecBuilder_; + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return Whether the summarySpec field is set. + */ + public boolean hasSummarySpec() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return The summarySpec. + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec() { + if (summarySpecBuilder_ == null) { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } else { + return summarySpecBuilder_.getMessage(); + } + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public Builder setSummarySpec( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec value) { + if (summarySpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summarySpec_ = value; + } else { + summarySpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public Builder setSummarySpec( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.Builder + builderForValue) { + if (summarySpecBuilder_ == null) { + summarySpec_ = builderForValue.build(); + } else { + summarySpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public Builder mergeSummarySpec( + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec value) { + if (summarySpecBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && summarySpec_ != null + && summarySpec_ + != com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance()) { + getSummarySpecBuilder().mergeFrom(value); + } else { + summarySpec_ = value; + } + } else { + summarySpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public Builder clearSummarySpec() { + bitField0_ = (bitField0_ & ~0x00000002); + summarySpec_ = null; + if (summarySpecBuilder_ != null) { + summarySpecBuilder_.dispose(); + summarySpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.Builder + getSummarySpecBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSummarySpecFieldBuilder().getBuilder(); } /** * * *
-       * If there is no snippet spec provided, there will be no snippet in the
-       * search result.
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
        * 
* * - * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; * */ public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec - .SnippetSpecOrBuilder - getSnippetSpecOrBuilder() { - if (snippetSpecBuilder_ != null) { - return snippetSpecBuilder_.getMessageOrBuilder(); + .SummarySpecOrBuilder + getSummarySpecOrBuilder() { + if (summarySpecBuilder_ != null) { + return summarySpecBuilder_.getMessageOrBuilder(); } else { - return snippetSpec_ == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec .getDefaultInstance() - : snippetSpec_; + : summarySpec_; } } /** * * *
-       * If there is no snippet spec provided, there will be no snippet in the
-       * search result.
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
        * 
* * - * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; * */ private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec, - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec .Builder, com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec - .SnippetSpecOrBuilder> - getSnippetSpecFieldBuilder() { - if (snippetSpecBuilder_ == null) { - snippetSpecBuilder_ = + .SummarySpecOrBuilder> + getSummarySpecFieldBuilder() { + if (summarySpecBuilder_ == null) { + summarySpecBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec, - com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec .Builder, com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec - .SnippetSpecOrBuilder>(getSnippetSpec(), getParentForChildren(), isClean()); - snippetSpec_ = null; + .SummarySpecOrBuilder>(getSummarySpec(), getParentForChildren(), isClean()); + summarySpec_ = null; } - return snippetSpecBuilder_; + return summarySpecBuilder_; } @java.lang.Override @@ -3441,6 +13233,57 @@ public com.google.protobuf.ByteString getQueryBytes() { } } + public static final int IMAGE_QUERY_FIELD_NUMBER = 19; + private com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery imageQuery_; + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + * + * @return Whether the imageQuery field is set. + */ + @java.lang.Override + public boolean hasImageQuery() { + return imageQuery_ != null; + } + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + * + * @return The imageQuery. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery getImageQuery() { + return imageQuery_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.getDefaultInstance() + : imageQuery_; + } + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ImageQueryOrBuilder + getImageQueryOrBuilder() { + return imageQuery_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.getDefaultInstance() + : imageQuery_; + } + public static final int PAGE_SIZE_FIELD_NUMBER = 4; private int pageSize_ = 0; /** @@ -3449,7 +13292,7 @@ public com.google.protobuf.ByteString getQueryBytes() { *
    * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
    * return. If unspecified, defaults to a reasonable value. The maximum allowed
-   * value is 100. Values above 100 will be coerced to 100.
+   * value is 100. Values above 100 are coerced to 100.
    *
    * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
    * 
@@ -3511,102 +13354,365 @@ public java.lang.String getPageToken() { * `INVALID_ARGUMENT` error is returned. * * - * string page_token = 5; + * string page_token = 5; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OFFSET_FIELD_NUMBER = 6; + private int offset_ = 0; + /** + * + * + *
+   * A 0-indexed integer that specifies the current offset (that is, starting
+   * result location, amongst the
+   * [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as
+   * relevant) in search results. This field is only considered if
+   * [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is
+   * unset.
+   *
+   * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * int32 offset = 6; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + public static final int FILTER_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the documents being filtered. Filter
+   * expression is case-sensitive.
+   *
+   * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * string filter = 7; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the documents being filtered. Filter
+   * expression is case-sensitive.
+   *
+   * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * string filter = 7; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * The order in which documents are returned. Documents can be ordered by
+   * a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
+   * Leave it unset if ordered by relevance. `order_by` expression is
+   * case-sensitive.
+   *
+   * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+   * 
+ * + * string order_by = 8; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The order in which documents are returned. Documents can be ordered by
+   * a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
+   * Leave it unset if ordered by relevance. `order_by` expression is
+   * case-sensitive.
+   *
+   * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+   * 
+ * + * string order_by = 8; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_INFO_FIELD_NUMBER = 21; + private com.google.cloud.discoveryengine.v1.UserInfo userInfo_; + /** + * + * + *
+   * Information about the end user.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
+   * 
+ * + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * + * @return Whether the userInfo field is set. + */ + @java.lang.Override + public boolean hasUserInfo() { + return userInfo_ != null; + } + /** + * + * + *
+   * Information about the end user.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
+   * 
+ * + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * + * @return The userInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.UserInfo getUserInfo() { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1.UserInfo.getDefaultInstance() + : userInfo_; + } + /** + * + * + *
+   * Information about the end user.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
+   * 
+ * + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.UserInfoOrBuilder getUserInfoOrBuilder() { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1.UserInfo.getDefaultInstance() + : userInfo_; + } + + public static final int FACET_SPECS_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private java.util.List facetSpecs_; + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   *
+   * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+   * error is returned.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + */ + @java.lang.Override + public java.util.List + getFacetSpecsList() { + return facetSpecs_; + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   *
+   * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+   * error is returned.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpecOrBuilder> + getFacetSpecsOrBuilderList() { + return facetSpecs_; + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   *
+   * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+   * error is returned.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + */ + @java.lang.Override + public int getFacetSpecsCount() { + return facetSpecs_.size(); + } + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
    *
-   * @return The bytes for pageToken.
+   * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+   * error is returned.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; */ @java.lang.Override - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec getFacetSpecs(int index) { + return facetSpecs_.get(index); } - - public static final int OFFSET_FIELD_NUMBER = 6; - private int offset_ = 0; /** * * *
-   * A 0-indexed integer that specifies the current offset (that is, starting
-   * result location, amongst the
-   * [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as
-   * relevant) in search results. This field is only considered if
-   * [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is
-   * unset.
+   * Facet specifications for faceted search. If empty, no facets are returned.
    *
-   * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+   * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+   * error is returned.
    * 
* - * int32 offset = 6; - * - * @return The offset. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; */ @java.lang.Override - public int getOffset() { - return offset_; + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpecOrBuilder + getFacetSpecsOrBuilder(int index) { + return facetSpecs_.get(index); } - public static final int USER_INFO_FIELD_NUMBER = 21; - private com.google.cloud.discoveryengine.v1.UserInfo userInfo_; + public static final int BOOST_SPEC_FIELD_NUMBER = 10; + private com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boostSpec_; /** * * *
-   * Information about the end user.
-   * Highly recommended for analytics. The user_agent string in UserInfo will
-   * be used to deduce device_type for analytics.
+   * Boost specification to boost certain documents.
    * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; * - * @return Whether the userInfo field is set. + * @return Whether the boostSpec field is set. */ @java.lang.Override - public boolean hasUserInfo() { - return userInfo_ != null; + public boolean hasBoostSpec() { + return boostSpec_ != null; } /** * * *
-   * Information about the end user.
-   * Highly recommended for analytics. The user_agent string in UserInfo will
-   * be used to deduce device_type for analytics.
+   * Boost specification to boost certain documents.
    * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; * - * @return The userInfo. + * @return The boostSpec. */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.UserInfo getUserInfo() { - return userInfo_ == null - ? com.google.cloud.discoveryengine.v1.UserInfo.getDefaultInstance() - : userInfo_; + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec getBoostSpec() { + return boostSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; } /** * * *
-   * Information about the end user.
-   * Highly recommended for analytics. The user_agent string in UserInfo will
-   * be used to deduce device_type for analytics.
+   * Boost specification to boost certain documents.
    * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.UserInfoOrBuilder getUserInfoOrBuilder() { - return userInfo_ == null - ? com.google.cloud.discoveryengine.v1.UserInfo.getDefaultInstance() - : userInfo_; + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecOrBuilder + getBoostSpecOrBuilder() { + return boostSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; } public static final int PARAMS_FIELD_NUMBER = 11; @@ -3753,7 +13859,7 @@ public com.google.protobuf.Value getParamsOrThrow(java.lang.String key) { * *
    * The query expansion specification that specifies the conditions under which
-   * query expansion will occur.
+   * query expansion occurs.
    * 
* * @@ -3770,1190 +13876,2202 @@ public boolean hasQueryExpansionSpec() { * * *
-   * The query expansion specification that specifies the conditions under which
-   * query expansion will occur.
+   * The query expansion specification that specifies the conditions under which
+   * query expansion occurs.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + * + * @return The queryExpansionSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + getQueryExpansionSpec() { + return queryExpansionSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion occurs.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder() { + return queryExpansionSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.getDefaultInstance() + : queryExpansionSpec_; + } + + public static final int SPELL_CORRECTION_SPEC_FIELD_NUMBER = 14; + private com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + spellCorrectionSpec_; + /** + * + * + *
+   * The spell correction specification that specifies the mode under
+   * which spell correction takes effect.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + * + * @return Whether the spellCorrectionSpec field is set. + */ + @java.lang.Override + public boolean hasSpellCorrectionSpec() { + return spellCorrectionSpec_ != null; + } + /** + * + * + *
+   * The spell correction specification that specifies the mode under
+   * which spell correction takes effect.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + * + * @return The spellCorrectionSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + getSpellCorrectionSpec() { + return spellCorrectionSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.getDefaultInstance() + : spellCorrectionSpec_; + } + /** + * + * + *
+   * The spell correction specification that specifies the mode under
+   * which spell correction takes effect.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpecOrBuilder + getSpellCorrectionSpecOrBuilder() { + return spellCorrectionSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.getDefaultInstance() + : spellCorrectionSpec_; + } + + public static final int USER_PSEUDO_ID_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+   * A unique identifier for tracking visitors. For example, this could be
+   * implemented with an HTTP cookie, which should be able to uniquely identify
+   * a visitor on a single device. This unique identifier should not change if
+   * the visitor logs in or out of the website.
+   *
+   * This field should NOT have a fixed value such as `unknown_visitor`.
+   *
+   * This should be the same identifier as
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id]
+   * and
+   * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1.CompleteQueryRequest.user_pseudo_id]
+   *
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an  `INVALID_ARGUMENT`  error is returned.
+   * 
+ * + * string user_pseudo_id = 15; + * + * @return The userPseudoId. + */ + @java.lang.Override + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + 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(); + userPseudoId_ = s; + return s; + } + } + /** + * + * + *
+   * A unique identifier for tracking visitors. For example, this could be
+   * implemented with an HTTP cookie, which should be able to uniquely identify
+   * a visitor on a single device. This unique identifier should not change if
+   * the visitor logs in or out of the website.
+   *
+   * This field should NOT have a fixed value such as `unknown_visitor`.
+   *
+   * This should be the same identifier as
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id]
+   * and
+   * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1.CompleteQueryRequest.user_pseudo_id]
+   *
+   * The field must be a UTF-8 encoded string with a length limit of 128
+   * characters. Otherwise, an  `INVALID_ARGUMENT`  error is returned.
+   * 
+ * + * string user_pseudo_id = 15; + * + * @return The bytes for userPseudoId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_SEARCH_SPEC_FIELD_NUMBER = 24; + private com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec contentSearchSpec_; + /** + * + * + *
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + * + * @return Whether the contentSearchSpec field is set. + */ + @java.lang.Override + public boolean hasContentSearchSpec() { + return contentSearchSpec_ != null; + } + /** + * + * + *
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + * + * @return The contentSearchSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + getContentSearchSpec() { + return contentSearchSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.getDefaultInstance() + : contentSearchSpec_; + } + /** + * + * + *
+   * A specification for configuring the behavior of content search.
    * 
* * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec content_search_spec = 24; * - * - * @return The queryExpansionSpec. */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec - getQueryExpansionSpec() { - return queryExpansionSpec_ == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.getDefaultInstance() - : queryExpansionSpec_; + public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpecOrBuilder + getContentSearchSpecOrBuilder() { + return contentSearchSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.getDefaultInstance() + : contentSearchSpec_; } + + public static final int SAFE_SEARCH_FIELD_NUMBER = 20; + private boolean safeSearch_ = false; /** * * *
-   * The query expansion specification that specifies the conditions under which
-   * query expansion will occur.
+   * Whether to turn on safe search. This is only supported for
+   * website search.
    * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; - * + * bool safe_search = 20; + * + * @return The safeSearch. */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpecOrBuilder - getQueryExpansionSpecOrBuilder() { - return queryExpansionSpec_ == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.getDefaultInstance() - : queryExpansionSpec_; + public boolean getSafeSearch() { + return safeSearch_; } - public static final int SPELL_CORRECTION_SPEC_FIELD_NUMBER = 14; - private com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec - spellCorrectionSpec_; + public static final int USER_LABELS_FIELD_NUMBER = 22; + + private static final class UserLabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_UserLabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } /** * * *
-   * The spell correction specification that specifies the mode under
-   * which spell correction will take effect.
-   * 
+ * The user labels applied to a resource must meet the following requirements: * - * - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; - * + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. * - * @return Whether the spellCorrectionSpec field is set. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * + * map<string, string> user_labels = 22; */ @java.lang.Override - public boolean hasSpellCorrectionSpec() { - return spellCorrectionSpec_ != null; + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); } /** * * *
-   * The spell correction specification that specifies the mode under
-   * which spell correction will take effect.
-   * 
+ * The user labels applied to a resource must meet the following requirements: * - * - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; - * + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. * - * @return The spellCorrectionSpec. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * + * map<string, string> user_labels = 22; */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec - getSpellCorrectionSpec() { - return spellCorrectionSpec_ == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.getDefaultInstance() - : spellCorrectionSpec_; + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); } /** * * *
-   * The spell correction specification that specifies the mode under
-   * which spell correction will take effect.
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* - * - * .google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; - * + * map<string, string> user_labels = 22; */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpecOrBuilder - getSpellCorrectionSpecOrBuilder() { - return spellCorrectionSpec_ == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.getDefaultInstance() - : spellCorrectionSpec_; + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; } - - public static final int USER_PSEUDO_ID_FIELD_NUMBER = 15; - - @SuppressWarnings("serial") - private volatile java.lang.Object userPseudoId_ = ""; /** * * *
-   * A unique identifier for tracking visitors. For example, this could be
-   * implemented with an HTTP cookie, which should be able to uniquely identify
-   * a visitor on a single device. This unique identifier should not change if
-   * the visitor logs in or out of the website.
-   *
-   * This field should NOT have a fixed value such as `unknown_visitor`.
+   * The user labels applied to a resource must meet the following requirements:
    *
-   * This should be the same identifier as
-   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id]
-   * and
-   * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1.CompleteQueryRequest.user_pseudo_id]
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
    *
-   * The field must be a UTF-8 encoded string with a length limit of 128
-   * characters. Otherwise, an  `INVALID_ARGUMENT`  error is returned.
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
    * 
* - * string user_pseudo_id = 15; - * - * @return The userPseudoId. + * map<string, string> user_labels = 22; */ @java.lang.Override - public java.lang.String getUserPseudoId() { - java.lang.Object ref = userPseudoId_; - 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(); - userPseudoId_ = s; - return s; + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, servingConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); } + if (offset_ != 0) { + output.writeInt32(6, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, orderBy_); + } + for (int i = 0; i < facetSpecs_.size(); i++) { + output.writeMessage(9, facetSpecs_.get(i)); + } + if (boostSpec_ != null) { + output.writeMessage(10, getBoostSpec()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 11); + if (queryExpansionSpec_ != null) { + output.writeMessage(13, getQueryExpansionSpec()); + } + if (spellCorrectionSpec_ != null) { + output.writeMessage(14, getSpellCorrectionSpec()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, userPseudoId_); + } + if (imageQuery_ != null) { + output.writeMessage(19, getImageQuery()); + } + if (safeSearch_ != false) { + output.writeBool(20, safeSearch_); + } + if (userInfo_ != null) { + output.writeMessage(21, getUserInfo()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 22); + if (contentSearchSpec_ != null) { + output.writeMessage(24, getContentSearchSpec()); + } + getUnknownFields().writeTo(output); } - /** - * - * - *
-   * A unique identifier for tracking visitors. For example, this could be
-   * implemented with an HTTP cookie, which should be able to uniquely identify
-   * a visitor on a single device. This unique identifier should not change if
-   * the visitor logs in or out of the website.
-   *
-   * This field should NOT have a fixed value such as `unknown_visitor`.
-   *
-   * This should be the same identifier as
-   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id]
-   * and
-   * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1.CompleteQueryRequest.user_pseudo_id]
-   *
-   * The field must be a UTF-8 encoded string with a length limit of 128
-   * characters. Otherwise, an  `INVALID_ARGUMENT`  error is returned.
-   * 
- * - * string user_pseudo_id = 15; - * - * @return The bytes for userPseudoId. - */ + @java.lang.Override - public com.google.protobuf.ByteString getUserPseudoIdBytes() { - java.lang.Object ref = userPseudoId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - userPseudoId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfig_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, servingConfig_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, query_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); + } + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, orderBy_); + } + for (int i = 0; i < facetSpecs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, facetSpecs_.get(i)); + } + if (boostSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getBoostSpec()); + } + for (java.util.Map.Entry entry : + internalGetParams().getMap().entrySet()) { + com.google.protobuf.MapEntry params__ = + ParamsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, params__); + } + if (queryExpansionSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getQueryExpansionSpec()); + } + if (spellCorrectionSpec_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(14, getSpellCorrectionSpec()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, userPseudoId_); + } + if (imageQuery_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getImageQuery()); + } + if (safeSearch_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, safeSearch_); + } + if (userInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getUserInfo()); + } + for (java.util.Map.Entry entry : + internalGetUserLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry userLabels__ = + UserLabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, userLabels__); } + if (contentSearchSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getContentSearchSpec()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; } - public static final int CONTENT_SEARCH_SPEC_FIELD_NUMBER = 24; - private com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec contentSearchSpec_; - /** - * - * - *
-   * The content search spec that configs the desired behavior of content
-   * search.
-   * 
- * - * - * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec content_search_spec = 24; - * - * - * @return Whether the contentSearchSpec field is set. - */ @java.lang.Override - public boolean hasContentSearchSpec() { - return contentSearchSpec_ != null; + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1.SearchRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchRequest other = + (com.google.cloud.discoveryengine.v1.SearchRequest) obj; + + if (!getServingConfig().equals(other.getServingConfig())) return false; + if (!getBranch().equals(other.getBranch())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (hasImageQuery() != other.hasImageQuery()) return false; + if (hasImageQuery()) { + if (!getImageQuery().equals(other.getImageQuery())) return false; + } + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getOffset() != other.getOffset()) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (hasUserInfo() != other.hasUserInfo()) return false; + if (hasUserInfo()) { + if (!getUserInfo().equals(other.getUserInfo())) return false; + } + if (!getFacetSpecsList().equals(other.getFacetSpecsList())) return false; + if (hasBoostSpec() != other.hasBoostSpec()) return false; + if (hasBoostSpec()) { + if (!getBoostSpec().equals(other.getBoostSpec())) return false; + } + if (!internalGetParams().equals(other.internalGetParams())) return false; + if (hasQueryExpansionSpec() != other.hasQueryExpansionSpec()) return false; + if (hasQueryExpansionSpec()) { + if (!getQueryExpansionSpec().equals(other.getQueryExpansionSpec())) return false; + } + if (hasSpellCorrectionSpec() != other.hasSpellCorrectionSpec()) return false; + if (hasSpellCorrectionSpec()) { + if (!getSpellCorrectionSpec().equals(other.getSpellCorrectionSpec())) return false; + } + if (!getUserPseudoId().equals(other.getUserPseudoId())) return false; + if (hasContentSearchSpec() != other.hasContentSearchSpec()) return false; + if (hasContentSearchSpec()) { + if (!getContentSearchSpec().equals(other.getContentSearchSpec())) return false; + } + if (getSafeSearch() != other.getSafeSearch()) return false; + if (!internalGetUserLabels().equals(other.internalGetUserLabels())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; } - /** - * - * - *
-   * The content search spec that configs the desired behavior of content
-   * search.
-   * 
- * - * - * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec content_search_spec = 24; - * - * - * @return The contentSearchSpec. - */ + @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec - getContentSearchSpec() { - return contentSearchSpec_ == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.getDefaultInstance() - : contentSearchSpec_; + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().hashCode(); + hash = (37 * hash) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + if (hasImageQuery()) { + hash = (37 * hash) + IMAGE_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getImageQuery().hashCode(); + } + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (hasUserInfo()) { + hash = (37 * hash) + USER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().hashCode(); + } + if (getFacetSpecsCount() > 0) { + hash = (37 * hash) + FACET_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getFacetSpecsList().hashCode(); + } + if (hasBoostSpec()) { + hash = (37 * hash) + BOOST_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getBoostSpec().hashCode(); + } + if (!internalGetParams().getMap().isEmpty()) { + hash = (37 * hash) + PARAMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParams().hashCode(); + } + if (hasQueryExpansionSpec()) { + hash = (37 * hash) + QUERY_EXPANSION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionSpec().hashCode(); + } + if (hasSpellCorrectionSpec()) { + hash = (37 * hash) + SPELL_CORRECTION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpellCorrectionSpec().hashCode(); + } + hash = (37 * hash) + USER_PSEUDO_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserPseudoId().hashCode(); + if (hasContentSearchSpec()) { + hash = (37 * hash) + CONTENT_SEARCH_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getContentSearchSpec().hashCode(); + } + hash = (37 * hash) + SAFE_SEARCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSafeSearch()); + if (!internalGetUserLabels().getMap().isEmpty()) { + hash = (37 * hash) + USER_LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetUserLabels().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; } - /** - * - * - *
-   * The content search spec that configs the desired behavior of content
-   * search.
-   * 
- * - * - * .google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec content_search_spec = 24; - * - */ - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpecOrBuilder - getContentSearchSpecOrBuilder() { - return contentSearchSpec_ == null - ? com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.getDefaultInstance() - : contentSearchSpec_; + + public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - public static final int SAFE_SEARCH_FIELD_NUMBER = 20; - private boolean safeSearch_ = false; - /** - * - * - *
-   * Whether to turn on safe search. This is only supported for
-   * [ContentConfig.PUBLIC_WEBSITE][].
-   * 
- * - * bool safe_search = 20; - * - * @return The safeSearch. - */ - @java.lang.Override - public boolean getSafeSearch() { - return safeSearch_; + public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - public static final int USER_LABELS_FIELD_NUMBER = 22; + public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - private static final class UserLabelsDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_UserLabelsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); + public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - @SuppressWarnings("serial") - private com.google.protobuf.MapField userLabels_; + public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - private com.google.protobuf.MapField internalGetUserLabels() { - if (userLabels_ == null) { - return com.google.protobuf.MapField.emptyMapField(UserLabelsDefaultEntryHolder.defaultEntry); - } - return userLabels_; + public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - public int getUserLabelsCount() { - return internalGetUserLabels().getMap().size(); + public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - /** - * - * - *
-   * The user labels applied to a resource must meet the following requirements:
-   *
-   * * Each resource can have multiple labels, up to a maximum of 64.
-   * * Each label must be a key-value pair.
-   * * Keys have a minimum length of 1 character and a maximum length of 63
-   *   characters and cannot be empty. Values can be empty and have a maximum
-   *   length of 63 characters.
-   * * Keys and values can contain only lowercase letters, numeric characters,
-   *   underscores, and dashes. All characters must use UTF-8 encoding, and
-   *   international characters are allowed.
-   * * The key portion of a label must be unique. However, you can use the same
-   *   key with multiple resources.
-   * * Keys must start with a lowercase letter or international character.
-   *
-   * See [Google Cloud
-   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
-   * for more details.
-   * 
- * - * map<string, string> user_labels = 22; - */ - @java.lang.Override - public boolean containsUserLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetUserLabels().getMap().containsKey(key); + + public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - /** Use {@link #getUserLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getUserLabels() { - return getUserLabelsMap(); + + public static com.google.cloud.discoveryengine.v1.SearchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - /** - * - * - *
-   * The user labels applied to a resource must meet the following requirements:
-   *
-   * * Each resource can have multiple labels, up to a maximum of 64.
-   * * Each label must be a key-value pair.
-   * * Keys have a minimum length of 1 character and a maximum length of 63
-   *   characters and cannot be empty. Values can be empty and have a maximum
-   *   length of 63 characters.
-   * * Keys and values can contain only lowercase letters, numeric characters,
-   *   underscores, and dashes. All characters must use UTF-8 encoding, and
-   *   international characters are allowed.
-   * * The key portion of a label must be unique. However, you can use the same
-   *   key with multiple resources.
-   * * Keys must start with a lowercase letter or international character.
-   *
-   * See [Google Cloud
-   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
-   * for more details.
-   * 
- * - * map<string, string> user_labels = 22; - */ - @java.lang.Override - public java.util.Map getUserLabelsMap() { - return internalGetUserLabels().getMap(); + + public static com.google.cloud.discoveryengine.v1.SearchRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); } - /** - * - * - *
-   * The user labels applied to a resource must meet the following requirements:
-   *
-   * * Each resource can have multiple labels, up to a maximum of 64.
-   * * Each label must be a key-value pair.
-   * * Keys have a minimum length of 1 character and a maximum length of 63
-   *   characters and cannot be empty. Values can be empty and have a maximum
-   *   length of 63 characters.
-   * * Keys and values can contain only lowercase letters, numeric characters,
-   *   underscores, and dashes. All characters must use UTF-8 encoding, and
-   *   international characters are allowed.
-   * * The key portion of a label must be unique. However, you can use the same
-   *   key with multiple resources.
-   * * Keys must start with a lowercase letter or international character.
-   *
-   * See [Google Cloud
-   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
-   * for more details.
-   * 
- * - * map<string, string> user_labels = 22; - */ - @java.lang.Override - public /* nullable */ java.lang.String getUserLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetUserLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + + public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - /** - * - * - *
-   * The user labels applied to a resource must meet the following requirements:
-   *
-   * * Each resource can have multiple labels, up to a maximum of 64.
-   * * Each label must be a key-value pair.
-   * * Keys have a minimum length of 1 character and a maximum length of 63
-   *   characters and cannot be empty. Values can be empty and have a maximum
-   *   length of 63 characters.
-   * * Keys and values can contain only lowercase letters, numeric characters,
-   *   underscores, and dashes. All characters must use UTF-8 encoding, and
-   *   international characters are allowed.
-   * * The key portion of a label must be unique. However, you can use the same
-   *   key with multiple resources.
-   * * Keys must start with a lowercase letter or international character.
-   *
-   * See [Google Cloud
-   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
-   * for more details.
-   * 
- * - * map<string, string> user_labels = 22; - */ + + public static com.google.cloud.discoveryengine.v1.SearchRequest 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 java.lang.String getUserLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetUserLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); + public Builder newBuilderForType() { + return newBuilder(); } - private byte memoizedIsInitialized = -1; + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1.SearchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfig_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, servingConfig_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, branch_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_); - } - if (pageSize_ != 0) { - output.writeInt32(4, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); - } - if (offset_ != 0) { - output.writeInt32(6, offset_); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 11); - if (queryExpansionSpec_ != null) { - output.writeMessage(13, getQueryExpansionSpec()); + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest) + com.google.cloud.discoveryengine.v1.SearchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor; } - if (spellCorrectionSpec_ != null) { - output.writeMessage(14, getSpellCorrectionSpec()); + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 11: + return internalGetParams(); + case 22: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 15, userPseudoId_); + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 11: + return internalGetMutableParams(); + case 22: + return internalGetMutableUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } } - if (safeSearch_ != false) { - output.writeBool(20, safeSearch_); + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchRequest.class, + com.google.cloud.discoveryengine.v1.SearchRequest.Builder.class); } - if (userInfo_ != null) { - output.writeMessage(21, getUserInfo()); + + // Construct using com.google.cloud.discoveryengine.v1.SearchRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 22); - if (contentSearchSpec_ != null) { - output.writeMessage(24, getContentSearchSpec()); + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + servingConfig_ = ""; + branch_ = ""; + query_ = ""; + imageQuery_ = null; + if (imageQueryBuilder_ != null) { + imageQueryBuilder_.dispose(); + imageQueryBuilder_ = null; + } + pageSize_ = 0; + pageToken_ = ""; + offset_ = 0; + filter_ = ""; + orderBy_ = ""; + userInfo_ = null; + if (userInfoBuilder_ != null) { + userInfoBuilder_.dispose(); + userInfoBuilder_ = null; + } + if (facetSpecsBuilder_ == null) { + facetSpecs_ = java.util.Collections.emptyList(); + } else { + facetSpecs_ = null; + facetSpecsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + boostSpec_ = null; + if (boostSpecBuilder_ != null) { + boostSpecBuilder_.dispose(); + boostSpecBuilder_ = null; + } + internalGetMutableParams().clear(); + queryExpansionSpec_ = null; + if (queryExpansionSpecBuilder_ != null) { + queryExpansionSpecBuilder_.dispose(); + queryExpansionSpecBuilder_ = null; + } + spellCorrectionSpec_ = null; + if (spellCorrectionSpecBuilder_ != null) { + spellCorrectionSpecBuilder_.dispose(); + spellCorrectionSpecBuilder_ = null; + } + userPseudoId_ = ""; + contentSearchSpec_ = null; + if (contentSearchSpecBuilder_ != null) { + contentSearchSpecBuilder_.dispose(); + contentSearchSpecBuilder_ = null; + } + safeSearch_ = false; + internalGetMutableUserLabels().clear(); + return this; } - getUnknownFields().writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor; + } - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfig_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, servingConfig_); + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchRequest.getDefaultInstance(); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, branch_); + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest build() { + com.google.cloud.discoveryengine.v1.SearchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, query_); + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchRequest buildPartial() { + com.google.cloud.discoveryengine.v1.SearchRequest result = + new com.google.cloud.discoveryengine.v1.SearchRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1.SearchRequest result) { + if (facetSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + facetSpecs_ = java.util.Collections.unmodifiableList(facetSpecs_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.facetSpecs_ = facetSpecs_; + } else { + result.facetSpecs_ = facetSpecsBuilder_.build(); + } } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); + + private void buildPartial0(com.google.cloud.discoveryengine.v1.SearchRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.servingConfig_ = servingConfig_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.branch_ = branch_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.imageQuery_ = imageQueryBuilder_ == null ? imageQuery_ : imageQueryBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.offset_ = offset_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.orderBy_ = orderBy_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.userInfo_ = userInfoBuilder_ == null ? userInfo_ : userInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.boostSpec_ = boostSpecBuilder_ == null ? boostSpec_ : boostSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.params_ = internalGetParams(); + result.params_.makeImmutable(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.queryExpansionSpec_ = + queryExpansionSpecBuilder_ == null + ? queryExpansionSpec_ + : queryExpansionSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.spellCorrectionSpec_ = + spellCorrectionSpecBuilder_ == null + ? spellCorrectionSpec_ + : spellCorrectionSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.userPseudoId_ = userPseudoId_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.contentSearchSpec_ = + contentSearchSpecBuilder_ == null + ? contentSearchSpec_ + : contentSearchSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.safeSearch_ = safeSearch_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.userLabels_ = internalGetUserLabels(); + result.userLabels_.makeImmutable(); + } } - if (offset_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, offset_); + + @java.lang.Override + public Builder clone() { + return super.clone(); } - for (java.util.Map.Entry entry : - internalGetParams().getMap().entrySet()) { - com.google.protobuf.MapEntry params__ = - ParamsDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, params__); + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); } - if (queryExpansionSpec_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getQueryExpansionSpec()); + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - if (spellCorrectionSpec_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(14, getSpellCorrectionSpec()); + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, userPseudoId_); + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - if (safeSearch_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, safeSearch_); + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); } - if (userInfo_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getUserInfo()); + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1.SearchRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1.SearchRequest) other); + } else { + super.mergeFrom(other); + return this; + } } - for (java.util.Map.Entry entry : - internalGetUserLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry userLabels__ = - UserLabelsDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, userLabels__); + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.SearchRequest other) { + if (other == com.google.cloud.discoveryengine.v1.SearchRequest.getDefaultInstance()) + return this; + if (!other.getServingConfig().isEmpty()) { + servingConfig_ = other.servingConfig_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBranch().isEmpty()) { + branch_ = other.branch_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasImageQuery()) { + mergeImageQuery(other.getImageQuery()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + if (facetSpecsBuilder_ == null) { + if (!other.facetSpecs_.isEmpty()) { + if (facetSpecs_.isEmpty()) { + facetSpecs_ = other.facetSpecs_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureFacetSpecsIsMutable(); + facetSpecs_.addAll(other.facetSpecs_); + } + onChanged(); + } + } else { + if (!other.facetSpecs_.isEmpty()) { + if (facetSpecsBuilder_.isEmpty()) { + facetSpecsBuilder_.dispose(); + facetSpecsBuilder_ = null; + facetSpecs_ = other.facetSpecs_; + bitField0_ = (bitField0_ & ~0x00000400); + facetSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFacetSpecsFieldBuilder() + : null; + } else { + facetSpecsBuilder_.addAllMessages(other.facetSpecs_); + } + } + } + if (other.hasBoostSpec()) { + mergeBoostSpec(other.getBoostSpec()); + } + internalGetMutableParams().mergeFrom(other.internalGetParams()); + bitField0_ |= 0x00001000; + if (other.hasQueryExpansionSpec()) { + mergeQueryExpansionSpec(other.getQueryExpansionSpec()); + } + if (other.hasSpellCorrectionSpec()) { + mergeSpellCorrectionSpec(other.getSpellCorrectionSpec()); + } + if (!other.getUserPseudoId().isEmpty()) { + userPseudoId_ = other.userPseudoId_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (other.hasContentSearchSpec()) { + mergeContentSearchSpec(other.getContentSearchSpec()); + } + if (other.getSafeSearch() != false) { + setSafeSearch(other.getSafeSearch()); + } + internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); + bitField0_ |= 0x00040000; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; } - if (contentSearchSpec_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getContentSearchSpec()); + + @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: + { + servingConfig_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + branch_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 32 + case 42: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 48: + { + offset_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 58: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 66 + case 74: + { + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec m = + input.readMessage( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.parser(), + extensionRegistry); + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.add(m); + } else { + facetSpecsBuilder_.addMessage(m); + } + break; + } // case 74 + case 82: + { + input.readMessage(getBoostSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 90: + { + com.google.protobuf.MapEntry params__ = + input.readMessage( + ParamsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableParams() + .getMutableMap() + .put(params__.getKey(), params__.getValue()); + bitField0_ |= 0x00001000; + break; + } // case 90 + case 106: + { + input.readMessage( + getQueryExpansionSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 106 + case 114: + { + input.readMessage( + getSpellCorrectionSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 114 + case 122: + { + userPseudoId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 122 + case 154: + { + input.readMessage(getImageQueryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 154 + case 160: + { + safeSearch_ = input.readBool(); + bitField0_ |= 0x00020000; + break; + } // case 160 + case 170: + { + input.readMessage(getUserInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 170 + case 178: + { + com.google.protobuf.MapEntry userLabels__ = + input.readMessage( + UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableUserLabels() + .getMutableMap() + .put(userLabels__.getKey(), userLabels__.getValue()); + bitField0_ |= 0x00040000; + break; + } // case 178 + case 194: + { + input.readMessage( + getContentSearchSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 194 + 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; } - 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.discoveryengine.v1.SearchRequest)) { - return super.equals(obj); - } - com.google.cloud.discoveryengine.v1.SearchRequest other = - (com.google.cloud.discoveryengine.v1.SearchRequest) obj; + private int bitField0_; - if (!getServingConfig().equals(other.getServingConfig())) return false; - if (!getBranch().equals(other.getBranch())) return false; - if (!getQuery().equals(other.getQuery())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (getOffset() != other.getOffset()) return false; - if (hasUserInfo() != other.hasUserInfo()) return false; - if (hasUserInfo()) { - if (!getUserInfo().equals(other.getUserInfo())) return false; - } - if (!internalGetParams().equals(other.internalGetParams())) return false; - if (hasQueryExpansionSpec() != other.hasQueryExpansionSpec()) return false; - if (hasQueryExpansionSpec()) { - if (!getQueryExpansionSpec().equals(other.getQueryExpansionSpec())) return false; + private java.lang.Object servingConfig_ = ""; + /** + * + * + *
+     * Required. The resource name of the Search serving config, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+     * This field is used to identify the serving configuration name, set
+     * of models used to make the search.
+     * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The servingConfig. + */ + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + servingConfig_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - if (hasSpellCorrectionSpec() != other.hasSpellCorrectionSpec()) return false; - if (hasSpellCorrectionSpec()) { - if (!getSpellCorrectionSpec().equals(other.getSpellCorrectionSpec())) return false; + /** + * + * + *
+     * Required. The resource name of the Search serving config, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+     * This field is used to identify the serving configuration name, set
+     * of models used to make the search.
+     * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for servingConfig. + */ + public com.google.protobuf.ByteString getServingConfigBytes() { + java.lang.Object ref = servingConfig_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servingConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - if (!getUserPseudoId().equals(other.getUserPseudoId())) return false; - if (hasContentSearchSpec() != other.hasContentSearchSpec()) return false; - if (hasContentSearchSpec()) { - if (!getContentSearchSpec().equals(other.getContentSearchSpec())) return false; + /** + * + * + *
+     * Required. The resource name of the Search serving config, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+     * This field is used to identify the serving configuration name, set
+     * of models used to make the search.
+     * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfig(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + servingConfig_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; } - if (getSafeSearch() != other.getSafeSearch()) return false; - if (!internalGetUserLabels().equals(other.internalGetUserLabels())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + /** + * + * + *
+     * Required. The resource name of the Search serving config, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+     * This field is used to identify the serving configuration name, set
+     * of models used to make the search.
+     * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServingConfig() { + servingConfig_ = getDefaultInstance().getServingConfig(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + SERVING_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getServingConfig().hashCode(); - hash = (37 * hash) + BRANCH_FIELD_NUMBER; - hash = (53 * hash) + getBranch().hashCode(); - hash = (37 * hash) + QUERY_FIELD_NUMBER; - hash = (53 * hash) + getQuery().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (37 * hash) + OFFSET_FIELD_NUMBER; - hash = (53 * hash) + getOffset(); - if (hasUserInfo()) { - hash = (37 * hash) + USER_INFO_FIELD_NUMBER; - hash = (53 * hash) + getUserInfo().hashCode(); + /** + * + * + *
+     * Required. The resource name of the Search serving config, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+     * This field is used to identify the serving configuration name, set
+     * of models used to make the search.
+     * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for servingConfig to set. + * @return This builder for chaining. + */ + public Builder setServingConfigBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + servingConfig_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; } - if (!internalGetParams().getMap().isEmpty()) { - hash = (37 * hash) + PARAMS_FIELD_NUMBER; - hash = (53 * hash) + internalGetParams().hashCode(); + + private java.lang.Object branch_ = ""; + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+     *
+     * Use `default_branch` as the branch ID or leave this field empty, to search
+     * documents under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The branch. + */ + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - if (hasQueryExpansionSpec()) { - hash = (37 * hash) + QUERY_EXPANSION_SPEC_FIELD_NUMBER; - hash = (53 * hash) + getQueryExpansionSpec().hashCode(); + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+     *
+     * Use `default_branch` as the branch ID or leave this field empty, to search
+     * documents under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for branch. + */ + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - if (hasSpellCorrectionSpec()) { - hash = (37 * hash) + SPELL_CORRECTION_SPEC_FIELD_NUMBER; - hash = (53 * hash) + getSpellCorrectionSpec().hashCode(); + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+     *
+     * Use `default_branch` as the branch ID or leave this field empty, to search
+     * documents under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + branch_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; } - hash = (37 * hash) + USER_PSEUDO_ID_FIELD_NUMBER; - hash = (53 * hash) + getUserPseudoId().hashCode(); - if (hasContentSearchSpec()) { - hash = (37 * hash) + CONTENT_SEARCH_SPEC_FIELD_NUMBER; - hash = (53 * hash) + getContentSearchSpec().hashCode(); + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+     *
+     * Use `default_branch` as the branch ID or leave this field empty, to search
+     * documents under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranch() { + branch_ = getDefaultInstance().getBranch(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; } - hash = (37 * hash) + SAFE_SEARCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSafeSearch()); - if (!internalGetUserLabels().getMap().isEmpty()) { - hash = (37 * hash) + USER_LABELS_FIELD_NUMBER; - hash = (53 * hash) + internalGetUserLabels().hashCode(); + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+     *
+     * Use `default_branch` as the branch ID or leave this field empty, to search
+     * documents under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for branch to set. + * @return This builder for chaining. + */ + public Builder setBranchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + branch_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest 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.discoveryengine.v1.SearchRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest 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.discoveryengine.v1.SearchRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest 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.discoveryengine.v1.SearchRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest 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.discoveryengine.v1.SearchRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1.SearchRequest 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.discoveryengine.v1.SearchRequest 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
-   * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-   * method.
-   * 
- * - * Protobuf type {@code google.cloud.discoveryengine.v1.SearchRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchRequest) - com.google.cloud.discoveryengine.v1.SearchRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor; + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 11: - return internalGetParams(); - case 22: - return internalGetUserLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 11: - return internalGetMutableParams(); - case 22: - return internalGetMutableUserLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } + query_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.discoveryengine.v1.SearchRequest.class, - com.google.cloud.discoveryengine.v1.SearchRequest.Builder.class); - } - - // Construct using com.google.cloud.discoveryengine.v1.SearchRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - servingConfig_ = ""; - branch_ = ""; - query_ = ""; - pageSize_ = 0; - pageToken_ = ""; - offset_ = 0; - userInfo_ = null; - if (userInfoBuilder_ != null) { - userInfoBuilder_.dispose(); - userInfoBuilder_ = null; - } - internalGetMutableParams().clear(); - queryExpansionSpec_ = null; - if (queryExpansionSpecBuilder_ != null) { - queryExpansionSpecBuilder_.dispose(); - queryExpansionSpecBuilder_ = null; - } - spellCorrectionSpec_ = null; - if (spellCorrectionSpecBuilder_ != null) { - spellCorrectionSpecBuilder_.dispose(); - spellCorrectionSpecBuilder_ = null; - } - userPseudoId_ = ""; - contentSearchSpec_ = null; - if (contentSearchSpecBuilder_ != null) { - contentSearchSpecBuilder_.dispose(); - contentSearchSpecBuilder_ = null; + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } - safeSearch_ = false; - internalGetMutableUserLabels().clear(); + checkByteStringIsUtf8(value); + query_ = value; + bitField0_ |= 0x00000004; + onChanged(); return this; } - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest getDefaultInstanceForType() { - return com.google.cloud.discoveryengine.v1.SearchRequest.getDefaultInstance(); + private com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery imageQuery_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery, + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQueryOrBuilder> + imageQueryBuilder_; + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + * + * @return Whether the imageQuery field is set. + */ + public boolean hasImageQuery() { + return ((bitField0_ & 0x00000008) != 0); } - - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest build() { - com.google.cloud.discoveryengine.v1.SearchRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + * + * @return The imageQuery. + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery getImageQuery() { + if (imageQueryBuilder_ == null) { + return imageQuery_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.getDefaultInstance() + : imageQuery_; + } else { + return imageQueryBuilder_.getMessage(); } - return result; } - - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchRequest buildPartial() { - com.google.cloud.discoveryengine.v1.SearchRequest result = - new com.google.cloud.discoveryengine.v1.SearchRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + */ + public Builder setImageQuery( + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery value) { + if (imageQueryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + imageQuery_ = value; + } else { + imageQueryBuilder_.setMessage(value); } - onBuilt(); - return result; + bitField0_ |= 0x00000008; + onChanged(); + return this; } - - private void buildPartial0(com.google.cloud.discoveryengine.v1.SearchRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.servingConfig_ = servingConfig_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.branch_ = branch_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.query_ = query_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.pageSize_ = pageSize_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.pageToken_ = pageToken_; - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.offset_ = offset_; - } - if (((from_bitField0_ & 0x00000040) != 0)) { - result.userInfo_ = userInfoBuilder_ == null ? userInfo_ : userInfoBuilder_.build(); - } - if (((from_bitField0_ & 0x00000080) != 0)) { - result.params_ = internalGetParams(); - result.params_.makeImmutable(); - } - if (((from_bitField0_ & 0x00000100) != 0)) { - result.queryExpansionSpec_ = - queryExpansionSpecBuilder_ == null - ? queryExpansionSpec_ - : queryExpansionSpecBuilder_.build(); - } - if (((from_bitField0_ & 0x00000200) != 0)) { - result.spellCorrectionSpec_ = - spellCorrectionSpecBuilder_ == null - ? spellCorrectionSpec_ - : spellCorrectionSpecBuilder_.build(); - } - if (((from_bitField0_ & 0x00000400) != 0)) { - result.userPseudoId_ = userPseudoId_; - } - if (((from_bitField0_ & 0x00000800) != 0)) { - result.contentSearchSpec_ = - contentSearchSpecBuilder_ == null - ? contentSearchSpec_ - : contentSearchSpecBuilder_.build(); - } - if (((from_bitField0_ & 0x00001000) != 0)) { - result.safeSearch_ = safeSearch_; + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + */ + public Builder setImageQuery( + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.Builder builderForValue) { + if (imageQueryBuilder_ == null) { + imageQuery_ = builderForValue.build(); + } else { + imageQueryBuilder_.setMessage(builderForValue.build()); } - if (((from_bitField0_ & 0x00002000) != 0)) { - result.userLabels_ = internalGetUserLabels(); - result.userLabels_.makeImmutable(); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + */ + public Builder mergeImageQuery( + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery value) { + if (imageQueryBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && imageQuery_ != null + && imageQuery_ + != com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery + .getDefaultInstance()) { + getImageQueryBuilder().mergeFrom(value); + } else { + imageQuery_ = value; + } + } else { + imageQueryBuilder_.mergeFrom(value); } + bitField0_ |= 0x00000008; + onChanged(); + return this; } - - @java.lang.Override - public Builder clone() { - return super.clone(); + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + */ + public Builder clearImageQuery() { + bitField0_ = (bitField0_ & ~0x00000008); + imageQuery_ = null; + if (imageQueryBuilder_ != null) { + imageQueryBuilder_.dispose(); + imageQueryBuilder_ = null; + } + onChanged(); + return this; } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.Builder + getImageQueryBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getImageQueryFieldBuilder().getBuilder(); } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.ImageQueryOrBuilder + getImageQueryOrBuilder() { + if (imageQueryBuilder_ != null) { + return imageQueryBuilder_.getMessageOrBuilder(); + } else { + return imageQuery_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.getDefaultInstance() + : imageQuery_; + } } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery, + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQueryOrBuilder> + getImageQueryFieldBuilder() { + if (imageQueryBuilder_ == null) { + imageQueryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery, + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQueryOrBuilder>( + getImageQuery(), getParentForChildren(), isClean()); + imageQuery_ = null; + } + return imageQueryBuilder_; } + private int pageSize_; + /** + * + * + *
+     * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
+     * return. If unspecified, defaults to a reasonable value. The maximum allowed
+     * value is 100. Values above 100 are coerced to 100.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + public int getPageSize() { + return pageSize_; } + /** + * + * + *
+     * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
+     * return. If unspecified, defaults to a reasonable value. The maximum allowed
+     * value is 100. Values above 100 are coerced to 100.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 page_size = 4; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + pageSize_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
+     * return. If unspecified, defaults to a reasonable value. The maximum allowed
+     * value is 100. Values above 100 are coerced to 100.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 page_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000010); + pageSize_ = 0; + onChanged(); + return this; } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.discoveryengine.v1.SearchRequest) { - return mergeFrom((com.google.cloud.discoveryengine.v1.SearchRequest) other); + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token received from a previous
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     *  `INVALID_ARGUMENT`  error is returned.
+     * 
+ * + * string page_token = 5; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; } else { - super.mergeFrom(other); - return this; + return (java.lang.String) ref; } } - - public Builder mergeFrom(com.google.cloud.discoveryengine.v1.SearchRequest other) { - if (other == com.google.cloud.discoveryengine.v1.SearchRequest.getDefaultInstance()) - return this; - if (!other.getServingConfig().isEmpty()) { - servingConfig_ = other.servingConfig_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getBranch().isEmpty()) { - branch_ = other.branch_; - bitField0_ |= 0x00000002; - onChanged(); - } - if (!other.getQuery().isEmpty()) { - query_ = other.query_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - bitField0_ |= 0x00000010; - onChanged(); - } - if (other.getOffset() != 0) { - setOffset(other.getOffset()); - } - if (other.hasUserInfo()) { - mergeUserInfo(other.getUserInfo()); - } - internalGetMutableParams().mergeFrom(other.internalGetParams()); - bitField0_ |= 0x00000080; - if (other.hasQueryExpansionSpec()) { - mergeQueryExpansionSpec(other.getQueryExpansionSpec()); - } - if (other.hasSpellCorrectionSpec()) { - mergeSpellCorrectionSpec(other.getSpellCorrectionSpec()); - } - if (!other.getUserPseudoId().isEmpty()) { - userPseudoId_ = other.userPseudoId_; - bitField0_ |= 0x00000400; - onChanged(); + /** + * + * + *
+     * A page token received from a previous
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     *  `INVALID_ARGUMENT`  error is returned.
+     * 
+ * + * string page_token = 5; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - if (other.hasContentSearchSpec()) { - mergeContentSearchSpec(other.getContentSearchSpec()); + } + /** + * + * + *
+     * A page token received from a previous
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     *  `INVALID_ARGUMENT`  error is returned.
+     * 
+ * + * string page_token = 5; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - if (other.getSafeSearch() != false) { - setSafeSearch(other.getSafeSearch()); + pageToken_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token received from a previous
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     *  `INVALID_ARGUMENT`  error is returned.
+     * 
+ * + * string page_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token received from a previous
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     *  `INVALID_ARGUMENT`  error is returned.
+     * 
+ * + * string page_token = 5; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } - internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); - bitField0_ |= 0x00002000; - this.mergeUnknownFields(other.getUnknownFields()); + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + private int offset_; + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the
+     * [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as
+     * relevant) in search results. This field is only considered if
+     * [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is
+     * unset.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 offset = 6; + * + * @return The offset. + */ @java.lang.Override - public final boolean isInitialized() { - return true; + public int getOffset() { + return offset_; } + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the
+     * [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as
+     * relevant) in search results. This field is only considered if
+     * [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is
+     * unset.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 offset = 6; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { - @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: - { - servingConfig_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - branch_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - query_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 32: - { - pageSize_ = input.readInt32(); - bitField0_ |= 0x00000008; - break; - } // case 32 - case 42: - { - pageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000010; - break; - } // case 42 - case 48: - { - offset_ = input.readInt32(); - bitField0_ |= 0x00000020; - break; - } // case 48 - case 90: - { - com.google.protobuf.MapEntry params__ = - input.readMessage( - ParamsDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableParams() - .getMutableMap() - .put(params__.getKey(), params__.getValue()); - bitField0_ |= 0x00000080; - break; - } // case 90 - case 106: - { - input.readMessage( - getQueryExpansionSpecFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000100; - break; - } // case 106 - case 114: - { - input.readMessage( - getSpellCorrectionSpecFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000200; - break; - } // case 114 - case 122: - { - userPseudoId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000400; - break; - } // case 122 - case 160: - { - safeSearch_ = input.readBool(); - bitField0_ |= 0x00001000; - break; - } // case 160 - case 170: - { - input.readMessage(getUserInfoFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; - break; - } // case 170 - case 178: - { - com.google.protobuf.MapEntry userLabels__ = - input.readMessage( - UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableUserLabels() - .getMutableMap() - .put(userLabels__.getKey(), userLabels__.getValue()); - bitField0_ |= 0x00002000; - break; - } // case 178 - case 194: - { - input.readMessage( - getContentSearchSpecFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000800; - break; - } // case 194 - 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 + offset_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the
+     * [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as
+     * relevant) in search results. This field is only considered if
+     * [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is
+     * unset.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 offset = 6; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + bitField0_ = (bitField0_ & ~0x00000040); + offset_ = 0; + onChanged(); return this; } - private int bitField0_; - - private java.lang.Object servingConfig_ = ""; + private java.lang.Object filter_ = ""; /** * * *
-     * Required. The resource name of the Search serving config, such as
-     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
-     * This field is used to identify the serving configuration name, set
-     * of models used to make the search.
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the documents being filtered. Filter
+     * expression is case-sensitive.
+     *
+     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
      * 
* - * - * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string filter = 7; * - * @return The servingConfig. + * @return The filter. */ - public java.lang.String getServingConfig() { - java.lang.Object ref = servingConfig_; + public java.lang.String getFilter() { + java.lang.Object ref = filter_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - servingConfig_ = s; + filter_ = s; return s; } else { return (java.lang.String) ref; @@ -4963,24 +16081,23 @@ public java.lang.String getServingConfig() { * * *
-     * Required. The resource name of the Search serving config, such as
-     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
-     * This field is used to identify the serving configuration name, set
-     * of models used to make the search.
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the documents being filtered. Filter
+     * expression is case-sensitive.
+     *
+     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
      * 
* - * - * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string filter = 7; * - * @return The bytes for servingConfig. + * @return The bytes for filter. */ - public com.google.protobuf.ByteString getServingConfigBytes() { - java.lang.Object ref = servingConfig_; + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - servingConfig_ = b; + filter_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -4990,25 +16107,24 @@ public com.google.protobuf.ByteString getServingConfigBytes() { * * *
-     * Required. The resource name of the Search serving config, such as
-     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
-     * This field is used to identify the serving configuration name, set
-     * of models used to make the search.
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the documents being filtered. Filter
+     * expression is case-sensitive.
+     *
+     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
      * 
* - * - * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string filter = 7; * - * @param value The servingConfig to set. + * @param value The filter to set. * @return This builder for chaining. */ - public Builder setServingConfig(java.lang.String value) { + public Builder setFilter(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - servingConfig_ = value; - bitField0_ |= 0x00000001; + filter_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -5016,21 +16132,20 @@ public Builder setServingConfig(java.lang.String value) { * * *
-     * Required. The resource name of the Search serving config, such as
-     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
-     * This field is used to identify the serving configuration name, set
-     * of models used to make the search.
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the documents being filtered. Filter
+     * expression is case-sensitive.
+     *
+     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
      * 
* - * - * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string filter = 7; * * @return This builder for chaining. */ - public Builder clearServingConfig() { - servingConfig_ = getDefaultInstance().getServingConfig(); - bitField0_ = (bitField0_ & ~0x00000001); + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); return this; } @@ -5038,52 +16153,52 @@ public Builder clearServingConfig() { * * *
-     * Required. The resource name of the Search serving config, such as
-     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
-     * This field is used to identify the serving configuration name, set
-     * of models used to make the search.
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the documents being filtered. Filter
+     * expression is case-sensitive.
+     *
+     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
      * 
* - * - * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * + * string filter = 7; * - * @param value The bytes for servingConfig to set. + * @param value The bytes for filter to set. * @return This builder for chaining. */ - public Builder setServingConfigBytes(com.google.protobuf.ByteString value) { + public Builder setFilterBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - servingConfig_ = value; - bitField0_ |= 0x00000001; + filter_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } - private java.lang.Object branch_ = ""; + private java.lang.Object orderBy_ = ""; /** * * *
-     * The branch resource name, such as
-     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+     * The order in which documents are returned. Documents can be ordered by
+     * a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
+     * Leave it unset if ordered by relevance. `order_by` expression is
+     * case-sensitive.
      *
-     * Use `default_branch` as the branch ID or leave this field empty, to search
-     * documents under the default branch.
+     * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
      * 
* - * string branch = 2 [(.google.api.resource_reference) = { ... } + * string order_by = 8; * - * @return The branch. + * @return The orderBy. */ - public java.lang.String getBranch() { - java.lang.Object ref = branch_; + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - branch_ = s; + orderBy_ = s; return s; } else { return (java.lang.String) ref; @@ -5093,23 +16208,24 @@ public java.lang.String getBranch() { * * *
-     * The branch resource name, such as
-     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+     * The order in which documents are returned. Documents can be ordered by
+     * a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
+     * Leave it unset if ordered by relevance. `order_by` expression is
+     * case-sensitive.
      *
-     * Use `default_branch` as the branch ID or leave this field empty, to search
-     * documents under the default branch.
+     * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
      * 
* - * string branch = 2 [(.google.api.resource_reference) = { ... } + * string order_by = 8; * - * @return The bytes for branch. + * @return The bytes for orderBy. */ - public com.google.protobuf.ByteString getBranchBytes() { - java.lang.Object ref = branch_; + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - branch_ = b; + orderBy_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -5119,526 +16235,787 @@ public com.google.protobuf.ByteString getBranchBytes() { * * *
-     * The branch resource name, such as
-     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
-     *
-     * Use `default_branch` as the branch ID or leave this field empty, to search
-     * documents under the default branch.
+     * The order in which documents are returned. Documents can be ordered by
+     * a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
+     * Leave it unset if ordered by relevance. `order_by` expression is
+     * case-sensitive.
+     *
+     * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+     * 
+ * + * string order_by = 8; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which documents are returned. Documents can be ordered by
+     * a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
+     * Leave it unset if ordered by relevance. `order_by` expression is
+     * case-sensitive.
+     *
+     * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+     * 
+ * + * string order_by = 8; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which documents are returned. Documents can be ordered by
+     * a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
+     * Leave it unset if ordered by relevance. `order_by` expression is
+     * case-sensitive.
+     *
+     * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+     * 
+ * + * string order_by = 8; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1.UserInfo userInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.UserInfo, + com.google.cloud.discoveryengine.v1.UserInfo.Builder, + com.google.cloud.discoveryengine.v1.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * + * @return The userInfo. + */ + public com.google.cloud.discoveryengine.v1.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + */ + public Builder setUserInfo(com.google.cloud.discoveryengine.v1.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + } else { + userInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + */ + public Builder setUserInfo( + com.google.cloud.discoveryengine.v1.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + */ + public Builder mergeUserInfo(com.google.cloud.discoveryengine.v1.UserInfo value) { + if (userInfoBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && userInfo_ != null + && userInfo_ != com.google.cloud.discoveryengine.v1.UserInfo.getDefaultInstance()) { + getUserInfoBuilder().mergeFrom(value); + } else { + userInfo_ = value; + } + } else { + userInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + */ + public Builder clearUserInfo() { + bitField0_ = (bitField0_ & ~0x00000200); + userInfo_ = null; + if (userInfoBuilder_ != null) { + userInfoBuilder_.dispose(); + userInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
      * 
* - * string branch = 2 [(.google.api.resource_reference) = { ... } - * - * @param value The branch to set. - * @return This builder for chaining. + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; */ - public Builder setBranch(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - branch_ = value; - bitField0_ |= 0x00000002; + public com.google.cloud.discoveryengine.v1.UserInfo.Builder getUserInfoBuilder() { + bitField0_ |= 0x00000200; onChanged(); - return this; + return getUserInfoFieldBuilder().getBuilder(); } /** * * *
-     * The branch resource name, such as
-     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
-     *
-     * Use `default_branch` as the branch ID or leave this field empty, to search
-     * documents under the default branch.
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
      * 
* - * string branch = 2 [(.google.api.resource_reference) = { ... } - * - * @return This builder for chaining. + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; */ - public Builder clearBranch() { - branch_ = getDefaultInstance().getBranch(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; + public com.google.cloud.discoveryengine.v1.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1.UserInfo.getDefaultInstance() + : userInfo_; + } } /** * * *
-     * The branch resource name, such as
-     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
-     *
-     * Use `default_branch` as the branch ID or leave this field empty, to search
-     * documents under the default branch.
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
      * 
* - * string branch = 2 [(.google.api.resource_reference) = { ... } - * - * @param value The bytes for branch to set. - * @return This builder for chaining. + * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; */ - public Builder setBranchBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.UserInfo, + com.google.cloud.discoveryengine.v1.UserInfo.Builder, + com.google.cloud.discoveryengine.v1.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.UserInfo, + com.google.cloud.discoveryengine.v1.UserInfo.Builder, + com.google.cloud.discoveryengine.v1.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; } - checkByteStringIsUtf8(value); - branch_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; + return userInfoBuilder_; } - private java.lang.Object query_ = ""; + private java.util.List + facetSpecs_ = java.util.Collections.emptyList(); + + private void ensureFacetSpecsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + facetSpecs_ = + new java.util.ArrayList( + facetSpecs_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpecOrBuilder> + facetSpecsBuilder_; + /** * * *
-     * Raw search query.
-     * 
+ * Facet specifications for faceted search. If empty, no facets are returned. * - * string query = 3; + * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` + * error is returned. + * * - * @return The query. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public java.lang.String getQuery() { - java.lang.Object ref = query_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - query_ = s; - return s; + public java.util.List + getFacetSpecsList() { + if (facetSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(facetSpecs_); } else { - return (java.lang.String) ref; + return facetSpecsBuilder_.getMessageList(); } } /** * * *
-     * Raw search query.
-     * 
+ * Facet specifications for faceted search. If empty, no facets are returned. * - * string query = 3; + * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` + * error is returned. + * * - * @return The bytes for query. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public com.google.protobuf.ByteString getQueryBytes() { - java.lang.Object ref = query_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - query_ = b; - return b; + public int getFacetSpecsCount() { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.size(); } else { - return (com.google.protobuf.ByteString) ref; + return facetSpecsBuilder_.getCount(); } } /** * * *
-     * Raw search query.
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * string query = 3; + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec getFacetSpecs(int index) { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.get(index); + } else { + return facetSpecsBuilder_.getMessage(index); + } + } + /** * - * @param value The query to set. - * @return This builder for chaining. + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public Builder setQuery(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder setFacetSpecs( + int index, com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.set(index, value); + onChanged(); + } else { + facetSpecsBuilder_.setMessage(index, value); } - query_ = value; - bitField0_ |= 0x00000004; - onChanged(); return this; } /** * * *
-     * Raw search query.
-     * 
+ * Facet specifications for faceted search. If empty, no facets are returned. * - * string query = 3; + * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` + * error is returned. + * * - * @return This builder for chaining. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public Builder clearQuery() { - query_ = getDefaultInstance().getQuery(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); + public Builder setFacetSpecs( + int index, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.set(index, builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.setMessage(index, builderForValue.build()); + } return this; } /** * * *
-     * Raw search query.
-     * 
+ * Facet specifications for faceted search. If empty, no facets are returned. * - * string query = 3; + * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` + * error is returned. + * * - * @param value The bytes for query to set. - * @return This builder for chaining. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public Builder setQueryBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder addFacetSpecs( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.add(value); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(value); } - checkByteStringIsUtf8(value); - query_ = value; - bitField0_ |= 0x00000004; - onChanged(); return this; } - - private int pageSize_; /** * * *
-     * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
-     * return. If unspecified, defaults to a reasonable value. The maximum allowed
-     * value is 100. Values above 100 will be coerced to 100.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * int32 page_size = 4; - * - * @return The pageSize. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - @java.lang.Override - public int getPageSize() { - return pageSize_; + public Builder addFacetSpecs( + int index, com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec value) { + if (facetSpecsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFacetSpecsIsMutable(); + facetSpecs_.add(index, value); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(index, value); + } + return this; } /** * * *
-     * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
-     * return. If unspecified, defaults to a reasonable value. The maximum allowed
-     * value is 100. Values above 100 will be coerced to 100.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * int32 page_size = 4; - * - * @param value The pageSize to set. - * @return This builder for chaining. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public Builder setPageSize(int value) { - - pageSize_ = value; - bitField0_ |= 0x00000008; - onChanged(); + public Builder addFacetSpecs( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.add(builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(builderForValue.build()); + } return this; } /** * * *
-     * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
-     * return. If unspecified, defaults to a reasonable value. The maximum allowed
-     * value is 100. Values above 100 will be coerced to 100.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * int32 page_size = 4; - * - * @return This builder for chaining. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public Builder clearPageSize() { - bitField0_ = (bitField0_ & ~0x00000008); - pageSize_ = 0; - onChanged(); + public Builder addFacetSpecs( + int index, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder builderForValue) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.add(index, builderForValue.build()); + onChanged(); + } else { + facetSpecsBuilder_.addMessage(index, builderForValue.build()); + } return this; } - - private java.lang.Object pageToken_ = ""; /** * * *
-     * A page token received from a previous
-     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-     * call. Provide this to retrieve the subsequent page.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * When paginating, all other parameters provided to
-     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-     * must match the call that provided the page token. Otherwise, an
-     *  `INVALID_ARGUMENT`  error is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * string page_token = 5; - * - * @return The pageToken. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; + public Builder addAllFacetSpecs( + java.lang.Iterable + values) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facetSpecs_); + onChanged(); } else { - return (java.lang.String) ref; + facetSpecsBuilder_.addAllMessages(values); } + return this; } /** * * *
-     * A page token received from a previous
-     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-     * call. Provide this to retrieve the subsequent page.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * When paginating, all other parameters provided to
-     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-     * must match the call that provided the page token. Otherwise, an
-     *  `INVALID_ARGUMENT`  error is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * string page_token = 5; - * - * @return The bytes for pageToken. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; + public Builder clearFacetSpecs() { + if (facetSpecsBuilder_ == null) { + facetSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + facetSpecsBuilder_.clear(); } + return this; } /** * * *
-     * A page token received from a previous
-     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-     * call. Provide this to retrieve the subsequent page.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * When paginating, all other parameters provided to
-     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-     * must match the call that provided the page token. Otherwise, an
-     *  `INVALID_ARGUMENT`  error is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * string page_token = 5; - * - * @param value The pageToken to set. - * @return This builder for chaining. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public Builder setPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder removeFacetSpecs(int index) { + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.remove(index); + onChanged(); + } else { + facetSpecsBuilder_.remove(index); } - pageToken_ = value; - bitField0_ |= 0x00000010; - onChanged(); return this; } /** * * *
-     * A page token received from a previous
-     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-     * call. Provide this to retrieve the subsequent page.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * When paginating, all other parameters provided to
-     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-     * must match the call that provided the page token. Otherwise, an
-     *  `INVALID_ARGUMENT`  error is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * string page_token = 5; - * - * @return This builder for chaining. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder getFacetSpecsBuilder( + int index) { + return getFacetSpecsFieldBuilder().getBuilder(index); } /** * * *
-     * A page token received from a previous
-     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-     * call. Provide this to retrieve the subsequent page.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * When paginating, all other parameters provided to
-     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
-     * must match the call that provided the page token. Otherwise, an
-     *  `INVALID_ARGUMENT`  error is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * string page_token = 5; - * - * @param value The bytes for pageToken to set. - * @return This builder for chaining. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpecOrBuilder + getFacetSpecsOrBuilder(int index) { + if (facetSpecsBuilder_ == null) { + return facetSpecs_.get(index); + } else { + return facetSpecsBuilder_.getMessageOrBuilder(index); } - checkByteStringIsUtf8(value); - pageToken_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; } - - private int offset_; /** * * *
-     * A 0-indexed integer that specifies the current offset (that is, starting
-     * result location, amongst the
-     * [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as
-     * relevant) in search results. This field is only considered if
-     * [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is
-     * unset.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * int32 offset = 6; - * - * @return The offset. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - @java.lang.Override - public int getOffset() { - return offset_; + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpecOrBuilder> + getFacetSpecsOrBuilderList() { + if (facetSpecsBuilder_ != null) { + return facetSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(facetSpecs_); + } } /** * * *
-     * A 0-indexed integer that specifies the current offset (that is, starting
-     * result location, amongst the
-     * [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as
-     * relevant) in search results. This field is only considered if
-     * [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is
-     * unset.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * int32 offset = 6; - * - * @param value The offset to set. - * @return This builder for chaining. + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public Builder setOffset(int value) { - - offset_ = value; - bitField0_ |= 0x00000020; - onChanged(); - return this; + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder + addFacetSpecsBuilder() { + return getFacetSpecsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.getDefaultInstance()); } /** * * *
-     * A 0-indexed integer that specifies the current offset (that is, starting
-     * result location, amongst the
-     * [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as
-     * relevant) in search results. This field is only considered if
-     * [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is
-     * unset.
+     * Facet specifications for faceted search. If empty, no facets are returned.
      *
-     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
      * 
* - * int32 offset = 6; + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder addFacetSpecsBuilder( + int index) { + return getFacetSpecsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.getDefaultInstance()); + } + /** * - * @return This builder for chaining. + * + *
+     * Facet specifications for faceted search. If empty, no facets are returned.
+     *
+     * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+     * error is returned.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + * */ - public Builder clearOffset() { - bitField0_ = (bitField0_ & ~0x00000020); - offset_ = 0; - onChanged(); - return this; + public java.util.List + getFacetSpecsBuilderList() { + return getFacetSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpecOrBuilder> + getFacetSpecsFieldBuilder() { + if (facetSpecsBuilder_ == null) { + facetSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpecOrBuilder>( + facetSpecs_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); + facetSpecs_ = null; + } + return facetSpecsBuilder_; } - private com.google.cloud.discoveryengine.v1.UserInfo userInfo_; + private com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boostSpec_; private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.discoveryengine.v1.UserInfo, - com.google.cloud.discoveryengine.v1.UserInfo.Builder, - com.google.cloud.discoveryengine.v1.UserInfoOrBuilder> - userInfoBuilder_; + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecOrBuilder> + boostSpecBuilder_; /** * * *
-     * Information about the end user.
-     * Highly recommended for analytics. The user_agent string in UserInfo will
-     * be used to deduce device_type for analytics.
+     * Boost specification to boost certain documents.
      * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; * - * @return Whether the userInfo field is set. + * @return Whether the boostSpec field is set. */ - public boolean hasUserInfo() { - return ((bitField0_ & 0x00000040) != 0); + public boolean hasBoostSpec() { + return ((bitField0_ & 0x00000800) != 0); } /** * * *
-     * Information about the end user.
-     * Highly recommended for analytics. The user_agent string in UserInfo will
-     * be used to deduce device_type for analytics.
+     * Boost specification to boost certain documents.
      * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; * - * @return The userInfo. + * @return The boostSpec. */ - public com.google.cloud.discoveryengine.v1.UserInfo getUserInfo() { - if (userInfoBuilder_ == null) { - return userInfo_ == null - ? com.google.cloud.discoveryengine.v1.UserInfo.getDefaultInstance() - : userInfo_; + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec getBoostSpec() { + if (boostSpecBuilder_ == null) { + return boostSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; } else { - return userInfoBuilder_.getMessage(); + return boostSpecBuilder_.getMessage(); } } /** * * *
-     * Information about the end user.
-     * Highly recommended for analytics. The user_agent string in UserInfo will
-     * be used to deduce device_type for analytics.
+     * Boost specification to boost certain documents.
      * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; */ - public Builder setUserInfo(com.google.cloud.discoveryengine.v1.UserInfo value) { - if (userInfoBuilder_ == null) { + public Builder setBoostSpec(com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec value) { + if (boostSpecBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - userInfo_ = value; + boostSpec_ = value; } else { - userInfoBuilder_.setMessage(value); + boostSpecBuilder_.setMessage(value); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000800; onChanged(); return this; } @@ -5646,21 +17023,19 @@ public Builder setUserInfo(com.google.cloud.discoveryengine.v1.UserInfo value) { * * *
-     * Information about the end user.
-     * Highly recommended for analytics. The user_agent string in UserInfo will
-     * be used to deduce device_type for analytics.
+     * Boost specification to boost certain documents.
      * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; */ - public Builder setUserInfo( - com.google.cloud.discoveryengine.v1.UserInfo.Builder builderForValue) { - if (userInfoBuilder_ == null) { - userInfo_ = builderForValue.build(); + public Builder setBoostSpec( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.Builder builderForValue) { + if (boostSpecBuilder_ == null) { + boostSpec_ = builderForValue.build(); } else { - userInfoBuilder_.setMessage(builderForValue.build()); + boostSpecBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000800; onChanged(); return this; } @@ -5668,26 +17043,27 @@ public Builder setUserInfo( * * *
-     * Information about the end user.
-     * Highly recommended for analytics. The user_agent string in UserInfo will
-     * be used to deduce device_type for analytics.
+     * Boost specification to boost certain documents.
      * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; */ - public Builder mergeUserInfo(com.google.cloud.discoveryengine.v1.UserInfo value) { - if (userInfoBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) - && userInfo_ != null - && userInfo_ != com.google.cloud.discoveryengine.v1.UserInfo.getDefaultInstance()) { - getUserInfoBuilder().mergeFrom(value); + public Builder mergeBoostSpec( + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec value) { + if (boostSpecBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && boostSpec_ != null + && boostSpec_ + != com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec + .getDefaultInstance()) { + getBoostSpecBuilder().mergeFrom(value); } else { - userInfo_ = value; + boostSpec_ = value; } } else { - userInfoBuilder_.mergeFrom(value); + boostSpecBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000800; onChanged(); return this; } @@ -5695,19 +17071,17 @@ public Builder mergeUserInfo(com.google.cloud.discoveryengine.v1.UserInfo value) * * *
-     * Information about the end user.
-     * Highly recommended for analytics. The user_agent string in UserInfo will
-     * be used to deduce device_type for analytics.
+     * Boost specification to boost certain documents.
      * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; */ - public Builder clearUserInfo() { - bitField0_ = (bitField0_ & ~0x00000040); - userInfo_ = null; - if (userInfoBuilder_ != null) { - userInfoBuilder_.dispose(); - userInfoBuilder_ = null; + public Builder clearBoostSpec() { + bitField0_ = (bitField0_ & ~0x00000800); + boostSpec_ = null; + if (boostSpecBuilder_ != null) { + boostSpecBuilder_.dispose(); + boostSpecBuilder_ = null; } onChanged(); return this; @@ -5716,64 +17090,60 @@ public Builder clearUserInfo() { * * *
-     * Information about the end user.
-     * Highly recommended for analytics. The user_agent string in UserInfo will
-     * be used to deduce device_type for analytics.
+     * Boost specification to boost certain documents.
      * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; */ - public com.google.cloud.discoveryengine.v1.UserInfo.Builder getUserInfoBuilder() { - bitField0_ |= 0x00000040; + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.Builder + getBoostSpecBuilder() { + bitField0_ |= 0x00000800; onChanged(); - return getUserInfoFieldBuilder().getBuilder(); + return getBoostSpecFieldBuilder().getBuilder(); } /** * * *
-     * Information about the end user.
-     * Highly recommended for analytics. The user_agent string in UserInfo will
-     * be used to deduce device_type for analytics.
+     * Boost specification to boost certain documents.
      * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; */ - public com.google.cloud.discoveryengine.v1.UserInfoOrBuilder getUserInfoOrBuilder() { - if (userInfoBuilder_ != null) { - return userInfoBuilder_.getMessageOrBuilder(); + public com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecOrBuilder + getBoostSpecOrBuilder() { + if (boostSpecBuilder_ != null) { + return boostSpecBuilder_.getMessageOrBuilder(); } else { - return userInfo_ == null - ? com.google.cloud.discoveryengine.v1.UserInfo.getDefaultInstance() - : userInfo_; + return boostSpec_ == null + ? com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; } } /** * * *
-     * Information about the end user.
-     * Highly recommended for analytics. The user_agent string in UserInfo will
-     * be used to deduce device_type for analytics.
+     * Boost specification to boost certain documents.
      * 
* - * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; */ private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.discoveryengine.v1.UserInfo, - com.google.cloud.discoveryengine.v1.UserInfo.Builder, - com.google.cloud.discoveryengine.v1.UserInfoOrBuilder> - getUserInfoFieldBuilder() { - if (userInfoBuilder_ == null) { - userInfoBuilder_ = + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecOrBuilder> + getBoostSpecFieldBuilder() { + if (boostSpecBuilder_ == null) { + boostSpecBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.discoveryengine.v1.UserInfo, - com.google.cloud.discoveryengine.v1.UserInfo.Builder, - com.google.cloud.discoveryengine.v1.UserInfoOrBuilder>( - getUserInfo(), getParentForChildren(), isClean()); - userInfo_ = null; + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.Builder, + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecOrBuilder>( + getBoostSpec(), getParentForChildren(), isClean()); + boostSpec_ = null; } - return userInfoBuilder_; + return boostSpecBuilder_; } private com.google.protobuf.MapField params_; @@ -5794,7 +17164,7 @@ public com.google.cloud.discoveryengine.v1.UserInfoOrBuilder getUserInfoOrBuilde if (!params_.isMutable()) { params_ = params_.copy(); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00001000; onChanged(); return params_; } @@ -5911,7 +17281,7 @@ public com.google.protobuf.Value getParamsOrThrow(java.lang.String key) { } public Builder clearParams() { - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00001000); internalGetMutableParams().getMutableMap().clear(); return this; } @@ -5942,7 +17312,7 @@ public Builder removeParams(java.lang.String key) { /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableParams() { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00001000; return internalGetMutableParams().getMutableMap(); } /** @@ -5970,7 +17340,7 @@ public Builder putParams(java.lang.String key, com.google.protobuf.Value value) throw new NullPointerException("map value"); } internalGetMutableParams().getMutableMap().put(key, value); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00001000; return this; } /** @@ -5992,7 +17362,7 @@ public Builder putParams(java.lang.String key, com.google.protobuf.Value value) */ public Builder putAllParams(java.util.Map values) { internalGetMutableParams().getMutableMap().putAll(values); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00001000; return this; } @@ -6008,7 +17378,7 @@ public Builder putAllParams(java.util.Map * The query expansion specification that specifies the conditions under which - * query expansion will occur. + * query expansion occurs. * * * @@ -6018,14 +17388,14 @@ public Builder putAllParams(java.util.Map * The query expansion specification that specifies the conditions under which - * query expansion will occur. + * query expansion occurs. * * * @@ -6050,7 +17420,7 @@ public boolean hasQueryExpansionSpec() { * *
      * The query expansion specification that specifies the conditions under which
-     * query expansion will occur.
+     * query expansion occurs.
      * 
* * @@ -6067,7 +17437,7 @@ public Builder setQueryExpansionSpec( } else { queryExpansionSpecBuilder_.setMessage(value); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -6076,7 +17446,7 @@ public Builder setQueryExpansionSpec( * *
      * The query expansion specification that specifies the conditions under which
-     * query expansion will occur.
+     * query expansion occurs.
      * 
* * @@ -6091,7 +17461,7 @@ public Builder setQueryExpansionSpec( } else { queryExpansionSpecBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -6100,7 +17470,7 @@ public Builder setQueryExpansionSpec( * *
      * The query expansion specification that specifies the conditions under which
-     * query expansion will occur.
+     * query expansion occurs.
      * 
* * @@ -6110,7 +17480,7 @@ public Builder setQueryExpansionSpec( public Builder mergeQueryExpansionSpec( com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec value) { if (queryExpansionSpecBuilder_ == null) { - if (((bitField0_ & 0x00000100) != 0) + if (((bitField0_ & 0x00002000) != 0) && queryExpansionSpec_ != null && queryExpansionSpec_ != com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec @@ -6122,7 +17492,7 @@ public Builder mergeQueryExpansionSpec( } else { queryExpansionSpecBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -6131,7 +17501,7 @@ public Builder mergeQueryExpansionSpec( * *
      * The query expansion specification that specifies the conditions under which
-     * query expansion will occur.
+     * query expansion occurs.
      * 
* * @@ -6139,7 +17509,7 @@ public Builder mergeQueryExpansionSpec( * */ public Builder clearQueryExpansionSpec() { - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00002000); queryExpansionSpec_ = null; if (queryExpansionSpecBuilder_ != null) { queryExpansionSpecBuilder_.dispose(); @@ -6153,7 +17523,7 @@ public Builder clearQueryExpansionSpec() { * *
      * The query expansion specification that specifies the conditions under which
-     * query expansion will occur.
+     * query expansion occurs.
      * 
* * @@ -6162,7 +17532,7 @@ public Builder clearQueryExpansionSpec() { */ public com.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Builder getQueryExpansionSpecBuilder() { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00002000; onChanged(); return getQueryExpansionSpecFieldBuilder().getBuilder(); } @@ -6171,7 +17541,7 @@ public Builder clearQueryExpansionSpec() { * *
      * The query expansion specification that specifies the conditions under which
-     * query expansion will occur.
+     * query expansion occurs.
      * 
* * @@ -6194,7 +17564,7 @@ public Builder clearQueryExpansionSpec() { * *
      * The query expansion specification that specifies the conditions under which
-     * query expansion will occur.
+     * query expansion occurs.
      * 
* * @@ -6230,7 +17600,7 @@ public Builder clearQueryExpansionSpec() { * *
      * The spell correction specification that specifies the mode under
-     * which spell correction will take effect.
+     * which spell correction takes effect.
      * 
* * @@ -6240,14 +17610,14 @@ public Builder clearQueryExpansionSpec() { * @return Whether the spellCorrectionSpec field is set. */ public boolean hasSpellCorrectionSpec() { - return ((bitField0_ & 0x00000200) != 0); + return ((bitField0_ & 0x00004000) != 0); } /** * * *
      * The spell correction specification that specifies the mode under
-     * which spell correction will take effect.
+     * which spell correction takes effect.
      * 
* * @@ -6272,7 +17642,7 @@ public boolean hasSpellCorrectionSpec() { * *
      * The spell correction specification that specifies the mode under
-     * which spell correction will take effect.
+     * which spell correction takes effect.
      * 
* * @@ -6289,7 +17659,7 @@ public Builder setSpellCorrectionSpec( } else { spellCorrectionSpecBuilder_.setMessage(value); } - bitField0_ |= 0x00000200; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -6298,7 +17668,7 @@ public Builder setSpellCorrectionSpec( * *
      * The spell correction specification that specifies the mode under
-     * which spell correction will take effect.
+     * which spell correction takes effect.
      * 
* * @@ -6313,7 +17683,7 @@ public Builder setSpellCorrectionSpec( } else { spellCorrectionSpecBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000200; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -6322,7 +17692,7 @@ public Builder setSpellCorrectionSpec( * *
      * The spell correction specification that specifies the mode under
-     * which spell correction will take effect.
+     * which spell correction takes effect.
      * 
* * @@ -6332,7 +17702,7 @@ public Builder setSpellCorrectionSpec( public Builder mergeSpellCorrectionSpec( com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec value) { if (spellCorrectionSpecBuilder_ == null) { - if (((bitField0_ & 0x00000200) != 0) + if (((bitField0_ & 0x00004000) != 0) && spellCorrectionSpec_ != null && spellCorrectionSpec_ != com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec @@ -6344,7 +17714,7 @@ public Builder mergeSpellCorrectionSpec( } else { spellCorrectionSpecBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000200; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -6353,7 +17723,7 @@ public Builder mergeSpellCorrectionSpec( * *
      * The spell correction specification that specifies the mode under
-     * which spell correction will take effect.
+     * which spell correction takes effect.
      * 
* * @@ -6361,7 +17731,7 @@ public Builder mergeSpellCorrectionSpec( * */ public Builder clearSpellCorrectionSpec() { - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00004000); spellCorrectionSpec_ = null; if (spellCorrectionSpecBuilder_ != null) { spellCorrectionSpecBuilder_.dispose(); @@ -6375,7 +17745,7 @@ public Builder clearSpellCorrectionSpec() { * *
      * The spell correction specification that specifies the mode under
-     * which spell correction will take effect.
+     * which spell correction takes effect.
      * 
* * @@ -6384,7 +17754,7 @@ public Builder clearSpellCorrectionSpec() { */ public com.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Builder getSpellCorrectionSpecBuilder() { - bitField0_ |= 0x00000200; + bitField0_ |= 0x00004000; onChanged(); return getSpellCorrectionSpecFieldBuilder().getBuilder(); } @@ -6393,7 +17763,7 @@ public Builder clearSpellCorrectionSpec() { * *
      * The spell correction specification that specifies the mode under
-     * which spell correction will take effect.
+     * which spell correction takes effect.
      * 
* * @@ -6416,7 +17786,7 @@ public Builder clearSpellCorrectionSpec() { * *
      * The spell correction specification that specifies the mode under
-     * which spell correction will take effect.
+     * which spell correction takes effect.
      * 
* * @@ -6541,7 +17911,7 @@ public Builder setUserPseudoId(java.lang.String value) { throw new NullPointerException(); } userPseudoId_ = value; - bitField0_ |= 0x00000400; + bitField0_ |= 0x00008000; onChanged(); return this; } @@ -6571,7 +17941,7 @@ public Builder setUserPseudoId(java.lang.String value) { */ public Builder clearUserPseudoId() { userPseudoId_ = getDefaultInstance().getUserPseudoId(); - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00008000); onChanged(); return this; } @@ -6606,7 +17976,7 @@ public Builder setUserPseudoIdBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); userPseudoId_ = value; - bitField0_ |= 0x00000400; + bitField0_ |= 0x00008000; onChanged(); return this; } @@ -6621,8 +17991,7 @@ public Builder setUserPseudoIdBytes(com.google.protobuf.ByteString value) { * * *
-     * The content search spec that configs the desired behavior of content
-     * search.
+     * A specification for configuring the behavior of content search.
      * 
* * @@ -6632,14 +18001,13 @@ public Builder setUserPseudoIdBytes(com.google.protobuf.ByteString value) { * @return Whether the contentSearchSpec field is set. */ public boolean hasContentSearchSpec() { - return ((bitField0_ & 0x00000800) != 0); + return ((bitField0_ & 0x00010000) != 0); } /** * * *
-     * The content search spec that configs the desired behavior of content
-     * search.
+     * A specification for configuring the behavior of content search.
      * 
* * @@ -6663,8 +18031,7 @@ public boolean hasContentSearchSpec() { * * *
-     * The content search spec that configs the desired behavior of content
-     * search.
+     * A specification for configuring the behavior of content search.
      * 
* * @@ -6681,7 +18048,7 @@ public Builder setContentSearchSpec( } else { contentSearchSpecBuilder_.setMessage(value); } - bitField0_ |= 0x00000800; + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -6689,8 +18056,7 @@ public Builder setContentSearchSpec( * * *
-     * The content search spec that configs the desired behavior of content
-     * search.
+     * A specification for configuring the behavior of content search.
      * 
* * @@ -6705,7 +18071,7 @@ public Builder setContentSearchSpec( } else { contentSearchSpecBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000800; + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -6713,8 +18079,7 @@ public Builder setContentSearchSpec( * * *
-     * The content search spec that configs the desired behavior of content
-     * search.
+     * A specification for configuring the behavior of content search.
      * 
* * @@ -6724,7 +18089,7 @@ public Builder setContentSearchSpec( public Builder mergeContentSearchSpec( com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec value) { if (contentSearchSpecBuilder_ == null) { - if (((bitField0_ & 0x00000800) != 0) + if (((bitField0_ & 0x00010000) != 0) && contentSearchSpec_ != null && contentSearchSpec_ != com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec @@ -6736,7 +18101,7 @@ public Builder mergeContentSearchSpec( } else { contentSearchSpecBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000800; + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -6744,8 +18109,7 @@ public Builder mergeContentSearchSpec( * * *
-     * The content search spec that configs the desired behavior of content
-     * search.
+     * A specification for configuring the behavior of content search.
      * 
* * @@ -6753,7 +18117,7 @@ public Builder mergeContentSearchSpec( * */ public Builder clearContentSearchSpec() { - bitField0_ = (bitField0_ & ~0x00000800); + bitField0_ = (bitField0_ & ~0x00010000); contentSearchSpec_ = null; if (contentSearchSpecBuilder_ != null) { contentSearchSpecBuilder_.dispose(); @@ -6766,8 +18130,7 @@ public Builder clearContentSearchSpec() { * * *
-     * The content search spec that configs the desired behavior of content
-     * search.
+     * A specification for configuring the behavior of content search.
      * 
* * @@ -6776,7 +18139,7 @@ public Builder clearContentSearchSpec() { */ public com.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.Builder getContentSearchSpecBuilder() { - bitField0_ |= 0x00000800; + bitField0_ |= 0x00010000; onChanged(); return getContentSearchSpecFieldBuilder().getBuilder(); } @@ -6784,8 +18147,7 @@ public Builder clearContentSearchSpec() { * * *
-     * The content search spec that configs the desired behavior of content
-     * search.
+     * A specification for configuring the behavior of content search.
      * 
* * @@ -6807,8 +18169,7 @@ public Builder clearContentSearchSpec() { * * *
-     * The content search spec that configs the desired behavior of content
-     * search.
+     * A specification for configuring the behavior of content search.
      * 
* * @@ -6838,7 +18199,7 @@ public Builder clearContentSearchSpec() { * *
      * Whether to turn on safe search. This is only supported for
-     * [ContentConfig.PUBLIC_WEBSITE][].
+     * website search.
      * 
* * bool safe_search = 20; @@ -6854,7 +18215,7 @@ public boolean getSafeSearch() { * *
      * Whether to turn on safe search. This is only supported for
-     * [ContentConfig.PUBLIC_WEBSITE][].
+     * website search.
      * 
* * bool safe_search = 20; @@ -6865,7 +18226,7 @@ public boolean getSafeSearch() { public Builder setSafeSearch(boolean value) { safeSearch_ = value; - bitField0_ |= 0x00001000; + bitField0_ |= 0x00020000; onChanged(); return this; } @@ -6874,7 +18235,7 @@ public Builder setSafeSearch(boolean value) { * *
      * Whether to turn on safe search. This is only supported for
-     * [ContentConfig.PUBLIC_WEBSITE][].
+     * website search.
      * 
* * bool safe_search = 20; @@ -6882,7 +18243,7 @@ public Builder setSafeSearch(boolean value) { * @return This builder for chaining. */ public Builder clearSafeSearch() { - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00020000); safeSearch_ = false; onChanged(); return this; @@ -6908,7 +18269,7 @@ public Builder clearSafeSearch() { if (!userLabels_.isMutable()) { userLabels_ = userLabels_.copy(); } - bitField0_ |= 0x00002000; + bitField0_ |= 0x00040000; onChanged(); return userLabels_; } @@ -7057,7 +18418,7 @@ public java.lang.String getUserLabelsOrThrow(java.lang.String key) { } public Builder clearUserLabels() { - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00040000); internalGetMutableUserLabels().getMutableMap().clear(); return this; } @@ -7096,7 +18457,7 @@ public Builder removeUserLabels(java.lang.String key) { /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableUserLabels() { - bitField0_ |= 0x00002000; + bitField0_ |= 0x00040000; return internalGetMutableUserLabels().getMutableMap(); } /** @@ -7132,7 +18493,7 @@ public Builder putUserLabels(java.lang.String key, java.lang.String value) { throw new NullPointerException("map value"); } internalGetMutableUserLabels().getMutableMap().put(key, value); - bitField0_ |= 0x00002000; + bitField0_ |= 0x00040000; return this; } /** @@ -7162,7 +18523,7 @@ public Builder putUserLabels(java.lang.String key, java.lang.String value) { */ public Builder putAllUserLabels(java.util.Map values) { internalGetMutableUserLabels().getMutableMap().putAll(values); - bitField0_ |= 0x00002000; + bitField0_ |= 0x00040000; return this; } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchRequestOrBuilder.java index ed77cf0ff603..2fdad7e1287a 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchRequestOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchRequestOrBuilder.java @@ -116,13 +116,48 @@ public interface SearchRequestOrBuilder */ com.google.protobuf.ByteString getQueryBytes(); + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + * + * @return Whether the imageQuery field is set. + */ + boolean hasImageQuery(); + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + * + * @return The imageQuery. + */ + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery getImageQuery(); + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.ImageQuery image_query = 19; + */ + com.google.cloud.discoveryengine.v1.SearchRequest.ImageQueryOrBuilder getImageQueryOrBuilder(); + /** * * *
    * Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
    * return. If unspecified, defaults to a reasonable value. The maximum allowed
-   * value is 100. Values above 100 will be coerced to 100.
+   * value is 100. Values above 100 are coerced to 100.
    *
    * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
    * 
@@ -192,13 +227,82 @@ public interface SearchRequestOrBuilder */ int getOffset(); + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the documents being filtered. Filter
+   * expression is case-sensitive.
+   *
+   * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * string filter = 7; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the documents being filtered. Filter
+   * expression is case-sensitive.
+   *
+   * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * string filter = 7; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The order in which documents are returned. Documents can be ordered by
+   * a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
+   * Leave it unset if ordered by relevance. `order_by` expression is
+   * case-sensitive.
+   *
+   * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+   * 
+ * + * string order_by = 8; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The order in which documents are returned. Documents can be ordered by
+   * a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
+   * Leave it unset if ordered by relevance. `order_by` expression is
+   * case-sensitive.
+   *
+   * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+   * 
+ * + * string order_by = 8; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + /** * * *
    * Information about the end user.
-   * Highly recommended for analytics. The user_agent string in UserInfo will
-   * be used to deduce device_type for analytics.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
    * 
* * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; @@ -211,8 +315,9 @@ public interface SearchRequestOrBuilder * *
    * Information about the end user.
-   * Highly recommended for analytics. The user_agent string in UserInfo will
-   * be used to deduce device_type for analytics.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
    * 
* * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; @@ -225,14 +330,118 @@ public interface SearchRequestOrBuilder * *
    * Information about the end user.
-   * Highly recommended for analytics. The user_agent string in UserInfo will
-   * be used to deduce device_type for analytics.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
    * 
* * .google.cloud.discoveryengine.v1.UserInfo user_info = 21; */ com.google.cloud.discoveryengine.v1.UserInfoOrBuilder getUserInfoOrBuilder(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   *
+   * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+   * error is returned.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + */ + java.util.List getFacetSpecsList(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   *
+   * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+   * error is returned.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + */ + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec getFacetSpecs(int index); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   *
+   * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+   * error is returned.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + */ + int getFacetSpecsCount(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   *
+   * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+   * error is returned.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + */ + java.util.List + getFacetSpecsOrBuilderList(); + /** + * + * + *
+   * Facet specifications for faceted search. If empty, no facets are returned.
+   *
+   * A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+   * error is returned.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchRequest.FacetSpec facet_specs = 9; + */ + com.google.cloud.discoveryengine.v1.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder( + int index); + + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; + * + * @return Whether the boostSpec field is set. + */ + boolean hasBoostSpec(); + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; + * + * @return The boostSpec. + */ + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec getBoostSpec(); + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec boost_spec = 10; + */ + com.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder(); + /** * * @@ -336,7 +545,7 @@ com.google.protobuf.Value getParamsOrDefault( * *
    * The query expansion specification that specifies the conditions under which
-   * query expansion will occur.
+   * query expansion occurs.
    * 
* * @@ -351,7 +560,7 @@ com.google.protobuf.Value getParamsOrDefault( * *
    * The query expansion specification that specifies the conditions under which
-   * query expansion will occur.
+   * query expansion occurs.
    * 
* * @@ -366,7 +575,7 @@ com.google.protobuf.Value getParamsOrDefault( * *
    * The query expansion specification that specifies the conditions under which
-   * query expansion will occur.
+   * query expansion occurs.
    * 
* * @@ -381,7 +590,7 @@ com.google.protobuf.Value getParamsOrDefault( * *
    * The spell correction specification that specifies the mode under
-   * which spell correction will take effect.
+   * which spell correction takes effect.
    * 
* * @@ -396,7 +605,7 @@ com.google.protobuf.Value getParamsOrDefault( * *
    * The spell correction specification that specifies the mode under
-   * which spell correction will take effect.
+   * which spell correction takes effect.
    * 
* * @@ -411,7 +620,7 @@ com.google.protobuf.Value getParamsOrDefault( * *
    * The spell correction specification that specifies the mode under
-   * which spell correction will take effect.
+   * which spell correction takes effect.
    * 
* * @@ -476,8 +685,7 @@ com.google.protobuf.Value getParamsOrDefault( * * *
-   * The content search spec that configs the desired behavior of content
-   * search.
+   * A specification for configuring the behavior of content search.
    * 
* * @@ -491,8 +699,7 @@ com.google.protobuf.Value getParamsOrDefault( * * *
-   * The content search spec that configs the desired behavior of content
-   * search.
+   * A specification for configuring the behavior of content search.
    * 
* * @@ -506,8 +713,7 @@ com.google.protobuf.Value getParamsOrDefault( * * *
-   * The content search spec that configs the desired behavior of content
-   * search.
+   * A specification for configuring the behavior of content search.
    * 
* * @@ -522,7 +728,7 @@ com.google.protobuf.Value getParamsOrDefault( * *
    * Whether to turn on safe search. This is only supported for
-   * [ContentConfig.PUBLIC_WEBSITE][].
+   * website search.
    * 
* * bool safe_search = 20; diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchResponse.java index a06acac8d2e4..467341976f7e 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchResponse.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchResponse.java @@ -41,7 +41,9 @@ private SearchResponse(com.google.protobuf.GeneratedMessageV3.Builder builder private SearchResponse() { results_ = java.util.Collections.emptyList(); + facets_ = java.util.Collections.emptyList(); attributionToken_ = ""; + redirectUri_ = ""; nextPageToken_ = ""; correctedQuery_ = ""; } @@ -1042,78 +1044,6394 @@ public com.google.protobuf.Parser getParserForType() { } } + public interface FacetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchResponse.Facet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The key for this facet. E.g., "colors" or "price". It matches
+     * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+     * The key for this facet. E.g., "colors" or "price". It matches
+     * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + java.util.List + getValuesList(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue getValues(int index); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + int getValuesCount(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + java.util.List< + ? extends com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValueOrBuilder getValuesOrBuilder( + int index); + + /** + * + * + *
+     * Whether the facet is dynamically generated.
+     * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + boolean getDynamicFacet(); + } + /** + * + * + *
+   * A facet result.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchResponse.Facet} + */ + public static final class Facet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchResponse.Facet) + FacetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Facet.newBuilder() to construct. + private Facet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Facet() { + key_ = ""; + values_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Facet(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.class, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder.class); + } + + public interface FacetValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colors".
+       * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colors".
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colors".
+       * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + boolean hasInterval(); + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + * + * @return The interval. + */ + com.google.cloud.discoveryengine.v1.Interval getInterval(); + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + */ + com.google.cloud.discoveryengine.v1.IntervalOrBuilder getIntervalOrBuilder(); + + /** + * + * + *
+       * Number of items that have this facet value.
+       * 
+ * + * int64 count = 3; + * + * @return The count. + */ + long getCount(); + + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.FacetValueCase + getFacetValueCase(); + } + /** + * + * + *
+     * A facet value which contains value names and their count.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue} + */ + public static final class FacetValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue) + FacetValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use FacetValue.newBuilder() to construct. + private FacetValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FacetValue() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetValue(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_FacetValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.class, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder.class); + } + + private int facetValueCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object facetValue_; + + public enum FacetValueCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VALUE(1), + INTERVAL(2), + FACETVALUE_NOT_SET(0); + private final int value; + + private FacetValueCase(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 FacetValueCase valueOf(int value) { + return forNumber(value); + } + + public static FacetValueCase forNumber(int value) { + switch (value) { + case 1: + return VALUE; + case 2: + return INTERVAL; + case 0: + return FACETVALUE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public FacetValueCase getFacetValueCase() { + return FacetValueCase.forNumber(facetValueCase_); + } + + public static final int VALUE_FIELD_NUMBER = 1; + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colors".
+       * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + public boolean hasValue() { + return facetValueCase_ == 1; + } + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colors".
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (facetValueCase_ == 1) { + facetValue_ = s; + } + return s; + } + } + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colors".
+       * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (facetValueCase_ == 1) { + facetValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTERVAL_FIELD_NUMBER = 2; + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return facetValueCase_ == 2; + } + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Interval getInterval() { + if (facetValueCase_ == 2) { + return (com.google.cloud.discoveryengine.v1.Interval) facetValue_; + } + return com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance(); + } + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.IntervalOrBuilder getIntervalOrBuilder() { + if (facetValueCase_ == 2) { + return (com.google.cloud.discoveryengine.v1.Interval) facetValue_; + } + return com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance(); + } + + public static final int COUNT_FIELD_NUMBER = 3; + private long count_ = 0L; + /** + * + * + *
+       * Number of items that have this facet value.
+       * 
+ * + * int64 count = 3; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + 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 (facetValueCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, facetValue_); + } + if (facetValueCase_ == 2) { + output.writeMessage(2, (com.google.cloud.discoveryengine.v1.Interval) facetValue_); + } + if (count_ != 0L) { + output.writeInt64(3, count_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (facetValueCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, facetValue_); + } + if (facetValueCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.discoveryengine.v1.Interval) facetValue_); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, count_); + } + 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.discoveryengine.v1.SearchResponse.Facet.FacetValue)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue other = + (com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue) obj; + + if (getCount() != other.getCount()) return false; + if (!getFacetValueCase().equals(other.getFacetValueCase())) return false; + switch (facetValueCase_) { + case 1: + if (!getValue().equals(other.getValue())) return false; + break; + case 2: + if (!getInterval().equals(other.getInterval())) 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) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + switch (facetValueCase_) { + case 1: + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + break; + case 2: + hash = (37 * hash) + INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getInterval().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue 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.discoveryengine.v1.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue 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.discoveryengine.v1.SearchResponse.Facet.FacetValue parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue 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.discoveryengine.v1.SearchResponse.Facet.FacetValue + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue + 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.discoveryengine.v1.SearchResponse.Facet.FacetValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue 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.discoveryengine.v1.SearchResponse.Facet.FacetValue 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 facet value which contains value names and their count.
+       * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue) + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_FacetValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.class, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (intervalBuilder_ != null) { + intervalBuilder_.clear(); + } + count_ = 0L; + facetValueCase_ = 0; + facetValue_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue build() { + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue buildPartial() { + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue result = + new com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.count_ = count_; + } + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue result) { + result.facetValueCase_ = facetValueCase_; + result.facetValue_ = this.facetValue_; + if (facetValueCase_ == 2 && intervalBuilder_ != null) { + result.facetValue_ = intervalBuilder_.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.discoveryengine.v1.SearchResponse.Facet.FacetValue) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue + .getDefaultInstance()) return this; + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + switch (other.getFacetValueCase()) { + case VALUE: + { + facetValueCase_ = 1; + facetValue_ = other.facetValue_; + onChanged(); + break; + } + case INTERVAL: + { + mergeInterval(other.getInterval()); + break; + } + case FACETVALUE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + facetValueCase_ = 1; + facetValue_ = s; + break; + } // case 10 + case 18: + { + input.readMessage(getIntervalFieldBuilder().getBuilder(), extensionRegistry); + facetValueCase_ = 2; + break; + } // case 18 + case 24: + { + count_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int facetValueCase_ = 0; + private java.lang.Object facetValue_; + + public FacetValueCase getFacetValueCase() { + return FacetValueCase.forNumber(facetValueCase_); + } + + public Builder clearFacetValue() { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colors".
+         * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return facetValueCase_ == 1; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colors".
+         * 
+ * + * string value = 1; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (facetValueCase_ == 1) { + facetValue_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colors".
+         * 
+ * + * string value = 1; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = ""; + if (facetValueCase_ == 1) { + ref = facetValue_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (facetValueCase_ == 1) { + facetValue_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colors".
+         * 
+ * + * string value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + facetValueCase_ = 1; + facetValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colors".
+         * 
+ * + * string value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + if (facetValueCase_ == 1) { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colors".
+         * 
+ * + * string value = 1; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + facetValueCase_ = 1; + facetValue_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Interval, + com.google.cloud.discoveryengine.v1.Interval.Builder, + com.google.cloud.discoveryengine.v1.IntervalOrBuilder> + intervalBuilder_; + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return facetValueCase_ == 2; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Interval getInterval() { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2) { + return (com.google.cloud.discoveryengine.v1.Interval) facetValue_; + } + return com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance(); + } else { + if (facetValueCase_ == 2) { + return intervalBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + */ + public Builder setInterval(com.google.cloud.discoveryengine.v1.Interval value) { + if (intervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + facetValue_ = value; + onChanged(); + } else { + intervalBuilder_.setMessage(value); + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + */ + public Builder setInterval( + com.google.cloud.discoveryengine.v1.Interval.Builder builderForValue) { + if (intervalBuilder_ == null) { + facetValue_ = builderForValue.build(); + onChanged(); + } else { + intervalBuilder_.setMessage(builderForValue.build()); + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + */ + public Builder mergeInterval(com.google.cloud.discoveryengine.v1.Interval value) { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2 + && facetValue_ + != com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance()) { + facetValue_ = + com.google.cloud.discoveryengine.v1.Interval.newBuilder( + (com.google.cloud.discoveryengine.v1.Interval) facetValue_) + .mergeFrom(value) + .buildPartial(); + } else { + facetValue_ = value; + } + onChanged(); + } else { + if (facetValueCase_ == 2) { + intervalBuilder_.mergeFrom(value); + } else { + intervalBuilder_.setMessage(value); + } + } + facetValueCase_ = 2; + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + */ + public Builder clearInterval() { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2) { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + } + } else { + if (facetValueCase_ == 2) { + facetValueCase_ = 0; + facetValue_ = null; + } + intervalBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + */ + public com.google.cloud.discoveryengine.v1.Interval.Builder getIntervalBuilder() { + return getIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.IntervalOrBuilder getIntervalOrBuilder() { + if ((facetValueCase_ == 2) && (intervalBuilder_ != null)) { + return intervalBuilder_.getMessageOrBuilder(); + } else { + if (facetValueCase_ == 2) { + return (com.google.cloud.discoveryengine.v1.Interval) facetValue_; + } + return com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1.Interval interval = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Interval, + com.google.cloud.discoveryengine.v1.Interval.Builder, + com.google.cloud.discoveryengine.v1.IntervalOrBuilder> + getIntervalFieldBuilder() { + if (intervalBuilder_ == null) { + if (!(facetValueCase_ == 2)) { + facetValue_ = com.google.cloud.discoveryengine.v1.Interval.getDefaultInstance(); + } + intervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Interval, + com.google.cloud.discoveryengine.v1.Interval.Builder, + com.google.cloud.discoveryengine.v1.IntervalOrBuilder>( + (com.google.cloud.discoveryengine.v1.Interval) facetValue_, + getParentForChildren(), + isClean()); + facetValue_ = null; + } + facetValueCase_ = 2; + onChanged(); + return intervalBuilder_; + } + + private long count_; + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(long value) { + + count_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + bitField0_ = (bitField0_ & ~0x00000004); + count_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue) + private static final com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue(); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FacetValue 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.discoveryengine.v1.SearchResponse.Facet.FacetValue + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** + * + * + *
+     * The key for this facet. E.g., "colors" or "price". It matches
+     * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+     * The key for this facet. E.g., "colors" or "price". It matches
+     * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + values_; + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public java.util.List + getValuesList() { + return values_; + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList() { + return values_; + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue getValues( + int index) { + return values_.get(index); + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValueOrBuilder + getValuesOrBuilder(int index) { + return values_.get(index); + } + + public static final int DYNAMIC_FACET_FIELD_NUMBER = 3; + private boolean dynamicFacet_ = false; + /** + * + * + *
+     * Whether the facet is dynamically generated.
+     * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + @java.lang.Override + public boolean getDynamicFacet() { + return dynamicFacet_; + } + + 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(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(2, values_.get(i)); + } + if (dynamicFacet_ != false) { + output.writeBool(3, dynamicFacet_); + } + 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(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, values_.get(i)); + } + if (dynamicFacet_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, dynamicFacet_); + } + 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.discoveryengine.v1.SearchResponse.Facet)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchResponse.Facet other = + (com.google.cloud.discoveryengine.v1.SearchResponse.Facet) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getValuesList().equals(other.getValuesList())) return false; + if (getDynamicFacet() != other.getDynamicFacet()) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (37 * hash) + DYNAMIC_FACET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDynamicFacet()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet 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.discoveryengine.v1.SearchResponse.Facet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet 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.discoveryengine.v1.SearchResponse.Facet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet 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.discoveryengine.v1.SearchResponse.Facet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet 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.discoveryengine.v1.SearchResponse.Facet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet 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.discoveryengine.v1.SearchResponse.Facet 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 facet result.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchResponse.Facet} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchResponse.Facet) + com.google.cloud.discoveryengine.v1.SearchResponse.FacetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.class, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.SearchResponse.Facet.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + dynamicFacet_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchResponse.Facet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet build() { + com.google.cloud.discoveryengine.v1.SearchResponse.Facet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet buildPartial() { + com.google.cloud.discoveryengine.v1.SearchResponse.Facet result = + new com.google.cloud.discoveryengine.v1.SearchResponse.Facet(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet result) { + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1.SearchResponse.Facet result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dynamicFacet_ = dynamicFacet_; + } + } + + @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.discoveryengine.v1.SearchResponse.Facet) { + return mergeFrom((com.google.cloud.discoveryengine.v1.SearchResponse.Facet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.SearchResponse.Facet other) { + if (other == com.google.cloud.discoveryengine.v1.SearchResponse.Facet.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000002); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + if (other.getDynamicFacet() != false) { + setDynamicFacet(other.getDynamicFacet()); + } + 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: + { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue m = + input.readMessage( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue + .parser(), + extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + dynamicFacet_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * + * + *
+       * The key for this facet. E.g., "colors" or "price". It matches
+       * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
+       * 
+ * + * string key = 1; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The key for this facet. E.g., "colors" or "price". It matches
+       * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
+       * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The key for this facet. E.g., "colors" or "price". It matches
+       * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
+       * 
+ * + * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The key for this facet. E.g., "colors" or "price". It matches
+       * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
+       * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The key for this facet. E.g., "colors" or "price". It matches
+       * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
+       * 
+ * + * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List + values_ = java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + values_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue>(values_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List + getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue getValues( + int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder setValues( + int index, com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder setValues( + int index, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder + builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + int index, com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder + builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + int index, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder + builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addAllValues( + java.lang.Iterable< + ? extends com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue> + values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder + getValuesBuilder(int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValueOrBuilder + getValuesOrBuilder(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder + addValuesBuilder() { + return getValuesFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue + .getDefaultInstance()); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder + addValuesBuilder(int index) { + return getValuesFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue + .getDefaultInstance()); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder> + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValueOrBuilder>( + values_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + values_ = null; + } + return valuesBuilder_; + } + + private boolean dynamicFacet_; + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @return The dynamicFacet. + */ + @java.lang.Override + public boolean getDynamicFacet() { + return dynamicFacet_; + } + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @param value The dynamicFacet to set. + * @return This builder for chaining. + */ + public Builder setDynamicFacet(boolean value) { + + dynamicFacet_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @return This builder for chaining. + */ + public Builder clearDynamicFacet() { + bitField0_ = (bitField0_ & ~0x00000004); + dynamicFacet_ = 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.discoveryengine.v1.SearchResponse.Facet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchResponse.Facet) + private static final com.google.cloud.discoveryengine.v1.SearchResponse.Facet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.SearchResponse.Facet(); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Facet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Facet 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.discoveryengine.v1.SearchResponse.Facet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SummaryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchResponse.Summary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The summary content.
+     * 
+ * + * string summary_text = 1; + * + * @return The summaryText. + */ + java.lang.String getSummaryText(); + /** + * + * + *
+     * The summary content.
+     * 
+ * + * string summary_text = 1; + * + * @return The bytes for summaryText. + */ + com.google.protobuf.ByteString getSummaryTextBytes(); + + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the summarySkippedReasons. + */ + java.util.List + getSummarySkippedReasonsList(); + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return The count of summarySkippedReasons. + */ + int getSummarySkippedReasonsCount(); + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the element to return. + * @return The summarySkippedReasons at the given index. + */ + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason + getSummarySkippedReasons(int index); + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the enum numeric values on the wire for summarySkippedReasons. + */ + java.util.List getSummarySkippedReasonsValueList(); + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of summarySkippedReasons at the given index. + */ + int getSummarySkippedReasonsValue(int index); + + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return Whether the safetyAttributes field is set. + */ + boolean hasSafetyAttributes(); + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return The safetyAttributes. + */ + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + getSafetyAttributes(); + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributesOrBuilder + getSafetyAttributesOrBuilder(); + } + /** + * + * + *
+   * Summary of the top N search result specified by the summary spec.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchResponse.Summary} + */ + public static final class Summary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchResponse.Summary) + SummaryOrBuilder { + private static final long serialVersionUID = 0L; + // Use Summary.newBuilder() to construct. + private Summary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Summary() { + summaryText_ = ""; + summarySkippedReasons_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Summary(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.class, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder.class); + } + + /** + * + * + *
+     * An Enum for summary-skipped reasons.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason} + */ + public enum SummarySkippedReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value. The summary skipped reason is not specified.
+       * 
+ * + * SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0; + */ + SUMMARY_SKIPPED_REASON_UNSPECIFIED(0), + /** + * + * + *
+       * The adversarial query ignored case.
+       *
+       * Only populated when
+       * [SummarySpec.ignore_adversarial_query][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ignore_adversarial_query]
+       * is set to `true`.
+       * 
+ * + * ADVERSARIAL_QUERY_IGNORED = 1; + */ + ADVERSARIAL_QUERY_IGNORED(1), + /** + * + * + *
+       * The non-summary seeking query ignored case.
+       *
+       * Only populated when
+       * [SummarySpec.ignore_non_summary_seeking_query][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_summary_seeking_query]
+       * is set to `true`.
+       * 
+ * + * NON_SUMMARY_SEEKING_QUERY_IGNORED = 2; + */ + NON_SUMMARY_SEEKING_QUERY_IGNORED(2), + /** + * + * + *
+       * The out-of-domain query ignored case.
+       *
+       * Google skips the summary if there are no high-relevance search results.
+       * For example, the data store contains facts about company A but the
+       * user query is asking questions about company B.
+       * 
+ * + * OUT_OF_DOMAIN_QUERY_IGNORED = 3; + */ + OUT_OF_DOMAIN_QUERY_IGNORED(3), + /** + * + * + *
+       * The potential policy violation case.
+       *
+       * Google skips the summary if there is a potential policy violation
+       * detected. This includes content that may be violent or toxic.
+       * 
+ * + * POTENTIAL_POLICY_VIOLATION = 4; + */ + POTENTIAL_POLICY_VIOLATION(4), + /** + * + * + *
+       * The LLM addon not enabled case.
+       *
+       * Google skips the summary if the LLM addon is not enabled.
+       * 
+ * + * LLM_ADDON_NOT_ENABLED = 5; + */ + LLM_ADDON_NOT_ENABLED(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value. The summary skipped reason is not specified.
+       * 
+ * + * SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0; + */ + public static final int SUMMARY_SKIPPED_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The adversarial query ignored case.
+       *
+       * Only populated when
+       * [SummarySpec.ignore_adversarial_query][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ignore_adversarial_query]
+       * is set to `true`.
+       * 
+ * + * ADVERSARIAL_QUERY_IGNORED = 1; + */ + public static final int ADVERSARIAL_QUERY_IGNORED_VALUE = 1; + /** + * + * + *
+       * The non-summary seeking query ignored case.
+       *
+       * Only populated when
+       * [SummarySpec.ignore_non_summary_seeking_query][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_summary_seeking_query]
+       * is set to `true`.
+       * 
+ * + * NON_SUMMARY_SEEKING_QUERY_IGNORED = 2; + */ + public static final int NON_SUMMARY_SEEKING_QUERY_IGNORED_VALUE = 2; + /** + * + * + *
+       * The out-of-domain query ignored case.
+       *
+       * Google skips the summary if there are no high-relevance search results.
+       * For example, the data store contains facts about company A but the
+       * user query is asking questions about company B.
+       * 
+ * + * OUT_OF_DOMAIN_QUERY_IGNORED = 3; + */ + public static final int OUT_OF_DOMAIN_QUERY_IGNORED_VALUE = 3; + /** + * + * + *
+       * The potential policy violation case.
+       *
+       * Google skips the summary if there is a potential policy violation
+       * detected. This includes content that may be violent or toxic.
+       * 
+ * + * POTENTIAL_POLICY_VIOLATION = 4; + */ + public static final int POTENTIAL_POLICY_VIOLATION_VALUE = 4; + /** + * + * + *
+       * The LLM addon not enabled case.
+       *
+       * Google skips the summary if the LLM addon is not enabled.
+       * 
+ * + * LLM_ADDON_NOT_ENABLED = 5; + */ + public static final int LLM_ADDON_NOT_ENABLED_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SummarySkippedReason 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 SummarySkippedReason forNumber(int value) { + switch (value) { + case 0: + return SUMMARY_SKIPPED_REASON_UNSPECIFIED; + case 1: + return ADVERSARIAL_QUERY_IGNORED; + case 2: + return NON_SUMMARY_SEEKING_QUERY_IGNORED; + case 3: + return OUT_OF_DOMAIN_QUERY_IGNORED; + case 4: + return POTENTIAL_POLICY_VIOLATION; + case 5: + return LLM_ADDON_NOT_ENABLED; + 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 SummarySkippedReason findValueByNumber(int number) { + return SummarySkippedReason.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.discoveryengine.v1.SearchResponse.Summary.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SummarySkippedReason[] VALUES = values(); + + public static SummarySkippedReason 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 SummarySkippedReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason) + } + + public interface SafetyAttributesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return A list containing the categories. + */ + java.util.List getCategoriesList(); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return The count of categories. + */ + int getCategoriesCount(); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + java.lang.String getCategories(int index); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + com.google.protobuf.ByteString getCategoriesBytes(int index); + + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return A list containing the scores. + */ + java.util.List getScoresList(); + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return The count of scores. + */ + int getScoresCount(); + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @param index The index of the element to return. + * @return The scores at the given index. + */ + float getScores(int index); + } + /** + * + * + *
+     * Safety Attribute categories and their associated confidence scores.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes} + */ + public static final class SafetyAttributes extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes) + SafetyAttributesOrBuilder { + private static final long serialVersionUID = 0L; + // Use SafetyAttributes.newBuilder() to construct. + private SafetyAttributes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SafetyAttributes() { + categories_ = com.google.protobuf.LazyStringArrayList.emptyList(); + scores_ = emptyFloatList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SafetyAttributes(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_SafetyAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes.class, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes.Builder + .class); + } + + public static final int CATEGORIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList categories_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + return categories_; + } + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } + + public static final int SCORES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList scores_; + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return A list containing the scores. + */ + @java.lang.Override + public java.util.List getScoresList() { + return scores_; + } + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return The count of scores. + */ + public int getScoresCount() { + return scores_.size(); + } + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @param index The index of the element to return. + * @return The scores at the given index. + */ + public float getScores(int index) { + return scores_.getFloat(index); + } + + private int scoresMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < categories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, categories_.getRaw(i)); + } + if (getScoresList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(scoresMemoizedSerializedSize); + } + for (int i = 0; i < scores_.size(); i++) { + output.writeFloatNoTag(scores_.getFloat(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < categories_.size(); i++) { + dataSize += computeStringSizeNoTag(categories_.getRaw(i)); + } + size += dataSize; + size += 1 * getCategoriesList().size(); + } + { + int dataSize = 0; + dataSize = 4 * getScoresList().size(); + size += dataSize; + if (!getScoresList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + scoresMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes other = + (com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes) obj; + + if (!getCategoriesList().equals(other.getCategoriesList())) return false; + if (!getScoresList().equals(other.getScoresList())) 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 (getCategoriesCount() > 0) { + hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getCategoriesList().hashCode(); + } + if (getScoresCount() > 0) { + hash = (37 * hash) + SCORES_FIELD_NUMBER; + hash = (53 * hash) + getScoresList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + 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.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + 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.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + 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.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + 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.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + 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.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Safety Attribute categories and their associated confidence scores.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes) + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_SafetyAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes.class, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + .Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + categories_ = com.google.protobuf.LazyStringArrayList.emptyList(); + scores_ = emptyFloatList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_SafetyAttributes_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes build() { + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + buildPartial() { + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes result = + new com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes result) { + if (((bitField0_ & 0x00000002) != 0)) { + scores_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.scores_ = scores_; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + categories_.makeImmutable(); + result.categories_ = categories_; + } + } + + @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.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance()) return this; + if (!other.categories_.isEmpty()) { + if (categories_.isEmpty()) { + categories_ = other.categories_; + bitField0_ |= 0x00000001; + } else { + ensureCategoriesIsMutable(); + categories_.addAll(other.categories_); + } + onChanged(); + } + if (!other.scores_.isEmpty()) { + if (scores_.isEmpty()) { + scores_ = other.scores_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureScoresIsMutable(); + scores_.addAll(other.scores_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCategoriesIsMutable(); + categories_.add(s); + break; + } // case 10 + case 21: + { + float v = input.readFloat(); + ensureScoresIsMutable(); + scores_.addFloat(v); + break; + } // case 21 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureScoresIsMutable(); + while (input.getBytesUntilLimit() > 0) { + scores_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList categories_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCategoriesIsMutable() { + if (!categories_.isModifiable()) { + categories_ = new com.google.protobuf.LazyStringArrayList(categories_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + categories_.makeImmutable(); + return categories_; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param index The index to set the value at. + * @param value The categories to set. + * @return This builder for chaining. + */ + public Builder setCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param value The categories to add. + * @return This builder for chaining. + */ + public Builder addCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param values The categories to add. + * @return This builder for chaining. + */ + public Builder addAllCategories(java.lang.Iterable values) { + ensureCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @return This builder for chaining. + */ + public Builder clearCategories() { + categories_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param value The bytes of the categories to add. + * @return This builder for chaining. + */ + public Builder addCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCategoriesIsMutable(); + categories_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.FloatList scores_ = emptyFloatList(); + + private void ensureScoresIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + scores_ = mutableCopy(scores_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @return A list containing the scores. + */ + public java.util.List getScoresList() { + return ((bitField0_ & 0x00000002) != 0) + ? java.util.Collections.unmodifiableList(scores_) + : scores_; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @return The count of scores. + */ + public int getScoresCount() { + return scores_.size(); + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param index The index of the element to return. + * @return The scores at the given index. + */ + public float getScores(int index) { + return scores_.getFloat(index); + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param index The index to set the value at. + * @param value The scores to set. + * @return This builder for chaining. + */ + public Builder setScores(int index, float value) { + + ensureScoresIsMutable(); + scores_.setFloat(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param value The scores to add. + * @return This builder for chaining. + */ + public Builder addScores(float value) { + + ensureScoresIsMutable(); + scores_.addFloat(value); + onChanged(); + return this; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param values The scores to add. + * @return This builder for chaining. + */ + public Builder addAllScores(java.lang.Iterable values) { + ensureScoresIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scores_); + onChanged(); + return this; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @return This builder for chaining. + */ + public Builder clearScores() { + scores_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes) + private static final com.google.cloud.discoveryengine.v1.SearchResponse.Summary + .SafetyAttributes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes(); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SafetyAttributes 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.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SUMMARY_TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object summaryText_ = ""; + /** + * + * + *
+     * The summary content.
+     * 
+ * + * string summary_text = 1; + * + * @return The summaryText. + */ + @java.lang.Override + public java.lang.String getSummaryText() { + java.lang.Object ref = summaryText_; + 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(); + summaryText_ = s; + return s; + } + } + /** + * + * + *
+     * The summary content.
+     * 
+ * + * string summary_text = 1; + * + * @return The bytes for summaryText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSummaryTextBytes() { + java.lang.Object ref = summaryText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + summaryText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUMMARY_SKIPPED_REASONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List summarySkippedReasons_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason> + summarySkippedReasons_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason>() { + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason + convert(java.lang.Integer from) { + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason + result = + com.google.cloud.discoveryengine.v1.SearchResponse.Summary + .SummarySkippedReason.forNumber(from); + return result == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary + .SummarySkippedReason.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the summarySkippedReasons. + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason> + getSummarySkippedReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason>( + summarySkippedReasons_, summarySkippedReasons_converter_); + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return The count of summarySkippedReasons. + */ + @java.lang.Override + public int getSummarySkippedReasonsCount() { + return summarySkippedReasons_.size(); + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the element to return. + * @return The summarySkippedReasons at the given index. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason + getSummarySkippedReasons(int index) { + return summarySkippedReasons_converter_.convert(summarySkippedReasons_.get(index)); + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the enum numeric values on the wire for summarySkippedReasons. + */ + @java.lang.Override + public java.util.List getSummarySkippedReasonsValueList() { + return summarySkippedReasons_; + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of summarySkippedReasons at the given index. + */ + @java.lang.Override + public int getSummarySkippedReasonsValue(int index) { + return summarySkippedReasons_.get(index); + } + + private int summarySkippedReasonsMemoizedSerializedSize; + + public static final int SAFETY_ATTRIBUTES_FIELD_NUMBER = 3; + private com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + safetyAttributes_; + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return Whether the safetyAttributes field is set. + */ + @java.lang.Override + public boolean hasSafetyAttributes() { + return safetyAttributes_ != null; + } + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return The safetyAttributes. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + getSafetyAttributes() { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributesOrBuilder + getSafetyAttributesOrBuilder() { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(summaryText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, summaryText_); + } + if (getSummarySkippedReasonsList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(summarySkippedReasonsMemoizedSerializedSize); + } + for (int i = 0; i < summarySkippedReasons_.size(); i++) { + output.writeEnumNoTag(summarySkippedReasons_.get(i)); + } + if (safetyAttributes_ != null) { + output.writeMessage(3, getSafetyAttributes()); + } + 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(summaryText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, summaryText_); + } + { + int dataSize = 0; + for (int i = 0; i < summarySkippedReasons_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + summarySkippedReasons_.get(i)); + } + size += dataSize; + if (!getSummarySkippedReasonsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + summarySkippedReasonsMemoizedSerializedSize = dataSize; + } + if (safetyAttributes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSafetyAttributes()); + } + 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.discoveryengine.v1.SearchResponse.Summary)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchResponse.Summary other = + (com.google.cloud.discoveryengine.v1.SearchResponse.Summary) obj; + + if (!getSummaryText().equals(other.getSummaryText())) return false; + if (!summarySkippedReasons_.equals(other.summarySkippedReasons_)) return false; + if (hasSafetyAttributes() != other.hasSafetyAttributes()) return false; + if (hasSafetyAttributes()) { + if (!getSafetyAttributes().equals(other.getSafetyAttributes())) 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) + SUMMARY_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getSummaryText().hashCode(); + if (getSummarySkippedReasonsCount() > 0) { + hash = (37 * hash) + SUMMARY_SKIPPED_REASONS_FIELD_NUMBER; + hash = (53 * hash) + summarySkippedReasons_.hashCode(); + } + if (hasSafetyAttributes()) { + hash = (37 * hash) + SAFETY_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getSafetyAttributes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary 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.discoveryengine.v1.SearchResponse.Summary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary 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.discoveryengine.v1.SearchResponse.Summary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary 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.discoveryengine.v1.SearchResponse.Summary parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary 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.discoveryengine.v1.SearchResponse.Summary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary 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.discoveryengine.v1.SearchResponse.Summary 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; + } + /** + * + * + *
+     * Summary of the top N search result specified by the summary spec.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchResponse.Summary} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchResponse.Summary) + com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.class, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.SearchResponse.Summary.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + summaryText_ = ""; + summarySkippedReasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + safetyAttributes_ = null; + if (safetyAttributesBuilder_ != null) { + safetyAttributesBuilder_.dispose(); + safetyAttributesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchResponse.Summary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary build() { + com.google.cloud.discoveryengine.v1.SearchResponse.Summary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary buildPartial() { + com.google.cloud.discoveryengine.v1.SearchResponse.Summary result = + new com.google.cloud.discoveryengine.v1.SearchResponse.Summary(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary result) { + if (((bitField0_ & 0x00000002) != 0)) { + summarySkippedReasons_ = java.util.Collections.unmodifiableList(summarySkippedReasons_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.summarySkippedReasons_ = summarySkippedReasons_; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.summaryText_ = summaryText_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.safetyAttributes_ = + safetyAttributesBuilder_ == null + ? safetyAttributes_ + : safetyAttributesBuilder_.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.discoveryengine.v1.SearchResponse.Summary) { + return mergeFrom((com.google.cloud.discoveryengine.v1.SearchResponse.Summary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.SearchResponse.Summary other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchResponse.Summary.getDefaultInstance()) + return this; + if (!other.getSummaryText().isEmpty()) { + summaryText_ = other.summaryText_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.summarySkippedReasons_.isEmpty()) { + if (summarySkippedReasons_.isEmpty()) { + summarySkippedReasons_ = other.summarySkippedReasons_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.addAll(other.summarySkippedReasons_); + } + onChanged(); + } + if (other.hasSafetyAttributes()) { + mergeSafetyAttributes(other.getSafetyAttributes()); + } + 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: + { + summaryText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + int tmpRaw = input.readEnum(); + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 18 + case 26: + { + input.readMessage( + getSafetyAttributesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object summaryText_ = ""; + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @return The summaryText. + */ + public java.lang.String getSummaryText() { + java.lang.Object ref = summaryText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + summaryText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @return The bytes for summaryText. + */ + public com.google.protobuf.ByteString getSummaryTextBytes() { + java.lang.Object ref = summaryText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + summaryText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @param value The summaryText to set. + * @return This builder for chaining. + */ + public Builder setSummaryText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + summaryText_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @return This builder for chaining. + */ + public Builder clearSummaryText() { + summaryText_ = getDefaultInstance().getSummaryText(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @param value The bytes for summaryText to set. + * @return This builder for chaining. + */ + public Builder setSummaryTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + summaryText_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List summarySkippedReasons_ = + java.util.Collections.emptyList(); + + private void ensureSummarySkippedReasonsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + summarySkippedReasons_ = + new java.util.ArrayList(summarySkippedReasons_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the summarySkippedReasons. + */ + public java.util.List< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason> + getSummarySkippedReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason>( + summarySkippedReasons_, summarySkippedReasons_converter_); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return The count of summarySkippedReasons. + */ + public int getSummarySkippedReasonsCount() { + return summarySkippedReasons_.size(); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the element to return. + * @return The summarySkippedReasons at the given index. + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason + getSummarySkippedReasons(int index) { + return summarySkippedReasons_converter_.convert(summarySkippedReasons_.get(index)); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index to set the value at. + * @param value The summarySkippedReasons to set. + * @return This builder for chaining. + */ + public Builder setSummarySkippedReasons( + int index, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param value The summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addSummarySkippedReasons( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param values The summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addAllSummarySkippedReasons( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1.SearchResponse.Summary + .SummarySkippedReason> + values) { + ensureSummarySkippedReasonsIsMutable(); + for (com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason value : + values) { + summarySkippedReasons_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearSummarySkippedReasons() { + summarySkippedReasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the enum numeric values on the wire for summarySkippedReasons. + */ + public java.util.List getSummarySkippedReasonsValueList() { + return java.util.Collections.unmodifiableList(summarySkippedReasons_); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of summarySkippedReasons at the given index. + */ + public int getSummarySkippedReasonsValue(int index) { + return summarySkippedReasons_.get(index); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for summarySkippedReasons to set. + * @return This builder for chaining. + */ + public Builder setSummarySkippedReasonsValue(int index, int value) { + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param value The enum numeric value on the wire for summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addSummarySkippedReasonsValue(int value) { + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param values The enum numeric values on the wire for summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addAllSummarySkippedReasonsValue( + java.lang.Iterable values) { + ensureSummarySkippedReasonsIsMutable(); + for (int value : values) { + summarySkippedReasons_.add(value); + } + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + safetyAttributes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributesOrBuilder> + safetyAttributesBuilder_; + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return Whether the safetyAttributes field is set. + */ + public boolean hasSafetyAttributes() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return The safetyAttributes. + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + getSafetyAttributes() { + if (safetyAttributesBuilder_ == null) { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } else { + return safetyAttributesBuilder_.getMessage(); + } + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder setSafetyAttributes( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes value) { + if (safetyAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + safetyAttributes_ = value; + } else { + safetyAttributesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder setSafetyAttributes( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes.Builder + builderForValue) { + if (safetyAttributesBuilder_ == null) { + safetyAttributes_ = builderForValue.build(); + } else { + safetyAttributesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder mergeSafetyAttributes( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes value) { + if (safetyAttributesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && safetyAttributes_ != null + && safetyAttributes_ + != com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance()) { + getSafetyAttributesBuilder().mergeFrom(value); + } else { + safetyAttributes_ = value; + } + } else { + safetyAttributesBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder clearSafetyAttributes() { + bitField0_ = (bitField0_ & ~0x00000004); + safetyAttributes_ = null; + if (safetyAttributesBuilder_ != null) { + safetyAttributesBuilder_.dispose(); + safetyAttributesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes.Builder + getSafetyAttributesBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSafetyAttributesFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributesOrBuilder + getSafetyAttributesOrBuilder() { + if (safetyAttributesBuilder_ != null) { + return safetyAttributesBuilder_.getMessageOrBuilder(); + } else { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributesOrBuilder> + getSafetyAttributesFieldBuilder() { + if (safetyAttributesBuilder_ == null) { + safetyAttributesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes + .Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary + .SafetyAttributesOrBuilder>( + getSafetyAttributes(), getParentForChildren(), isClean()); + safetyAttributes_ = null; + } + return safetyAttributesBuilder_; + } + + @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.discoveryengine.v1.SearchResponse.Summary) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchResponse.Summary) + private static final com.google.cloud.discoveryengine.v1.SearchResponse.Summary + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.SearchResponse.Summary(); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.Summary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Summary 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.discoveryengine.v1.SearchResponse.Summary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Bool describing whether query expansion has occurred.
+     * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + boolean getExpandedQuery(); + + /** + * + * + *
+     * Number of pinned results. This field will only be set when expansion
+     * happens and
+     * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+     * is set to true.
+     * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + long getPinnedResultCount(); + } + /** + * + * + *
+   * Information describing query expansion including whether expansion has
+   * occurred.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo} + */ + public static final class QueryExpansionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo) + QueryExpansionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryExpansionInfo.newBuilder() to construct. + private QueryExpansionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryExpansionInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryExpansionInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.Builder.class); + } + + public static final int EXPANDED_QUERY_FIELD_NUMBER = 1; + private boolean expandedQuery_ = false; + /** + * + * + *
+     * Bool describing whether query expansion has occurred.
+     * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + @java.lang.Override + public boolean getExpandedQuery() { + return expandedQuery_; + } + + public static final int PINNED_RESULT_COUNT_FIELD_NUMBER = 2; + private long pinnedResultCount_ = 0L; + /** + * + * + *
+     * Number of pinned results. This field will only be set when expansion
+     * happens and
+     * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+     * is set to true.
+     * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + @java.lang.Override + public long getPinnedResultCount() { + return pinnedResultCount_; + } + + 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 (expandedQuery_ != false) { + output.writeBool(1, expandedQuery_); + } + if (pinnedResultCount_ != 0L) { + output.writeInt64(2, pinnedResultCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (expandedQuery_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, expandedQuery_); + } + if (pinnedResultCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, pinnedResultCount_); + } + 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.discoveryengine.v1.SearchResponse.QueryExpansionInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo other = + (com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo) obj; + + if (getExpandedQuery() != other.getExpandedQuery()) return false; + if (getPinnedResultCount() != other.getPinnedResultCount()) 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) + EXPANDED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExpandedQuery()); + hash = (37 * hash) + PINNED_RESULT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPinnedResultCount()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo 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.discoveryengine.v1.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo 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.discoveryengine.v1.SearchResponse.QueryExpansionInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo 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.discoveryengine.v1.SearchResponse.QueryExpansionInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + 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.discoveryengine.v1.SearchResponse.QueryExpansionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo 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.discoveryengine.v1.SearchResponse.QueryExpansionInfo 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; + } + /** + * + * + *
+     * Information describing query expansion including whether expansion has
+     * occurred.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo) + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + expandedQuery_ = false; + pinnedResultCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo build() { + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo buildPartial() { + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo result = + new com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.expandedQuery_ = expandedQuery_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pinnedResultCount_ = pinnedResultCount_; + } + } + + @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.discoveryengine.v1.SearchResponse.QueryExpansionInfo) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo other) { + if (other + == com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + .getDefaultInstance()) return this; + if (other.getExpandedQuery() != false) { + setExpandedQuery(other.getExpandedQuery()); + } + if (other.getPinnedResultCount() != 0L) { + setPinnedResultCount(other.getPinnedResultCount()); + } + 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: + { + expandedQuery_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + pinnedResultCount_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean expandedQuery_; + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + @java.lang.Override + public boolean getExpandedQuery() { + return expandedQuery_; + } + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @param value The expandedQuery to set. + * @return This builder for chaining. + */ + public Builder setExpandedQuery(boolean value) { + + expandedQuery_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearExpandedQuery() { + bitField0_ = (bitField0_ & ~0x00000001); + expandedQuery_ = false; + onChanged(); + return this; + } + + private long pinnedResultCount_; + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + @java.lang.Override + public long getPinnedResultCount() { + return pinnedResultCount_; + } + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @param value The pinnedResultCount to set. + * @return This builder for chaining. + */ + public Builder setPinnedResultCount(long value) { + + pinnedResultCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearPinnedResultCount() { + bitField0_ = (bitField0_ & ~0x00000002); + pinnedResultCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo) + private static final com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo(); + } + + public static com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryExpansionInfo 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.discoveryengine.v1.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + public static final int RESULTS_FIELD_NUMBER = 1; @SuppressWarnings("serial") - private java.util.List results_; + private java.util.List results_; + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public java.util.List + getResultsList() { + return results_; + } + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult getResults(int index) { + return results_.get(index); + } + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder + getResultsOrBuilder(int index) { + return results_.get(index); + } + + public static final int FACETS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List facets_; /** * * *
-   * A list of matched documents. The order represents the ranking.
+   * Results of facets requested by user.
    * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ @java.lang.Override - public java.util.List - getResultsList() { - return results_; + public java.util.List getFacetsList() { + return facets_; } /** * * *
-   * A list of matched documents. The order represents the ranking.
+   * Results of facets requested by user.
    * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ @java.lang.Override - public java.util.List< - ? extends com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> - getResultsOrBuilderList() { - return results_; + public java.util.List + getFacetsOrBuilderList() { + return facets_; } /** * * *
-   * A list of matched documents. The order represents the ranking.
+   * Results of facets requested by user.
    * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ @java.lang.Override - public int getResultsCount() { - return results_.size(); + public int getFacetsCount() { + return facets_.size(); } /** * * *
-   * A list of matched documents. The order represents the ranking.
+   * Results of facets requested by user.
    * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult getResults(int index) { - return results_.get(index); + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet getFacets(int index) { + return facets_.get(index); } /** * * *
-   * A list of matched documents. The order represents the ranking.
+   * Results of facets requested by user.
    * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder - getResultsOrBuilder(int index) { - return results_.get(index); + public com.google.cloud.discoveryengine.v1.SearchResponse.FacetOrBuilder getFacetsOrBuilder( + int index) { + return facets_.get(index); } public static final int TOTAL_SIZE_FIELD_NUMBER = 3; @@ -1195,6 +7513,67 @@ public com.google.protobuf.ByteString getAttributionTokenBytes() { } } + public static final int REDIRECT_URI_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object redirectUri_ = ""; + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search is performed, and only
+   * [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
+   * and
+   * [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
+   * are set in the response.
+   * 
+ * + * string redirect_uri = 12; + * + * @return The redirectUri. + */ + @java.lang.Override + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + 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(); + redirectUri_ = s; + return s; + } + } + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search is performed, and only
+   * [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
+   * and
+   * [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
+   * are set in the response.
+   * 
+ * + * string redirect_uri = 12; + * + * @return The bytes for redirectUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + redirectUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 5; @SuppressWarnings("serial") @@ -1307,6 +7686,123 @@ public com.google.protobuf.ByteString getCorrectedQueryBytes() { } } + public static final int SUMMARY_FIELD_NUMBER = 9; + private com.google.cloud.discoveryengine.v1.SearchResponse.Summary summary_; + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + * + * @return Whether the summary field is set. + */ + @java.lang.Override + public boolean hasSummary() { + return summary_ != null; + } + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + * + * @return The summary. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary getSummary() { + return summary_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder getSummaryOrBuilder() { + return summary_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + + public static final int QUERY_EXPANSION_INFO_FIELD_NUMBER = 14; + private com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo queryExpansionInfo_; + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + @java.lang.Override + public boolean hasQueryExpansionInfo() { + return queryExpansionInfo_ != null; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return The queryExpansionInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + getQueryExpansionInfo() { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.getDefaultInstance() + : queryExpansionInfo_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1324,6 +7820,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < results_.size(); i++) { output.writeMessage(1, results_.get(i)); } + for (int i = 0; i < facets_.size(); i++) { + output.writeMessage(2, facets_.get(i)); + } if (totalSize_ != 0) { output.writeInt32(3, totalSize_); } @@ -1336,6 +7835,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedQuery_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, correctedQuery_); } + if (summary_ != null) { + output.writeMessage(9, getSummary()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, redirectUri_); + } + if (queryExpansionInfo_ != null) { + output.writeMessage(14, getQueryExpansionInfo()); + } getUnknownFields().writeTo(output); } @@ -1348,6 +7856,9 @@ public int getSerializedSize() { for (int i = 0; i < results_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, results_.get(i)); } + for (int i = 0; i < facets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, facets_.get(i)); + } if (totalSize_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, totalSize_); } @@ -1360,6 +7871,15 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedQuery_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, correctedQuery_); } + if (summary_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getSummary()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, redirectUri_); + } + if (queryExpansionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getQueryExpansionInfo()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1377,10 +7897,20 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.discoveryengine.v1.SearchResponse) obj; if (!getResultsList().equals(other.getResultsList())) return false; + if (!getFacetsList().equals(other.getFacetsList())) return false; if (getTotalSize() != other.getTotalSize()) return false; if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getRedirectUri().equals(other.getRedirectUri())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; if (!getCorrectedQuery().equals(other.getCorrectedQuery())) return false; + if (hasSummary() != other.hasSummary()) return false; + if (hasSummary()) { + if (!getSummary().equals(other.getSummary())) return false; + } + if (hasQueryExpansionInfo() != other.hasQueryExpansionInfo()) return false; + if (hasQueryExpansionInfo()) { + if (!getQueryExpansionInfo().equals(other.getQueryExpansionInfo())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1396,14 +7926,28 @@ public int hashCode() { hash = (37 * hash) + RESULTS_FIELD_NUMBER; hash = (53 * hash) + getResultsList().hashCode(); } + if (getFacetsCount() > 0) { + hash = (37 * hash) + FACETS_FIELD_NUMBER; + hash = (53 * hash) + getFacetsList().hashCode(); + } hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; hash = (53 * hash) + getTotalSize(); hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getAttributionToken().hashCode(); + hash = (37 * hash) + REDIRECT_URI_FIELD_NUMBER; + hash = (53 * hash) + getRedirectUri().hashCode(); hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); hash = (37 * hash) + CORRECTED_QUERY_FIELD_NUMBER; hash = (53 * hash) + getCorrectedQuery().hashCode(); + if (hasSummary()) { + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummary().hashCode(); + } + if (hasQueryExpansionInfo()) { + hash = (37 * hash) + QUERY_EXPANSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionInfo().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1525,293 +8069,669 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.discoveryengine.v1.SearchResponse.class, - com.google.cloud.discoveryengine.v1.SearchResponse.Builder.class); + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.SearchResponse.class, + com.google.cloud.discoveryengine.v1.SearchResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.SearchResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + } else { + results_ = null; + resultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + } else { + facets_ = null; + facetsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + totalSize_ = 0; + attributionToken_ = ""; + redirectUri_ = ""; + nextPageToken_ = ""; + correctedQuery_ = ""; + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + queryExpansionInfo_ = null; + if (queryExpansionInfoBuilder_ != null) { + queryExpansionInfoBuilder_.dispose(); + queryExpansionInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_SearchResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.SearchResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse build() { + com.google.cloud.discoveryengine.v1.SearchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.SearchResponse buildPartial() { + com.google.cloud.discoveryengine.v1.SearchResponse result = + new com.google.cloud.discoveryengine.v1.SearchResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1.SearchResponse result) { + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + if (facetsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + facets_ = java.util.Collections.unmodifiableList(facets_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.facets_ = facets_; + } else { + result.facets_ = facetsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1.SearchResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.totalSize_ = totalSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.attributionToken_ = attributionToken_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.redirectUri_ = redirectUri_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.correctedQuery_ = correctedQuery_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.summary_ = summaryBuilder_ == null ? summary_ : summaryBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.queryExpansionInfo_ = + queryExpansionInfoBuilder_ == null + ? queryExpansionInfo_ + : queryExpansionInfoBuilder_.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); } - // Construct using com.google.cloud.discoveryengine.v1.SearchResponse.newBuilder() - private Builder() {} + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + @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 clear() { - super.clear(); - bitField0_ = 0; + 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.discoveryengine.v1.SearchResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1.SearchResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.SearchResponse other) { + if (other == com.google.cloud.discoveryengine.v1.SearchResponse.getDefaultInstance()) + return this; if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } } else { - results_ = null; - resultsBuilder_.clear(); + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } } - bitField0_ = (bitField0_ & ~0x00000001); - totalSize_ = 0; - attributionToken_ = ""; - nextPageToken_ = ""; - correctedQuery_ = ""; + if (facetsBuilder_ == null) { + if (!other.facets_.isEmpty()) { + if (facets_.isEmpty()) { + facets_ = other.facets_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFacetsIsMutable(); + facets_.addAll(other.facets_); + } + onChanged(); + } + } else { + if (!other.facets_.isEmpty()) { + if (facetsBuilder_.isEmpty()) { + facetsBuilder_.dispose(); + facetsBuilder_ = null; + facets_ = other.facets_; + bitField0_ = (bitField0_ & ~0x00000002); + facetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFacetsFieldBuilder() + : null; + } else { + facetsBuilder_.addAllMessages(other.facets_); + } + } + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getRedirectUri().isEmpty()) { + redirectUri_ = other.redirectUri_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getCorrectedQuery().isEmpty()) { + correctedQuery_ = other.correctedQuery_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasSummary()) { + mergeSummary(other.getSummary()); + } + if (other.hasQueryExpansionInfo()) { + mergeQueryExpansionInfo(other.getQueryExpansionInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); return this; } @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.discoveryengine.v1.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1_SearchResponse_descriptor; + public final boolean isInitialized() { + return true; } @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchResponse getDefaultInstanceForType() { - return com.google.cloud.discoveryengine.v1.SearchResponse.getDefaultInstance(); + 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.discoveryengine.v1.SearchResponse.SearchResult m = + input.readMessage( + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.parser(), + extensionRegistry); + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(m); + } else { + resultsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.discoveryengine.v1.SearchResponse.Facet m = + input.readMessage( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.parser(), + extensionRegistry); + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(m); + } else { + facetsBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + totalSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + attributionToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 58: + { + correctedQuery_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 74: + { + input.readMessage(getSummaryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 74 + case 98: + { + redirectUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 98 + case 114: + { + input.readMessage( + getQueryExpansionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 114 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; } - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchResponse build() { - com.google.cloud.discoveryengine.v1.SearchResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + private int bitField0_; + + private java.util.List + results_ = java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult>(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public java.util.List + getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); } - return result; } - - @java.lang.Override - public com.google.cloud.discoveryengine.v1.SearchResponse buildPartial() { - com.google.cloud.discoveryengine.v1.SearchResponse result = - new com.google.cloud.discoveryengine.v1.SearchResponse(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); } - onBuilt(); - return result; } - - private void buildPartialRepeatedFields( - com.google.cloud.discoveryengine.v1.SearchResponse result) { + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public Builder setResults( + int index, com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult value) { if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); + if (value == null) { + throw new NullPointerException(); } - result.results_ = results_; + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); } else { - result.results_ = resultsBuilder_.build(); + resultsBuilder_.setMessage(index, value); } + return this; } - - private void buildPartial0(com.google.cloud.discoveryengine.v1.SearchResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.totalSize_ = totalSize_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.attributionToken_ = attributionToken_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.nextPageToken_ = nextPageToken_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.correctedQuery_ = correctedQuery_; + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public Builder setResults( + int index, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); } + return this; } - - @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.discoveryengine.v1.SearchResponse) { - return mergeFrom((com.google.cloud.discoveryengine.v1.SearchResponse) other); + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); } else { - super.mergeFrom(other); - return this; + resultsBuilder_.addMessage(value); } + return this; } - - public Builder mergeFrom(com.google.cloud.discoveryengine.v1.SearchResponse other) { - if (other == com.google.cloud.discoveryengine.v1.SearchResponse.getDefaultInstance()) - return this; + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public Builder addResults( + int index, com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult value) { if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); + if (value == null) { + throw new NullPointerException(); } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getResultsFieldBuilder() - : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } + resultsBuilder_.addMessage(index, value); } - if (other.getTotalSize() != 0) { - setTotalSize(other.getTotalSize()); + return this; + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); } - if (!other.getAttributionToken().isEmpty()) { - attributionToken_ = other.attributionToken_; - bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public Builder addResults( + int index, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - bitField0_ |= 0x00000008; + return this; + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public Builder addAllResults( + java.lang.Iterable< + ? extends com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult> + values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); onChanged(); + } else { + resultsBuilder_.addAllMessages(values); } - if (!other.getCorrectedQuery().isEmpty()) { - correctedQuery_ = other.correctedQuery_; - bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); + } else { + resultsBuilder_.clear(); } - 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.discoveryengine.v1.SearchResponse.SearchResult m = - input.readMessage( - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.parser(), - extensionRegistry); - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(m); - } else { - resultsBuilder_.addMessage(m); - } - break; - } // case 10 - case 24: - { - totalSize_ = input.readInt32(); - bitField0_ |= 0x00000002; - break; - } // case 24 - case 34: - { - attributionToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 34 - case 42: - { - nextPageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; - break; - } // case 42 - case 58: - { - correctedQuery_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000010; - break; - } // case 58 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); onChanged(); - } // finally + } else { + resultsBuilder_.remove(index); + } return this; } - - private int bitField0_; - - private java.util.List - results_ = java.util.Collections.emptyList(); - - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = - new java.util.ArrayList< - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult>(results_); - bitField0_ |= 0x00000001; - } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder + getResultsBuilder(int index) { + return getResultsFieldBuilder().getBuilder(index); } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult, - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder, - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> - resultsBuilder_; - /** * * @@ -1822,12 +8742,12 @@ private void ensureResultsIsMutable() { * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; * */ - public java.util.List - getResultsList() { + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder + getResultsOrBuilder(int index) { if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); + return results_.get(index); } else { - return resultsBuilder_.getMessageList(); + return resultsBuilder_.getMessageOrBuilder(index); } } /** @@ -1840,11 +8760,13 @@ private void ensureResultsIsMutable() { * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; * */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); } else { - return resultsBuilder_.getCount(); + return java.util.Collections.unmodifiableList(results_); } } /** @@ -1857,34 +8779,148 @@ public int getResultsCount() { * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; * */ - public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder + addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder + addResultsBuilder(int index) { + return getResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.getDefaultInstance()); + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; + * + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder>( + results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private java.util.List facets_ = + java.util.Collections.emptyList(); + + private void ensureFacetsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + facets_ = + new java.util.ArrayList( + facets_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Facet, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.FacetOrBuilder> + facetsBuilder_; + + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; + */ + public java.util.List + getFacetsList() { + if (facetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(facets_); + } else { + return facetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; + */ + public int getFacetsCount() { + if (facetsBuilder_ == null) { + return facets_.size(); + } else { + return facetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet getFacets(int index) { + if (facetsBuilder_ == null) { + return facets_.get(index); } else { - return resultsBuilder_.getMessage(index); + return facetsBuilder_.getMessage(index); } } /** * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public Builder setResults( - int index, com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult value) { - if (resultsBuilder_ == null) { + public Builder setFacets( + int index, com.google.cloud.discoveryengine.v1.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureResultsIsMutable(); - results_.set(index, value); + ensureFacetsIsMutable(); + facets_.set(index, value); onChanged(); } else { - resultsBuilder_.setMessage(index, value); + facetsBuilder_.setMessage(index, value); } return this; } @@ -1892,21 +8928,20 @@ public Builder setResults( * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public Builder setResults( + public Builder setFacets( int index, - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.set(index, builderForValue.build()); onChanged(); } else { - resultsBuilder_.setMessage(index, builderForValue.build()); + facetsBuilder_.setMessage(index, builderForValue.build()); } return this; } @@ -1914,23 +8949,21 @@ public Builder setResults( * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public Builder addResults( - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult value) { - if (resultsBuilder_ == null) { + public Builder addFacets(com.google.cloud.discoveryengine.v1.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureResultsIsMutable(); - results_.add(value); + ensureFacetsIsMutable(); + facets_.add(value); onChanged(); } else { - resultsBuilder_.addMessage(value); + facetsBuilder_.addMessage(value); } return this; } @@ -1938,23 +8971,22 @@ public Builder addResults( * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public Builder addResults( - int index, com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult value) { - if (resultsBuilder_ == null) { + public Builder addFacets( + int index, com.google.cloud.discoveryengine.v1.SearchResponse.Facet value) { + if (facetsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureResultsIsMutable(); - results_.add(index, value); + ensureFacetsIsMutable(); + facets_.add(index, value); onChanged(); } else { - resultsBuilder_.addMessage(index, value); + facetsBuilder_.addMessage(index, value); } return this; } @@ -1962,20 +8994,19 @@ public Builder addResults( * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public Builder addResults( - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); + public Builder addFacets( + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(builderForValue.build()); onChanged(); } else { - resultsBuilder_.addMessage(builderForValue.build()); + facetsBuilder_.addMessage(builderForValue.build()); } return this; } @@ -1983,21 +9014,20 @@ public Builder addResults( * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public Builder addResults( + public Builder addFacets( int index, - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder builderForValue) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(index, builderForValue.build()); onChanged(); } else { - resultsBuilder_.addMessage(index, builderForValue.build()); + facetsBuilder_.addMessage(index, builderForValue.build()); } return this; } @@ -2005,22 +9035,20 @@ public Builder addResults( * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public Builder addAllResults( - java.lang.Iterable< - ? extends com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult> + public Builder addAllFacets( + java.lang.Iterable values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facets_); onChanged(); } else { - resultsBuilder_.addAllMessages(values); + facetsBuilder_.addAllMessages(values); } return this; } @@ -2028,19 +9056,18 @@ public Builder addAllResults( * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + public Builder clearFacets() { + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { - resultsBuilder_.clear(); + facetsBuilder_.clear(); } return this; } @@ -2048,19 +9075,18 @@ public Builder clearResults() { * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); + public Builder removeFacets(int index) { + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.remove(index); onChanged(); } else { - resultsBuilder_.remove(index); + facetsBuilder_.remove(index); } return this; } @@ -2068,116 +9094,108 @@ public Builder removeResults(int index) { * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder - getResultsBuilder(int index) { - return getResultsFieldBuilder().getBuilder(index); + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder getFacetsBuilder( + int index) { + return getFacetsFieldBuilder().getBuilder(index); } /** * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder - getResultsOrBuilder(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); + public com.google.cloud.discoveryengine.v1.SearchResponse.FacetOrBuilder getFacetsOrBuilder( + int index) { + if (facetsBuilder_ == null) { + return facets_.get(index); } else { - return resultsBuilder_.getMessageOrBuilder(index); + return facetsBuilder_.getMessageOrBuilder(index); } } /** * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ public java.util.List< - ? extends com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); + ? extends com.google.cloud.discoveryengine.v1.SearchResponse.FacetOrBuilder> + getFacetsOrBuilderList() { + if (facetsBuilder_ != null) { + return facetsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(results_); + return java.util.Collections.unmodifiableList(facets_); } } /** * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder - addResultsBuilder() { - return getResultsFieldBuilder() + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder addFacetsBuilder() { + return getFacetsFieldBuilder() .addBuilder( - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.getDefaultInstance()); + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.getDefaultInstance()); } /** * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder - addResultsBuilder(int index) { - return getResultsFieldBuilder() + public com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder addFacetsBuilder( + int index) { + return getFacetsFieldBuilder() .addBuilder( - index, - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.getDefaultInstance()); + index, com.google.cloud.discoveryengine.v1.SearchResponse.Facet.getDefaultInstance()); } /** * * *
-     * A list of matched documents. The order represents the ranking.
+     * Results of facets requested by user.
      * 
* - * repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult results = 1; - * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); + public java.util.List + getFacetsBuilderList() { + return getFacetsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult, - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder, - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = + com.google.cloud.discoveryengine.v1.SearchResponse.Facet, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.FacetOrBuilder> + getFacetsFieldBuilder() { + if (facetsBuilder_ == null) { + facetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult, - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.Builder, - com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder>( - results_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - results_ = null; + com.google.cloud.discoveryengine.v1.SearchResponse.Facet, + com.google.cloud.discoveryengine.v1.SearchResponse.Facet.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.FacetOrBuilder>( + facets_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + facets_ = null; } - return resultsBuilder_; + return facetsBuilder_; } private int totalSize_; @@ -2219,7 +9237,7 @@ public int getTotalSize() { public Builder setTotalSize(int value) { totalSize_ = value; - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -2239,7 +9257,7 @@ public Builder setTotalSize(int value) { * @return This builder for chaining. */ public Builder clearTotalSize() { - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); totalSize_ = 0; onChanged(); return this; @@ -2265,7 +9283,130 @@ public java.lang.String getAttributionToken() { if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - attributionToken_ = s; + attributionToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
+     * this search, which enables accurate attribution of search model
+     * performance.
+     * 
+ * + * string attribution_token = 4; + * + * @return The bytes for attributionToken. + */ + public com.google.protobuf.ByteString getAttributionTokenBytes() { + java.lang.Object ref = attributionToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributionToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
+     * this search, which enables accurate attribution of search model
+     * performance.
+     * 
+ * + * string attribution_token = 4; + * + * @param value The attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + attributionToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
+     * this search, which enables accurate attribution of search model
+     * performance.
+     * 
+ * + * string attribution_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + attributionToken_ = getDefaultInstance().getAttributionToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
+     * this search, which enables accurate attribution of search model
+     * performance.
+     * 
+ * + * string attribution_token = 4; + * + * @param value The bytes for attributionToken to set. + * @return This builder for chaining. + */ + public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + attributionToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object redirectUri_ = ""; + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search is performed, and only
+     * [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
+     * and
+     * [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
+     * are set in the response.
+     * 
+ * + * string redirect_uri = 12; + * + * @return The redirectUri. + */ + public java.lang.String getRedirectUri() { + java.lang.Object ref = redirectUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + redirectUri_ = s; return s; } else { return (java.lang.String) ref; @@ -2275,22 +9416,24 @@ public java.lang.String getAttributionToken() { * * *
-     * A unique search token. This should be included in the
-     * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
-     * this search, which enables accurate attribution of search model
-     * performance.
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search is performed, and only
+     * [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
+     * and
+     * [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
+     * are set in the response.
      * 
* - * string attribution_token = 4; + * string redirect_uri = 12; * - * @return The bytes for attributionToken. + * @return The bytes for redirectUri. */ - public com.google.protobuf.ByteString getAttributionTokenBytes() { - java.lang.Object ref = attributionToken_; + public com.google.protobuf.ByteString getRedirectUriBytes() { + java.lang.Object ref = redirectUri_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - attributionToken_ = b; + redirectUri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -2300,23 +9443,25 @@ public com.google.protobuf.ByteString getAttributionTokenBytes() { * * *
-     * A unique search token. This should be included in the
-     * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
-     * this search, which enables accurate attribution of search model
-     * performance.
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search is performed, and only
+     * [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
+     * and
+     * [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
+     * are set in the response.
      * 
* - * string attribution_token = 4; + * string redirect_uri = 12; * - * @param value The attributionToken to set. + * @param value The redirectUri to set. * @return This builder for chaining. */ - public Builder setAttributionToken(java.lang.String value) { + public Builder setRedirectUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - attributionToken_ = value; - bitField0_ |= 0x00000004; + redirectUri_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -2324,19 +9469,21 @@ public Builder setAttributionToken(java.lang.String value) { * * *
-     * A unique search token. This should be included in the
-     * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
-     * this search, which enables accurate attribution of search model
-     * performance.
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search is performed, and only
+     * [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
+     * and
+     * [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
+     * are set in the response.
      * 
* - * string attribution_token = 4; + * string redirect_uri = 12; * * @return This builder for chaining. */ - public Builder clearAttributionToken() { - attributionToken_ = getDefaultInstance().getAttributionToken(); - bitField0_ = (bitField0_ & ~0x00000004); + public Builder clearRedirectUri() { + redirectUri_ = getDefaultInstance().getRedirectUri(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } @@ -2344,24 +9491,26 @@ public Builder clearAttributionToken() { * * *
-     * A unique search token. This should be included in the
-     * [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
-     * this search, which enables accurate attribution of search model
-     * performance.
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search is performed, and only
+     * [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
+     * and
+     * [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
+     * are set in the response.
      * 
* - * string attribution_token = 4; + * string redirect_uri = 12; * - * @param value The bytes for attributionToken to set. + * @param value The bytes for redirectUri to set. * @return This builder for chaining. */ - public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { + public Builder setRedirectUriBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - attributionToken_ = value; - bitField0_ |= 0x00000004; + redirectUri_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -2437,7 +9586,7 @@ public Builder setNextPageToken(java.lang.String value) { throw new NullPointerException(); } nextPageToken_ = value; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -2457,7 +9606,7 @@ public Builder setNextPageToken(java.lang.String value) { */ public Builder clearNextPageToken() { nextPageToken_ = getDefaultInstance().getNextPageToken(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } @@ -2482,7 +9631,7 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); nextPageToken_ = value; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -2555,7 +9704,7 @@ public Builder setCorrectedQuery(java.lang.String value) { throw new NullPointerException(); } correctedQuery_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2574,7 +9723,7 @@ public Builder setCorrectedQuery(java.lang.String value) { */ public Builder clearCorrectedQuery() { correctedQuery_ = getDefaultInstance().getCorrectedQuery(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } @@ -2598,10 +9747,437 @@ public Builder setCorrectedQueryBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); correctedQuery_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1.SearchResponse.Summary summary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder> + summaryBuilder_; + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + * + * @return Whether the summary field is set. + */ + public boolean hasSummary() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + * + * @return The summary. + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary getSummary() { + if (summaryBuilder_ == null) { + return summary_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.getDefaultInstance() + : summary_; + } else { + return summaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + */ + public Builder setSummary(com.google.cloud.discoveryengine.v1.SearchResponse.Summary value) { + if (summaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summary_ = value; + } else { + summaryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + */ + public Builder setSummary( + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder builderForValue) { + if (summaryBuilder_ == null) { + summary_ = builderForValue.build(); + } else { + summaryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + */ + public Builder mergeSummary(com.google.cloud.discoveryengine.v1.SearchResponse.Summary value) { + if (summaryBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && summary_ != null + && summary_ + != com.google.cloud.discoveryengine.v1.SearchResponse.Summary + .getDefaultInstance()) { + getSummaryBuilder().mergeFrom(value); + } else { + summary_ = value; + } + } else { + summaryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + */ + public Builder clearSummary() { + bitField0_ = (bitField0_ & ~0x00000080); + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder getSummaryBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder + getSummaryOrBuilder() { + if (summaryBuilder_ != null) { + return summaryBuilder_.getMessageOrBuilder(); + } else { + return summary_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder> + getSummaryFieldBuilder() { + if (summaryBuilder_ == null) { + summaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder>( + getSummary(), getParentForChildren(), isClean()); + summary_ = null; + } + return summaryBuilder_; + } + + private com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + queryExpansionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo, + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfoOrBuilder> + queryExpansionInfoBuilder_; + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + public boolean hasQueryExpansionInfo() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return The queryExpansionInfo. + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + getQueryExpansionInfo() { + if (queryExpansionInfoBuilder_ == null) { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + .getDefaultInstance() + : queryExpansionInfo_; + } else { + return queryExpansionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryExpansionInfo_ = value; + } else { + queryExpansionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.Builder + builderForValue) { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = builderForValue.build(); + } else { + queryExpansionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder mergeQueryExpansionInfo( + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && queryExpansionInfo_ != null + && queryExpansionInfo_ + != com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + .getDefaultInstance()) { + getQueryExpansionInfoBuilder().mergeFrom(value); + } else { + queryExpansionInfo_ = value; + } + } else { + queryExpansionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder clearQueryExpansionInfo() { + bitField0_ = (bitField0_ & ~0x00000100); + queryExpansionInfo_ = null; + if (queryExpansionInfoBuilder_ != null) { + queryExpansionInfoBuilder_.dispose(); + queryExpansionInfoBuilder_ = null; + } onChanged(); return this; } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.Builder + getQueryExpansionInfoBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getQueryExpansionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + if (queryExpansionInfoBuilder_ != null) { + return queryExpansionInfoBuilder_.getMessageOrBuilder(); + } else { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo + .getDefaultInstance() + : queryExpansionInfo_; + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo, + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfoOrBuilder> + getQueryExpansionInfoFieldBuilder() { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo, + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfoOrBuilder>( + getQueryExpansionInfo(), getParentForChildren(), isClean()); + queryExpansionInfo_ = null; + } + return queryExpansionInfoBuilder_; + } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchResponseOrBuilder.java index 2401c03dbd10..1a17405b5d28 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchResponseOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchResponseOrBuilder.java @@ -76,6 +76,58 @@ public interface SearchResponseOrBuilder com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( int index); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; + */ + java.util.List getFacetsList(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; + */ + com.google.cloud.discoveryengine.v1.SearchResponse.Facet getFacets(int index); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; + */ + int getFacetsCount(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; + */ + java.util.List + getFacetsOrBuilderList(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1.SearchResponse.Facet facets = 2; + */ + com.google.cloud.discoveryengine.v1.SearchResponse.FacetOrBuilder getFacetsOrBuilder(int index); + /** * * @@ -124,6 +176,41 @@ com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder getResu */ com.google.protobuf.ByteString getAttributionTokenBytes(); + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search is performed, and only
+   * [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
+   * and
+   * [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
+   * are set in the response.
+   * 
+ * + * string redirect_uri = 12; + * + * @return The redirectUri. + */ + java.lang.String getRedirectUri(); + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search is performed, and only
+   * [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
+   * and
+   * [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
+   * are set in the response.
+   * 
+ * + * string redirect_uri = 12; + * + * @return The bytes for redirectUri. + */ + com.google.protobuf.ByteString getRedirectUriBytes(); + /** * * @@ -183,4 +270,90 @@ com.google.cloud.discoveryengine.v1.SearchResponse.SearchResultOrBuilder getResu * @return The bytes for correctedQuery. */ com.google.protobuf.ByteString getCorrectedQueryBytes(); + + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + * + * @return Whether the summary field is set. + */ + boolean hasSummary(); + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + * + * @return The summary. + */ + com.google.cloud.discoveryengine.v1.SearchResponse.Summary getSummary(); + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1.SearchResponse.Summary summary = 9; + */ + com.google.cloud.discoveryengine.v1.SearchResponse.SummaryOrBuilder getSummaryOrBuilder(); + + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + boolean hasQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return The queryExpansionInfo. + */ + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo getQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + com.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder(); } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchServiceProto.java index fa569e27436c..e6b3cbcd5eae 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchServiceProto.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/SearchServiceProto.java @@ -31,6 +31,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_discoveryengine_v1_SearchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ImageQuery_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ImageQuery_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_FacetKey_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -47,6 +67,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SummarySpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SummarySpec_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_discoveryengine_v1_SearchRequest_ParamsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -63,6 +87,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_discoveryengine_v1_SearchResponse_SearchResult_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_discoveryengine_v1_SearchResponse_SearchResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_FacetValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_FacetValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_SafetyAttributes_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1_SearchResponse_QueryExpansionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1_SearchResponse_QueryExpansionInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -80,67 +124,125 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "to\032,google/cloud/discoveryengine/v1/comm" + "on.proto\032.google/cloud/discoveryengine/v" + "1/document.proto\032\034google/protobuf/struct" - + ".proto\"\250\013\n\rSearchRequest\022M\n\016serving_conf" + + ".proto\"\350\024\n\rSearchRequest\022M\n\016serving_conf" + "ig\030\001 \001(\tB5\342A\001\002\372A.\n,discoveryengine.googl" + "eapis.com/ServingConfig\022:\n\006branch\030\002 \001(\tB" + "*\372A\'\n%discoveryengine.googleapis.com/Bra" - + "nch\022\r\n\005query\030\003 \001(\t\022\021\n\tpage_size\030\004 \001(\005\022\022\n" - + "\npage_token\030\005 \001(\t\022\016\n\006offset\030\006 \001(\005\022<\n\tuse" - + "r_info\030\025 \001(\0132).google.cloud.discoveryeng" - + "ine.v1.UserInfo\022J\n\006params\030\013 \003(\0132:.google" - + ".cloud.discoveryengine.v1.SearchRequest." - + "ParamsEntry\022_\n\024query_expansion_spec\030\r \001(" - + "\0132A.google.cloud.discoveryengine.v1.Sear" - + "chRequest.QueryExpansionSpec\022a\n\025spell_co" - + "rrection_spec\030\016 \001(\0132B.google.cloud.disco" - + "veryengine.v1.SearchRequest.SpellCorrect" - + "ionSpec\022\026\n\016user_pseudo_id\030\017 \001(\t\022]\n\023conte" - + "nt_search_spec\030\030 \001(\0132@.google.cloud.disc" - + "overyengine.v1.SearchRequest.ContentSear" - + "chSpec\022\023\n\013safe_search\030\024 \001(\010\022S\n\013user_labe" - + "ls\030\026 \003(\0132>.google.cloud.discoveryengine." - + "v1.SearchRequest.UserLabelsEntry\032\264\001\n\022Que" + + "nch\022\r\n\005query\030\003 \001(\t\022N\n\013image_query\030\023 \001(\0132" + + "9.google.cloud.discoveryengine.v1.Search" + + "Request.ImageQuery\022\021\n\tpage_size\030\004 \001(\005\022\022\n" + + "\npage_token\030\005 \001(\t\022\016\n\006offset\030\006 \001(\005\022\016\n\006fil" + + "ter\030\007 \001(\t\022\020\n\010order_by\030\010 \001(\t\022<\n\tuser_info" + + "\030\025 \001(\0132).google.cloud.discoveryengine.v1" + + ".UserInfo\022M\n\013facet_specs\030\t \003(\01328.google." + + "cloud.discoveryengine.v1.SearchRequest.F" + + "acetSpec\022L\n\nboost_spec\030\n \001(\01328.google.cl" + + "oud.discoveryengine.v1.SearchRequest.Boo" + + "stSpec\022J\n\006params\030\013 \003(\0132:.google.cloud.di" + + "scoveryengine.v1.SearchRequest.ParamsEnt" + + "ry\022_\n\024query_expansion_spec\030\r \001(\0132A.googl" + + "e.cloud.discoveryengine.v1.SearchRequest" + + ".QueryExpansionSpec\022a\n\025spell_correction_" + + "spec\030\016 \001(\0132B.google.cloud.discoveryengin" + + "e.v1.SearchRequest.SpellCorrectionSpec\022\026" + + "\n\016user_pseudo_id\030\017 \001(\t\022]\n\023content_search" + + "_spec\030\030 \001(\0132@.google.cloud.discoveryengi" + + "ne.v1.SearchRequest.ContentSearchSpec\022\023\n" + + "\013safe_search\030\024 \001(\010\022S\n\013user_labels\030\026 \003(\0132" + + ">.google.cloud.discoveryengine.v1.Search" + + "Request.UserLabelsEntry\032,\n\nImageQuery\022\025\n" + + "\013image_bytes\030\001 \001(\tH\000B\007\n\005image\032\376\002\n\tFacetS" + + "pec\022Z\n\tfacet_key\030\001 \001(\0132A.google.cloud.di" + + "scoveryengine.v1.SearchRequest.FacetSpec" + + ".FacetKeyB\004\342A\001\002\022\r\n\005limit\030\002 \001(\005\022\034\n\024exclud" + + "ed_filter_keys\030\003 \003(\t\022\037\n\027enable_dynamic_p" + + "osition\030\004 \001(\010\032\306\001\n\010FacetKey\022\021\n\003key\030\001 \001(\tB" + + "\004\342A\001\002\022<\n\tintervals\030\002 \003(\0132).google.cloud." + + "discoveryengine.v1.Interval\022\031\n\021restricte" + + "d_values\030\003 \003(\t\022\020\n\010prefixes\030\004 \003(\t\022\020\n\010cont" + + "ains\030\005 \003(\t\022\030\n\020case_insensitive\030\006 \001(\010\022\020\n\010" + + "order_by\030\007 \001(\t\032\257\001\n\tBoostSpec\022j\n\025conditio" + + "n_boost_specs\030\001 \003(\0132K.google.cloud.disco" + + "veryengine.v1.SearchRequest.BoostSpec.Co" + + "nditionBoostSpec\0326\n\022ConditionBoostSpec\022\021" + + "\n\tcondition\030\001 \001(\t\022\r\n\005boost\030\002 \001(\002\032\324\001\n\022Que" + "ryExpansionSpec\022^\n\tcondition\030\001 \001(\0162K.goo" + "gle.cloud.discoveryengine.v1.SearchReque" - + "st.QueryExpansionSpec.Condition\">\n\tCondi" - + "tion\022\031\n\025CONDITION_UNSPECIFIED\020\000\022\014\n\010DISAB" - + "LED\020\001\022\010\n\004AUTO\020\002\032\251\001\n\023SpellCorrectionSpec\022" - + "U\n\004mode\030\001 \001(\0162G.google.cloud.discoveryen" - + "gine.v1.SearchRequest.SpellCorrectionSpe" - + "c.Mode\";\n\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\023\n\017" - + "SUGGESTION_ONLY\020\001\022\010\n\004AUTO\020\002\032\271\001\n\021ContentS" - + "earchSpec\022b\n\014snippet_spec\030\001 \001(\0132L.google" - + ".cloud.discoveryengine.v1.SearchRequest." - + "ContentSearchSpec.SnippetSpec\032@\n\013Snippet" - + "Spec\022\031\n\021max_snippet_count\030\001 \001(\005\022\026\n\016refer" - + "ence_only\030\002 \001(\010\032E\n\013ParamsEntry\022\013\n\003key\030\001 " - + "\001(\t\022%\n\005value\030\002 \001(\0132\026.google.protobuf.Val" - + "ue:\0028\001\0321\n\017UserLabelsEntry\022\013\n\003key\030\001 \001(\t\022\r" - + "\n\005value\030\002 \001(\t:\0028\001\"\231\002\n\016SearchResponse\022M\n\007" - + "results\030\001 \003(\0132<.google.cloud.discoveryen" - + "gine.v1.SearchResponse.SearchResult\022\022\n\nt" - + "otal_size\030\003 \001(\005\022\031\n\021attribution_token\030\004 \001" - + "(\t\022\027\n\017next_page_token\030\005 \001(\t\022\027\n\017corrected" - + "_query\030\007 \001(\t\032W\n\014SearchResult\022\n\n\002id\030\001 \001(\t" - + "\022;\n\010document\030\002 \001(\0132).google.cloud.discov" - + "eryengine.v1.Document2\223\003\n\rSearchService\022" - + "\255\002\n\006Search\022..google.cloud.discoveryengin" - + "e.v1.SearchRequest\032/.google.cloud.discov" - + "eryengine.v1.SearchResponse\"\301\001\202\323\344\223\002\272\001\"P/" - + "v1/{serving_config=projects/*/locations/" - + "*/dataStores/*/servingConfigs/*}:search:" - + "\001*Zc\"^/v1/{serving_config=projects/*/loc" - + "ations/*/collections/*/dataStores/*/serv" - + "ingConfigs/*}:search:\001*\032R\312A\036discoveryeng" - + "ine.googleapis.com\322A.https://www.googlea" - + "pis.com/auth/cloud-platformB\205\002\n#com.goog" - + "le.cloud.discoveryengine.v1B\022SearchServi" - + "ceProtoP\001ZMcloud.google.com/go/discovery" - + "engine/apiv1/discoveryenginepb;discovery" - + "enginepb\242\002\017DISCOVERYENGINE\252\002\037Google.Clou" - + "d.DiscoveryEngine.V1\312\002\037Google\\Cloud\\Disc" - + "overyEngine\\V1\352\002\"Google::Cloud::Discover" - + "yEngine::V1b\006proto3" + + "st.QueryExpansionSpec.Condition\022\036\n\026pin_u" + + "nexpanded_results\030\002 \001(\010\">\n\tCondition\022\031\n\025" + + "CONDITION_UNSPECIFIED\020\000\022\014\n\010DISABLED\020\001\022\010\n" + + "\004AUTO\020\002\032\251\001\n\023SpellCorrectionSpec\022U\n\004mode\030" + + "\001 \001(\0162G.google.cloud.discoveryengine.v1." + + "SearchRequest.SpellCorrectionSpec.Mode\";" + + "\n\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\023\n\017SUGGESTI" + + "ON_ONLY\020\001\022\010\n\004AUTO\020\002\032\351\003\n\021ContentSearchSpe" + + "c\022b\n\014snippet_spec\030\001 \001(\0132L.google.cloud.d" + + "iscoveryengine.v1.SearchRequest.ContentS" + + "earchSpec.SnippetSpec\022b\n\014summary_spec\030\002 " + + "\001(\0132L.google.cloud.discoveryengine.v1.Se" + + "archRequest.ContentSearchSpec.SummarySpe" + + "c\032`\n\013SnippetSpec\022\035\n\021max_snippet_count\030\001 " + + "\001(\005B\002\030\001\022\032\n\016reference_only\030\002 \001(\010B\002\030\001\022\026\n\016r" + + "eturn_snippet\030\003 \001(\010\032\251\001\n\013SummarySpec\022\034\n\024s" + + "ummary_result_count\030\001 \001(\005\022\031\n\021include_cit" + + "ations\030\002 \001(\010\022 \n\030ignore_adversarial_query" + + "\030\003 \001(\010\022(\n ignore_non_summary_seeking_que" + + "ry\030\004 \001(\010\022\025\n\rlanguage_code\030\006 \001(\t\032E\n\013Param" + + "sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo" + + "gle.protobuf.Value:\0028\001\0321\n\017UserLabelsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\372\n\n\016Se" + + "archResponse\022M\n\007results\030\001 \003(\0132<.google.c" + + "loud.discoveryengine.v1.SearchResponse.S" + + "earchResult\022E\n\006facets\030\002 \003(\01325.google.clo" + + "ud.discoveryengine.v1.SearchResponse.Fac" + + "et\022\022\n\ntotal_size\030\003 \001(\005\022\031\n\021attribution_to" + + "ken\030\004 \001(\t\022\024\n\014redirect_uri\030\014 \001(\t\022\027\n\017next_" + + "page_token\030\005 \001(\t\022\027\n\017corrected_query\030\007 \001(" + + "\t\022H\n\007summary\030\t \001(\01327.google.cloud.discov" + + "eryengine.v1.SearchResponse.Summary\022`\n\024q" + + "uery_expansion_info\030\016 \001(\0132B.google.cloud" + + ".discoveryengine.v1.SearchResponse.Query" + + "ExpansionInfo\032W\n\014SearchResult\022\n\n\002id\030\001 \001(" + + "\t\022;\n\010document\030\002 \001(\0132).google.cloud.disco" + + "veryengine.v1.Document\032\371\001\n\005Facet\022\013\n\003key\030" + + "\001 \001(\t\022P\n\006values\030\002 \003(\0132@.google.cloud.dis" + + "coveryengine.v1.SearchResponse.Facet.Fac" + + "etValue\022\025\n\rdynamic_facet\030\003 \001(\010\032z\n\nFacetV" + + "alue\022\017\n\005value\030\001 \001(\tH\000\022=\n\010interval\030\002 \001(\0132" + + ").google.cloud.discoveryengine.v1.Interv" + + "alH\000\022\r\n\005count\030\003 \001(\003B\r\n\013facet_value\032\216\004\n\007S" + + "ummary\022\024\n\014summary_text\030\001 \001(\t\022m\n\027summary_" + + "skipped_reasons\030\002 \003(\0162L.google.cloud.dis" + + "coveryengine.v1.SearchResponse.Summary.S" + + "ummarySkippedReason\022c\n\021safety_attributes" + + "\030\003 \001(\0132H.google.cloud.discoveryengine.v1" + + ".SearchResponse.Summary.SafetyAttributes" + + "\0326\n\020SafetyAttributes\022\022\n\ncategories\030\001 \003(\t" + + "\022\016\n\006scores\030\002 \003(\002\"\340\001\n\024SummarySkippedReaso" + + "n\022&\n\"SUMMARY_SKIPPED_REASON_UNSPECIFIED\020" + + "\000\022\035\n\031ADVERSARIAL_QUERY_IGNORED\020\001\022%\n!NON_" + + "SUMMARY_SEEKING_QUERY_IGNORED\020\002\022\037\n\033OUT_O" + + "F_DOMAIN_QUERY_IGNORED\020\003\022\036\n\032POTENTIAL_PO" + + "LICY_VIOLATION\020\004\022\031\n\025LLM_ADDON_NOT_ENABLE" + + "D\020\005\032I\n\022QueryExpansionInfo\022\026\n\016expanded_qu" + + "ery\030\001 \001(\010\022\033\n\023pinned_result_count\030\002 \001(\0032\223" + + "\003\n\rSearchService\022\255\002\n\006Search\022..google.clo" + + "ud.discoveryengine.v1.SearchRequest\032/.go" + + "ogle.cloud.discoveryengine.v1.SearchResp" + + "onse\"\301\001\202\323\344\223\002\272\001\"P/v1/{serving_config=proj" + + "ects/*/locations/*/dataStores/*/servingC" + + "onfigs/*}:search:\001*Zc\"^/v1/{serving_conf" + + "ig=projects/*/locations/*/collections/*/" + + "dataStores/*/servingConfigs/*}:search:\001*" + + "\032R\312A\036discoveryengine.googleapis.com\322A.ht" + + "tps://www.googleapis.com/auth/cloud-plat" + + "formB\205\002\n#com.google.cloud.discoveryengin" + + "e.v1B\022SearchServiceProtoP\001ZMcloud.google" + + ".com/go/discoveryengine/apiv1/discoverye" + + "nginepb;discoveryenginepb\242\002\017DISCOVERYENG" + + "INE\252\002\037Google.Cloud.DiscoveryEngine.V1\312\002\037" + + "Google\\Cloud\\DiscoveryEngine\\V1\352\002\"Google" + + "::Cloud::DiscoveryEngine::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -163,10 +265,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ServingConfig", "Branch", "Query", + "ImageQuery", "PageSize", "PageToken", "Offset", + "Filter", + "OrderBy", "UserInfo", + "FacetSpecs", + "BoostSpec", "Params", "QueryExpansionSpec", "SpellCorrectionSpec", @@ -175,20 +282,76 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SafeSearch", "UserLabels", }); - internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ImageQuery_descriptor = internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor .getNestedTypes() .get(0); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ImageQuery_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ImageQuery_descriptor, + new java.lang.String[] { + "ImageBytes", "Image", + }); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_descriptor, + new java.lang.String[] { + "FacetKey", "Limit", "ExcludedFilterKeys", "EnableDynamicPosition", + }); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_FacetKey_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchRequest_FacetSpec_FacetKey_descriptor, + new java.lang.String[] { + "Key", + "Intervals", + "RestrictedValues", + "Prefixes", + "Contains", + "CaseInsensitive", + "OrderBy", + }); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_descriptor, + new java.lang.String[] { + "ConditionBoostSpecs", + }); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor, + new java.lang.String[] { + "Condition", "Boost", + }); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor + .getNestedTypes() + .get(3); internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_SearchRequest_QueryExpansionSpec_descriptor, new java.lang.String[] { - "Condition", + "Condition", "PinUnexpandedResults", }); internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_descriptor = internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor .getNestedTypes() - .get(1); + .get(4); internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_SearchRequest_SpellCorrectionSpec_descriptor, @@ -198,12 +361,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_descriptor = internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor .getNestedTypes() - .get(2); + .get(5); internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_descriptor, new java.lang.String[] { - "SnippetSpec", + "SnippetSpec", "SummarySpec", }); internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor = internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_descriptor @@ -213,12 +376,26 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor, new java.lang.String[] { - "MaxSnippetCount", "ReferenceOnly", + "MaxSnippetCount", "ReferenceOnly", "ReturnSnippet", + }); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SummarySpec_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SummarySpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchRequest_ContentSearchSpec_SummarySpec_descriptor, + new java.lang.String[] { + "SummaryResultCount", + "IncludeCitations", + "IgnoreAdversarialQuery", + "IgnoreNonSummarySeekingQuery", + "LanguageCode", }); internal_static_google_cloud_discoveryengine_v1_SearchRequest_ParamsEntry_descriptor = internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor .getNestedTypes() - .get(3); + .get(6); internal_static_google_cloud_discoveryengine_v1_SearchRequest_ParamsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_SearchRequest_ParamsEntry_descriptor, @@ -228,7 +405,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { internal_static_google_cloud_discoveryengine_v1_SearchRequest_UserLabelsEntry_descriptor = internal_static_google_cloud_discoveryengine_v1_SearchRequest_descriptor .getNestedTypes() - .get(4); + .get(7); internal_static_google_cloud_discoveryengine_v1_SearchRequest_UserLabelsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_SearchRequest_UserLabelsEntry_descriptor, @@ -241,7 +418,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1_SearchResponse_descriptor, new java.lang.String[] { - "Results", "TotalSize", "AttributionToken", "NextPageToken", "CorrectedQuery", + "Results", + "Facets", + "TotalSize", + "AttributionToken", + "RedirectUri", + "NextPageToken", + "CorrectedQuery", + "Summary", + "QueryExpansionInfo", }); internal_static_google_cloud_discoveryengine_v1_SearchResponse_SearchResult_descriptor = internal_static_google_cloud_discoveryengine_v1_SearchResponse_descriptor @@ -253,6 +438,56 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Id", "Document", }); + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_descriptor, + new java.lang.String[] { + "Key", "Values", "DynamicFacet", + }); + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_FacetValue_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_FacetValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Facet_FacetValue_descriptor, + new java.lang.String[] { + "Value", "Interval", "Count", "FacetValue", + }); + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchResponse_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_descriptor, + new java.lang.String[] { + "SummaryText", "SummarySkippedReasons", "SafetyAttributes", + }); + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_SafetyAttributes_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchResponse_Summary_SafetyAttributes_descriptor, + new java.lang.String[] { + "Categories", "Scores", + }); + internal_static_google_cloud_discoveryengine_v1_SearchResponse_QueryExpansionInfo_descriptor = + internal_static_google_cloud_discoveryengine_v1_SearchResponse_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_discoveryengine_v1_SearchResponse_QueryExpansionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1_SearchResponse_QueryExpansionInfo_descriptor, + new java.lang.String[] { + "ExpandedQuery", "PinnedResultCount", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/TextInput.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/TextInput.java new file mode 100644 index 000000000000..ee0537460a11 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/TextInput.java @@ -0,0 +1,889 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Defines text input.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.TextInput} + */ +public final class TextInput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.TextInput) + TextInputOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextInput.newBuilder() to construct. + private TextInput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextInput() { + input_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TextInput(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_TextInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_TextInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.TextInput.class, + com.google.cloud.discoveryengine.v1.TextInput.Builder.class); + } + + public static final int INPUT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object input_ = ""; + /** + * + * + *
+   * Text input.
+   * 
+ * + * string input = 1; + * + * @return The input. + */ + @java.lang.Override + public java.lang.String getInput() { + java.lang.Object ref = input_; + 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(); + input_ = s; + return s; + } + } + /** + * + * + *
+   * Text input.
+   * 
+ * + * string input = 1; + * + * @return The bytes for input. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInputBytes() { + java.lang.Object ref = input_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + input_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTEXT_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1.ConversationContext context_; + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + * + * @return Whether the context field is set. + */ + @java.lang.Override + public boolean hasContext() { + return context_ != null; + } + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + * + * @return The context. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationContext getContext() { + return context_ == null + ? com.google.cloud.discoveryengine.v1.ConversationContext.getDefaultInstance() + : context_; + } + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationContextOrBuilder getContextOrBuilder() { + return context_ == null + ? com.google.cloud.discoveryengine.v1.ConversationContext.getDefaultInstance() + : context_; + } + + 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(input_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, input_); + } + if (context_ != null) { + output.writeMessage(2, getContext()); + } + 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(input_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, input_); + } + if (context_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getContext()); + } + 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.discoveryengine.v1.TextInput)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.TextInput other = + (com.google.cloud.discoveryengine.v1.TextInput) obj; + + if (!getInput().equals(other.getInput())) return false; + if (hasContext() != other.hasContext()) return false; + if (hasContext()) { + if (!getContext().equals(other.getContext())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INPUT_FIELD_NUMBER; + hash = (53 * hash) + getInput().hashCode(); + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1.TextInput parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.TextInput 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.discoveryengine.v1.TextInput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.TextInput 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.discoveryengine.v1.TextInput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.TextInput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.TextInput parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.TextInput 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.discoveryengine.v1.TextInput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.TextInput 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.discoveryengine.v1.TextInput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.TextInput 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.discoveryengine.v1.TextInput 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; + } + /** + * + * + *
+   * Defines text input.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.TextInput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.TextInput) + com.google.cloud.discoveryengine.v1.TextInputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_TextInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_TextInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.TextInput.class, + com.google.cloud.discoveryengine.v1.TextInput.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.TextInput.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + input_ = ""; + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); + contextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1.ConversationProto + .internal_static_google_cloud_discoveryengine_v1_TextInput_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.TextInput getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.TextInput build() { + com.google.cloud.discoveryengine.v1.TextInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.TextInput buildPartial() { + com.google.cloud.discoveryengine.v1.TextInput result = + new com.google.cloud.discoveryengine.v1.TextInput(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1.TextInput result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.input_ = input_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.context_ = contextBuilder_ == null ? context_ : contextBuilder_.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.discoveryengine.v1.TextInput) { + return mergeFrom((com.google.cloud.discoveryengine.v1.TextInput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.TextInput other) { + if (other == com.google.cloud.discoveryengine.v1.TextInput.getDefaultInstance()) return this; + if (!other.getInput().isEmpty()) { + input_ = other.input_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasContext()) { + mergeContext(other.getContext()); + } + 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_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object input_ = ""; + /** + * + * + *
+     * Text input.
+     * 
+ * + * string input = 1; + * + * @return The input. + */ + public java.lang.String getInput() { + java.lang.Object ref = input_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + input_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Text input.
+     * 
+ * + * string input = 1; + * + * @return The bytes for input. + */ + public com.google.protobuf.ByteString getInputBytes() { + java.lang.Object ref = input_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + input_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Text input.
+     * 
+ * + * string input = 1; + * + * @param value The input to set. + * @return This builder for chaining. + */ + public Builder setInput(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Text input.
+     * 
+ * + * string input = 1; + * + * @return This builder for chaining. + */ + public Builder clearInput() { + input_ = getDefaultInstance().getInput(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Text input.
+     * 
+ * + * string input = 1; + * + * @param value The bytes for input to set. + * @return This builder for chaining. + */ + public Builder setInputBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + input_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1.ConversationContext context_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.ConversationContext, + com.google.cloud.discoveryengine.v1.ConversationContext.Builder, + com.google.cloud.discoveryengine.v1.ConversationContextOrBuilder> + contextBuilder_; + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + * + * @return Whether the context field is set. + */ + public boolean hasContext() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + * + * @return The context. + */ + public com.google.cloud.discoveryengine.v1.ConversationContext getContext() { + if (contextBuilder_ == null) { + return context_ == null + ? com.google.cloud.discoveryengine.v1.ConversationContext.getDefaultInstance() + : context_; + } else { + return contextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + */ + public Builder setContext(com.google.cloud.discoveryengine.v1.ConversationContext value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + } else { + contextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + */ + public Builder setContext( + com.google.cloud.discoveryengine.v1.ConversationContext.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + */ + public Builder mergeContext(com.google.cloud.discoveryengine.v1.ConversationContext value) { + if (contextBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && context_ != null + && context_ + != com.google.cloud.discoveryengine.v1.ConversationContext.getDefaultInstance()) { + getContextBuilder().mergeFrom(value); + } else { + context_ = value; + } + } else { + contextBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + */ + public Builder clearContext() { + bitField0_ = (bitField0_ & ~0x00000002); + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); + contextBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + */ + public com.google.cloud.discoveryengine.v1.ConversationContext.Builder getContextBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + */ + public com.google.cloud.discoveryengine.v1.ConversationContextOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null + ? com.google.cloud.discoveryengine.v1.ConversationContext.getDefaultInstance() + : context_; + } + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.ConversationContext, + com.google.cloud.discoveryengine.v1.ConversationContext.Builder, + com.google.cloud.discoveryengine.v1.ConversationContextOrBuilder> + getContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.ConversationContext, + com.google.cloud.discoveryengine.v1.ConversationContext.Builder, + com.google.cloud.discoveryengine.v1.ConversationContextOrBuilder>( + getContext(), getParentForChildren(), isClean()); + context_ = null; + } + return contextBuilder_; + } + + @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.discoveryengine.v1.TextInput) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.TextInput) + private static final com.google.cloud.discoveryengine.v1.TextInput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.TextInput(); + } + + public static com.google.cloud.discoveryengine.v1.TextInput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextInput 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.discoveryengine.v1.TextInput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/TextInputOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/TextInputOrBuilder.java new file mode 100644 index 000000000000..75f2c01e2848 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/TextInputOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversation.proto + +package com.google.cloud.discoveryengine.v1; + +public interface TextInputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.TextInput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Text input.
+   * 
+ * + * string input = 1; + * + * @return The input. + */ + java.lang.String getInput(); + /** + * + * + *
+   * Text input.
+   * 
+ * + * string input = 1; + * + * @return The bytes for input. + */ + com.google.protobuf.ByteString getInputBytes(); + + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + * + * @return Whether the context field is set. + */ + boolean hasContext(); + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + * + * @return The context. + */ + com.google.cloud.discoveryengine.v1.ConversationContext getContext(); + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1.ConversationContext context = 2; + */ + com.google.cloud.discoveryengine.v1.ConversationContextOrBuilder getContextOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UpdateConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UpdateConversationRequest.java new file mode 100644 index 000000000000..6d050aaa900d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UpdateConversationRequest.java @@ -0,0 +1,1069 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +/** + * + * + *
+ * Request for UpdateConversation method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.UpdateConversationRequest} + */ +public final class UpdateConversationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1.UpdateConversationRequest) + UpdateConversationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateConversationRequest.newBuilder() to construct. + private UpdateConversationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateConversationRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateConversationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_UpdateConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_UpdateConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.UpdateConversationRequest.class, + com.google.cloud.discoveryengine.v1.UpdateConversationRequest.Builder.class); + } + + public static final int CONVERSATION_FIELD_NUMBER = 1; + private com.google.cloud.discoveryengine.v1.Conversation conversation_; + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + @java.lang.Override + public boolean hasConversation() { + return conversation_ != null; + } + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.Conversation getConversation() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+   * following are NOT supported:
+   *
+   * * [conversation.name][]
+   *
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+   * following are NOT supported:
+   *
+   * * [conversation.name][]
+   *
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+   * following are NOT supported:
+   *
+   * * [conversation.name][]
+   *
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (conversation_ != null) { + output.writeMessage(1, getConversation()); + } + 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 (conversation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConversation()); + } + 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.discoveryengine.v1.UpdateConversationRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1.UpdateConversationRequest other = + (com.google.cloud.discoveryengine.v1.UpdateConversationRequest) obj; + + if (hasConversation() != other.hasConversation()) return false; + if (hasConversation()) { + if (!getConversation().equals(other.getConversation())) 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 (hasConversation()) { + hash = (37 * hash) + CONVERSATION_FIELD_NUMBER; + hash = (53 * hash) + getConversation().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.discoveryengine.v1.UpdateConversationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.UpdateConversationRequest 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.discoveryengine.v1.UpdateConversationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.UpdateConversationRequest 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.discoveryengine.v1.UpdateConversationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1.UpdateConversationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1.UpdateConversationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.UpdateConversationRequest 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.discoveryengine.v1.UpdateConversationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.UpdateConversationRequest 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.discoveryengine.v1.UpdateConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1.UpdateConversationRequest 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.discoveryengine.v1.UpdateConversationRequest 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 for UpdateConversation method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1.UpdateConversationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1.UpdateConversationRequest) + com.google.cloud.discoveryengine.v1.UpdateConversationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_UpdateConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_UpdateConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1.UpdateConversationRequest.class, + com.google.cloud.discoveryengine.v1.UpdateConversationRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1.UpdateConversationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = 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.discoveryengine.v1.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1_UpdateConversationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.UpdateConversationRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1.UpdateConversationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.UpdateConversationRequest build() { + com.google.cloud.discoveryengine.v1.UpdateConversationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1.UpdateConversationRequest buildPartial() { + com.google.cloud.discoveryengine.v1.UpdateConversationRequest result = + new com.google.cloud.discoveryengine.v1.UpdateConversationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1.UpdateConversationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.conversation_ = + conversationBuilder_ == null ? conversation_ : conversationBuilder_.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.discoveryengine.v1.UpdateConversationRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1.UpdateConversationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1.UpdateConversationRequest other) { + if (other + == com.google.cloud.discoveryengine.v1.UpdateConversationRequest.getDefaultInstance()) + return this; + if (other.hasConversation()) { + mergeConversation(other.getConversation()); + } + 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(getConversationFieldBuilder().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.discoveryengine.v1.Conversation conversation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder> + conversationBuilder_; + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + public boolean hasConversation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + public com.google.cloud.discoveryengine.v1.Conversation getConversation() { + if (conversationBuilder_ == null) { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } else { + return conversationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversation(com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conversation_ = value; + } else { + conversationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversation( + com.google.cloud.discoveryengine.v1.Conversation.Builder builderForValue) { + if (conversationBuilder_ == null) { + conversation_ = builderForValue.build(); + } else { + conversationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConversation(com.google.cloud.discoveryengine.v1.Conversation value) { + if (conversationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && conversation_ != null + && conversation_ + != com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance()) { + getConversationBuilder().mergeFrom(value); + } else { + conversation_ = value; + } + } else { + conversationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConversation() { + bitField0_ = (bitField0_ & ~0x00000001); + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1.Conversation.Builder getConversationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getConversationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder() { + if (conversationBuilder_ != null) { + return conversationBuilder_.getMessageOrBuilder(); + } else { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1.Conversation.getDefaultInstance() + : conversation_; + } + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder> + getConversationFieldBuilder() { + if (conversationBuilder_ == null) { + conversationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1.Conversation, + com.google.cloud.discoveryengine.v1.Conversation.Builder, + com.google.cloud.discoveryengine.v1.ConversationOrBuilder>( + getConversation(), getParentForChildren(), isClean()); + conversation_ = null; + } + return conversationBuilder_; + } + + 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_; + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+     * following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+     * following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+     * following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+     * following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+     * following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+     * following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+     * following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+     * following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+     * following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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.discoveryengine.v1.UpdateConversationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1.UpdateConversationRequest) + private static final com.google.cloud.discoveryengine.v1.UpdateConversationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1.UpdateConversationRequest(); + } + + public static com.google.cloud.discoveryengine.v1.UpdateConversationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateConversationRequest 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.discoveryengine.v1.UpdateConversationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UpdateConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UpdateConversationRequestOrBuilder.java new file mode 100644 index 000000000000..bdd9e978a93d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UpdateConversationRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1; + +public interface UpdateConversationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1.UpdateConversationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + boolean hasConversation(); + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + com.google.cloud.discoveryengine.v1.Conversation getConversation(); + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1.ConversationOrBuilder getConversationOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+   * following are NOT supported:
+   *
+   * * [conversation.name][]
+   *
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+   * following are NOT supported:
+   *
+   * * [conversation.name][]
+   *
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+   * following are NOT supported:
+   *
+   * * [conversation.name][]
+   *
+   * If not set or empty, all supported fields are updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEvent.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEvent.java index b3f8ce51104c..1242b593a456 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEvent.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEvent.java @@ -187,7 +187,7 @@ public com.google.protobuf.ByteString getEventTypeBytes() { * quality. * * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * The field should not contain PII or user-data. We recommend to use Google * Analytics [Client @@ -226,7 +226,7 @@ public java.lang.String getUserPseudoId() { * quality. * * The field must be a UTF-8 encoded string with a length limit of 128 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * The field should not contain PII or user-data. We recommend to use Google * Analytics [Client @@ -519,20 +519,17 @@ public com.google.cloud.discoveryengine.v1.PageInfoOrBuilder getPageInfoOrBuilde * * The value must be one of: * - * * [PredictResponse.attribution_token][] for events that are the result of + * * [RecommendResponse.attribution_token][] for events that are the result of * [RecommendationService.Recommend][]. * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]. - * * [CompleteQueryResponse.attribution_token][] for events that are the - * result of - * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]. * * This token enables us to accurately attribute page view or conversion * completion back to the event and the particular predict response containing * this clicked/purchased product. If user clicks on product K in the - * recommendation results, pass [PredictResponse.attribution_token][] as a URL - * parameter to product K's page. When recording events on product K's page, - * log the [PredictResponse.attribution_token][] to this field. + * recommendation results, pass [RecommendResponse.attribution_token][] as a + * URL parameter to product K's page. When recording events on product K's + * page, log the [RecommendResponse.attribution_token][] to this field. * * * string attribution_token = 8; @@ -563,20 +560,17 @@ public java.lang.String getAttributionToken() { * * The value must be one of: * - * * [PredictResponse.attribution_token][] for events that are the result of + * * [RecommendResponse.attribution_token][] for events that are the result of * [RecommendationService.Recommend][]. * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]. - * * [CompleteQueryResponse.attribution_token][] for events that are the - * result of - * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]. * * This token enables us to accurately attribute page view or conversion * completion back to the event and the particular predict response containing * this clicked/purchased product. If user clicks on product K in the - * recommendation results, pass [PredictResponse.attribution_token][] as a URL - * parameter to product K's page. When recording events on product K's page, - * log the [PredictResponse.attribution_token][] to this field. + * recommendation results, pass [RecommendResponse.attribution_token][] as a + * URL parameter to product K's page. When recording events on product K's + * page, log the [RecommendResponse.attribution_token][] to this field. * * * string attribution_token = 8; @@ -609,8 +603,9 @@ public com.google.protobuf.ByteString getAttributionTokenBytes() { * * One example is for `search` events, the associated * [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain - * a filter expression in [SearchRequest.filter][] conforming to - * https://google.aip.dev/160#filtering. + * a filter expression in + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter] + * conforming to https://google.aip.dev/160#filtering. * * Similarly, for `view-item-list` events that are generated from a * [RecommendationService.RecommendRequest][], this field may be populated @@ -618,7 +613,7 @@ public com.google.protobuf.ByteString getAttributionTokenBytes() { * to https://google.aip.dev/160#filtering. * * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string filter = 9; @@ -646,8 +641,9 @@ public java.lang.String getFilter() { * * One example is for `search` events, the associated * [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain - * a filter expression in [SearchRequest.filter][] conforming to - * https://google.aip.dev/160#filtering. + * a filter expression in + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter] + * conforming to https://google.aip.dev/160#filtering. * * Similarly, for `view-item-list` events that are generated from a * [RecommendationService.RecommendRequest][], this field may be populated @@ -655,7 +651,7 @@ public java.lang.String getFilter() { * to https://google.aip.dev/160#filtering. * * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string filter = 9; @@ -683,7 +679,8 @@ public com.google.protobuf.ByteString getFilterBytes() { * * *
-   * List of Documents associated with this user event.
+   * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+   * with this user event.
    *
    * This field is optional except for the following event types:
    *
@@ -712,7 +709,8 @@ public java.util.List getDocum
    *
    *
    * 
-   * List of Documents associated with this user event.
+   * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+   * with this user event.
    *
    * This field is optional except for the following event types:
    *
@@ -742,7 +740,8 @@ public java.util.List getDocum
    *
    *
    * 
-   * List of Documents associated with this user event.
+   * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+   * with this user event.
    *
    * This field is optional except for the following event types:
    *
@@ -771,7 +770,8 @@ public int getDocumentsCount() {
    *
    *
    * 
-   * List of Documents associated with this user event.
+   * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+   * with this user event.
    *
    * This field is optional except for the following event types:
    *
@@ -800,7 +800,8 @@ public com.google.cloud.discoveryengine.v1.DocumentInfo getDocuments(int index)
    *
    *
    * 
-   * List of Documents associated with this user event.
+   * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+   * with this user event.
    *
    * This field is optional except for the following event types:
    *
@@ -883,7 +884,8 @@ public com.google.cloud.discoveryengine.v1.PanelInfoOrBuilder getPanelOrBuilder(
    *
    *
    * 
-   * Search API details related to the event.
+   * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+   * details related to the event.
    *
    * This field should be set for `search` event.
    * 
@@ -900,7 +902,8 @@ public boolean hasSearchInfo() { * * *
-   * Search API details related to the event.
+   * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+   * details related to the event.
    *
    * This field should be set for `search` event.
    * 
@@ -919,7 +922,8 @@ public com.google.cloud.discoveryengine.v1.SearchInfo getSearchInfo() { * * *
-   * Search API details related to the event.
+   * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+   * details related to the event.
    *
    * This field should be set for `search` event.
    * 
@@ -939,7 +943,8 @@ public com.google.cloud.discoveryengine.v1.SearchInfoOrBuilder getSearchInfoOrBu * * *
-   * CompleteQuery API details related to the event.
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+   * details related to the event.
    *
    * This field should be set for `search` event when autocomplete function is
    * enabled and the user clicks a suggestion for search.
@@ -957,7 +962,8 @@ public boolean hasCompletionInfo() {
    *
    *
    * 
-   * CompleteQuery API details related to the event.
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+   * details related to the event.
    *
    * This field should be set for `search` event when autocomplete function is
    * enabled and the user clicks a suggestion for search.
@@ -977,7 +983,8 @@ public com.google.cloud.discoveryengine.v1.CompletionInfo getCompletionInfo() {
    *
    *
    * 
-   * CompleteQuery API details related to the event.
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+   * details related to the event.
    *
    * This field should be set for `search` event when autocomplete function is
    * enabled and the user clicks a suggestion for search.
@@ -1243,7 +1250,7 @@ public int getAttributesCount() {
    * * For number attributes, at most 400 values are allowed.
    *
    * For product recommendations, an example of extra user information is
-   * ` traffic_channel`, which is how a user arrives at the site. Users can
+   * `traffic_channel`, which is how a user arrives at the site. Users can
    * arrive
    * at the site by coming to the site directly, coming through Google
    * search, or in other ways.
@@ -1292,7 +1299,7 @@ public boolean containsAttributes(java.lang.String key) {
    * * For number attributes, at most 400 values are allowed.
    *
    * For product recommendations, an example of extra user information is
-   * ` traffic_channel`, which is how a user arrives at the site. Users can
+   * `traffic_channel`, which is how a user arrives at the site. Users can
    * arrive
    * at the site by coming to the site directly, coming through Google
    * search, or in other ways.
@@ -1332,7 +1339,7 @@ public boolean containsAttributes(java.lang.String key) {
    * * For number attributes, at most 400 values are allowed.
    *
    * For product recommendations, an example of extra user information is
-   * ` traffic_channel`, which is how a user arrives at the site. Users can
+   * `traffic_channel`, which is how a user arrives at the site. Users can
    * arrive
    * at the site by coming to the site directly, coming through Google
    * search, or in other ways.
@@ -1379,7 +1386,7 @@ public boolean containsAttributes(java.lang.String key) {
    * * For number attributes, at most 400 values are allowed.
    *
    * For product recommendations, an example of extra user information is
-   * ` traffic_channel`, which is how a user arrives at the site. Users can
+   * `traffic_channel`, which is how a user arrives at the site. Users can
    * arrive
    * at the site by coming to the site directly, coming through Google
    * search, or in other ways.
@@ -2582,7 +2589,7 @@ public Builder setEventTypeBytes(com.google.protobuf.ByteString value) {
      * quality.
      *
      * The field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
      *
      * The field should not contain PII or user-data. We recommend to use Google
      * Analytics [Client
@@ -2620,7 +2627,7 @@ public java.lang.String getUserPseudoId() {
      * quality.
      *
      * The field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
      *
      * The field should not contain PII or user-data. We recommend to use Google
      * Analytics [Client
@@ -2658,7 +2665,7 @@ public com.google.protobuf.ByteString getUserPseudoIdBytes() {
      * quality.
      *
      * The field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
      *
      * The field should not contain PII or user-data. We recommend to use Google
      * Analytics [Client
@@ -2695,7 +2702,7 @@ public Builder setUserPseudoId(java.lang.String value) {
      * quality.
      *
      * The field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
      *
      * The field should not contain PII or user-data. We recommend to use Google
      * Analytics [Client
@@ -2728,7 +2735,7 @@ public Builder clearUserPseudoId() {
      * quality.
      *
      * The field must be a UTF-8 encoded string with a length limit of 128
-     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+     * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
      *
      * The field should not contain PII or user-data. We recommend to use Google
      * Analytics [Client
@@ -3573,20 +3580,17 @@ public com.google.cloud.discoveryengine.v1.PageInfoOrBuilder getPageInfoOrBuilde
      *
      * The value must be one of:
      *
-     * * [PredictResponse.attribution_token][] for events that are the result of
+     * * [RecommendResponse.attribution_token][] for events that are the result of
      * [RecommendationService.Recommend][].
      * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of
      * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search].
-     * * [CompleteQueryResponse.attribution_token][] for events that are the
-     * result of
-     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery].
      *
      * This token enables us to accurately attribute page view or conversion
      * completion back to the event and the particular predict response containing
      * this clicked/purchased product. If user clicks on product K in the
-     * recommendation results, pass [PredictResponse.attribution_token][] as a URL
-     * parameter to product K's page. When recording events on product K's page,
-     * log the [PredictResponse.attribution_token][] to this field.
+     * recommendation results, pass [RecommendResponse.attribution_token][] as a
+     * URL parameter to product K's page. When recording events on product K's
+     * page, log the [RecommendResponse.attribution_token][] to this field.
      * 
* * string attribution_token = 8; @@ -3616,20 +3620,17 @@ public java.lang.String getAttributionToken() { * * The value must be one of: * - * * [PredictResponse.attribution_token][] for events that are the result of + * * [RecommendResponse.attribution_token][] for events that are the result of * [RecommendationService.Recommend][]. * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]. - * * [CompleteQueryResponse.attribution_token][] for events that are the - * result of - * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]. * * This token enables us to accurately attribute page view or conversion * completion back to the event and the particular predict response containing * this clicked/purchased product. If user clicks on product K in the - * recommendation results, pass [PredictResponse.attribution_token][] as a URL - * parameter to product K's page. When recording events on product K's page, - * log the [PredictResponse.attribution_token][] to this field. + * recommendation results, pass [RecommendResponse.attribution_token][] as a + * URL parameter to product K's page. When recording events on product K's + * page, log the [RecommendResponse.attribution_token][] to this field. *
* * string attribution_token = 8; @@ -3659,20 +3660,17 @@ public com.google.protobuf.ByteString getAttributionTokenBytes() { * * The value must be one of: * - * * [PredictResponse.attribution_token][] for events that are the result of + * * [RecommendResponse.attribution_token][] for events that are the result of * [RecommendationService.Recommend][]. * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]. - * * [CompleteQueryResponse.attribution_token][] for events that are the - * result of - * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]. * * This token enables us to accurately attribute page view or conversion * completion back to the event and the particular predict response containing * this clicked/purchased product. If user clicks on product K in the - * recommendation results, pass [PredictResponse.attribution_token][] as a URL - * parameter to product K's page. When recording events on product K's page, - * log the [PredictResponse.attribution_token][] to this field. + * recommendation results, pass [RecommendResponse.attribution_token][] as a + * URL parameter to product K's page. When recording events on product K's + * page, log the [RecommendResponse.attribution_token][] to this field. *
* * string attribution_token = 8; @@ -3701,20 +3699,17 @@ public Builder setAttributionToken(java.lang.String value) { * * The value must be one of: * - * * [PredictResponse.attribution_token][] for events that are the result of + * * [RecommendResponse.attribution_token][] for events that are the result of * [RecommendationService.Recommend][]. * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]. - * * [CompleteQueryResponse.attribution_token][] for events that are the - * result of - * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]. * * This token enables us to accurately attribute page view or conversion * completion back to the event and the particular predict response containing * this clicked/purchased product. If user clicks on product K in the - * recommendation results, pass [PredictResponse.attribution_token][] as a URL - * parameter to product K's page. When recording events on product K's page, - * log the [PredictResponse.attribution_token][] to this field. + * recommendation results, pass [RecommendResponse.attribution_token][] as a + * URL parameter to product K's page. When recording events on product K's + * page, log the [RecommendResponse.attribution_token][] to this field. *
* * string attribution_token = 8; @@ -3739,20 +3734,17 @@ public Builder clearAttributionToken() { * * The value must be one of: * - * * [PredictResponse.attribution_token][] for events that are the result of + * * [RecommendResponse.attribution_token][] for events that are the result of * [RecommendationService.Recommend][]. * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]. - * * [CompleteQueryResponse.attribution_token][] for events that are the - * result of - * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]. * * This token enables us to accurately attribute page view or conversion * completion back to the event and the particular predict response containing * this clicked/purchased product. If user clicks on product K in the - * recommendation results, pass [PredictResponse.attribution_token][] as a URL - * parameter to product K's page. When recording events on product K's page, - * log the [PredictResponse.attribution_token][] to this field. + * recommendation results, pass [RecommendResponse.attribution_token][] as a + * URL parameter to product K's page. When recording events on product K's + * page, log the [RecommendResponse.attribution_token][] to this field. *
* * string attribution_token = 8; @@ -3781,8 +3773,9 @@ public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { * * One example is for `search` events, the associated * [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain - * a filter expression in [SearchRequest.filter][] conforming to - * https://google.aip.dev/160#filtering. + * a filter expression in + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter] + * conforming to https://google.aip.dev/160#filtering. * * Similarly, for `view-item-list` events that are generated from a * [RecommendationService.RecommendRequest][], this field may be populated @@ -3790,7 +3783,7 @@ public Builder setAttributionTokenBytes(com.google.protobuf.ByteString value) { * to https://google.aip.dev/160#filtering. * * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string filter = 9; @@ -3817,8 +3810,9 @@ public java.lang.String getFilter() { * * One example is for `search` events, the associated * [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain - * a filter expression in [SearchRequest.filter][] conforming to - * https://google.aip.dev/160#filtering. + * a filter expression in + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter] + * conforming to https://google.aip.dev/160#filtering. * * Similarly, for `view-item-list` events that are generated from a * [RecommendationService.RecommendRequest][], this field may be populated @@ -3826,7 +3820,7 @@ public java.lang.String getFilter() { * to https://google.aip.dev/160#filtering. * * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string filter = 9; @@ -3853,8 +3847,9 @@ public com.google.protobuf.ByteString getFilterBytes() { * * One example is for `search` events, the associated * [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain - * a filter expression in [SearchRequest.filter][] conforming to - * https://google.aip.dev/160#filtering. + * a filter expression in + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter] + * conforming to https://google.aip.dev/160#filtering. * * Similarly, for `view-item-list` events that are generated from a * [RecommendationService.RecommendRequest][], this field may be populated @@ -3862,7 +3857,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * to https://google.aip.dev/160#filtering. * * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string filter = 9; @@ -3888,8 +3883,9 @@ public Builder setFilter(java.lang.String value) { * * One example is for `search` events, the associated * [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain - * a filter expression in [SearchRequest.filter][] conforming to - * https://google.aip.dev/160#filtering. + * a filter expression in + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter] + * conforming to https://google.aip.dev/160#filtering. * * Similarly, for `view-item-list` events that are generated from a * [RecommendationService.RecommendRequest][], this field may be populated @@ -3897,7 +3893,7 @@ public Builder setFilter(java.lang.String value) { * to https://google.aip.dev/160#filtering. * * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string filter = 9; @@ -3919,8 +3915,9 @@ public Builder clearFilter() { * * One example is for `search` events, the associated * [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain - * a filter expression in [SearchRequest.filter][] conforming to - * https://google.aip.dev/160#filtering. + * a filter expression in + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter] + * conforming to https://google.aip.dev/160#filtering. * * Similarly, for `view-item-list` events that are generated from a * [RecommendationService.RecommendRequest][], this field may be populated @@ -3928,7 +3925,7 @@ public Builder clearFilter() { * to https://google.aip.dev/160#filtering. * * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. * * * string filter = 9; @@ -3968,7 +3965,8 @@ private void ensureDocumentsIsMutable() { * * *
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4000,7 +3998,8 @@ public java.util.List getDocum
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4032,7 +4031,8 @@ public int getDocumentsCount() {
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4064,7 +4064,8 @@ public com.google.cloud.discoveryengine.v1.DocumentInfo getDocuments(int index)
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4102,7 +4103,8 @@ public Builder setDocuments(int index, com.google.cloud.discoveryengine.v1.Docum
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4138,7 +4140,8 @@ public Builder setDocuments(
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4176,7 +4179,8 @@ public Builder addDocuments(com.google.cloud.discoveryengine.v1.DocumentInfo val
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4214,7 +4218,8 @@ public Builder addDocuments(int index, com.google.cloud.discoveryengine.v1.Docum
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4250,7 +4255,8 @@ public Builder addDocuments(
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4286,7 +4292,8 @@ public Builder addDocuments(
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4322,7 +4329,8 @@ public Builder addAllDocuments(
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4357,7 +4365,8 @@ public Builder clearDocuments() {
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4392,7 +4401,8 @@ public Builder removeDocuments(int index) {
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4420,7 +4430,8 @@ public com.google.cloud.discoveryengine.v1.DocumentInfo.Builder getDocumentsBuil
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4453,7 +4464,8 @@ public com.google.cloud.discoveryengine.v1.DocumentInfoOrBuilder getDocumentsOrB
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4486,7 +4498,8 @@ public com.google.cloud.discoveryengine.v1.DocumentInfoOrBuilder getDocumentsOrB
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4515,7 +4528,8 @@ public com.google.cloud.discoveryengine.v1.DocumentInfo.Builder addDocumentsBuil
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4544,7 +4558,8 @@ public com.google.cloud.discoveryengine.v1.DocumentInfo.Builder addDocumentsBuil
      *
      *
      * 
-     * List of Documents associated with this user event.
+     * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+     * with this user event.
      *
      * This field is optional except for the following event types:
      *
@@ -4780,7 +4795,8 @@ public com.google.cloud.discoveryengine.v1.PanelInfoOrBuilder getPanelOrBuilder(
      *
      *
      * 
-     * Search API details related to the event.
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * details related to the event.
      *
      * This field should be set for `search` event.
      * 
@@ -4796,7 +4812,8 @@ public boolean hasSearchInfo() { * * *
-     * Search API details related to the event.
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * details related to the event.
      *
      * This field should be set for `search` event.
      * 
@@ -4818,7 +4835,8 @@ public com.google.cloud.discoveryengine.v1.SearchInfo getSearchInfo() { * * *
-     * Search API details related to the event.
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * details related to the event.
      *
      * This field should be set for `search` event.
      * 
@@ -4842,7 +4860,8 @@ public Builder setSearchInfo(com.google.cloud.discoveryengine.v1.SearchInfo valu * * *
-     * Search API details related to the event.
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * details related to the event.
      *
      * This field should be set for `search` event.
      * 
@@ -4864,7 +4883,8 @@ public Builder setSearchInfo( * * *
-     * Search API details related to the event.
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * details related to the event.
      *
      * This field should be set for `search` event.
      * 
@@ -4891,7 +4911,8 @@ public Builder mergeSearchInfo(com.google.cloud.discoveryengine.v1.SearchInfo va * * *
-     * Search API details related to the event.
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * details related to the event.
      *
      * This field should be set for `search` event.
      * 
@@ -4912,7 +4933,8 @@ public Builder clearSearchInfo() { * * *
-     * Search API details related to the event.
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * details related to the event.
      *
      * This field should be set for `search` event.
      * 
@@ -4928,7 +4950,8 @@ public com.google.cloud.discoveryengine.v1.SearchInfo.Builder getSearchInfoBuild * * *
-     * Search API details related to the event.
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * details related to the event.
      *
      * This field should be set for `search` event.
      * 
@@ -4948,7 +4971,8 @@ public com.google.cloud.discoveryengine.v1.SearchInfoOrBuilder getSearchInfoOrBu * * *
-     * Search API details related to the event.
+     * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+     * details related to the event.
      *
      * This field should be set for `search` event.
      * 
@@ -4982,7 +5006,8 @@ public com.google.cloud.discoveryengine.v1.SearchInfoOrBuilder getSearchInfoOrBu * * *
-     * CompleteQuery API details related to the event.
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+     * details related to the event.
      *
      * This field should be set for `search` event when autocomplete function is
      * enabled and the user clicks a suggestion for search.
@@ -4999,7 +5024,8 @@ public boolean hasCompletionInfo() {
      *
      *
      * 
-     * CompleteQuery API details related to the event.
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+     * details related to the event.
      *
      * This field should be set for `search` event when autocomplete function is
      * enabled and the user clicks a suggestion for search.
@@ -5022,7 +5048,8 @@ public com.google.cloud.discoveryengine.v1.CompletionInfo getCompletionInfo() {
      *
      *
      * 
-     * CompleteQuery API details related to the event.
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+     * details related to the event.
      *
      * This field should be set for `search` event when autocomplete function is
      * enabled and the user clicks a suggestion for search.
@@ -5047,7 +5074,8 @@ public Builder setCompletionInfo(com.google.cloud.discoveryengine.v1.CompletionI
      *
      *
      * 
-     * CompleteQuery API details related to the event.
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+     * details related to the event.
      *
      * This field should be set for `search` event when autocomplete function is
      * enabled and the user clicks a suggestion for search.
@@ -5070,7 +5098,8 @@ public Builder setCompletionInfo(
      *
      *
      * 
-     * CompleteQuery API details related to the event.
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+     * details related to the event.
      *
      * This field should be set for `search` event when autocomplete function is
      * enabled and the user clicks a suggestion for search.
@@ -5099,7 +5128,8 @@ public Builder mergeCompletionInfo(com.google.cloud.discoveryengine.v1.Completio
      *
      *
      * 
-     * CompleteQuery API details related to the event.
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+     * details related to the event.
      *
      * This field should be set for `search` event when autocomplete function is
      * enabled and the user clicks a suggestion for search.
@@ -5121,7 +5151,8 @@ public Builder clearCompletionInfo() {
      *
      *
      * 
-     * CompleteQuery API details related to the event.
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+     * details related to the event.
      *
      * This field should be set for `search` event when autocomplete function is
      * enabled and the user clicks a suggestion for search.
@@ -5138,7 +5169,8 @@ public com.google.cloud.discoveryengine.v1.CompletionInfo.Builder getCompletionI
      *
      *
      * 
-     * CompleteQuery API details related to the event.
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+     * details related to the event.
      *
      * This field should be set for `search` event when autocomplete function is
      * enabled and the user clicks a suggestion for search.
@@ -5160,7 +5192,8 @@ public com.google.cloud.discoveryengine.v1.CompletionInfo.Builder getCompletionI
      *
      *
      * 
-     * CompleteQuery API details related to the event.
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+     * details related to the event.
      *
      * This field should be set for `search` event when autocomplete function is
      * enabled and the user clicks a suggestion for search.
@@ -5804,7 +5837,7 @@ public int getAttributesCount() {
      * * For number attributes, at most 400 values are allowed.
      *
      * For product recommendations, an example of extra user information is
-     * ` traffic_channel`, which is how a user arrives at the site. Users can
+     * `traffic_channel`, which is how a user arrives at the site. Users can
      * arrive
      * at the site by coming to the site directly, coming through Google
      * search, or in other ways.
@@ -5853,7 +5886,7 @@ public boolean containsAttributes(java.lang.String key) {
      * * For number attributes, at most 400 values are allowed.
      *
      * For product recommendations, an example of extra user information is
-     * ` traffic_channel`, which is how a user arrives at the site. Users can
+     * `traffic_channel`, which is how a user arrives at the site. Users can
      * arrive
      * at the site by coming to the site directly, coming through Google
      * search, or in other ways.
@@ -5893,7 +5926,7 @@ public boolean containsAttributes(java.lang.String key) {
      * * For number attributes, at most 400 values are allowed.
      *
      * For product recommendations, an example of extra user information is
-     * ` traffic_channel`, which is how a user arrives at the site. Users can
+     * `traffic_channel`, which is how a user arrives at the site. Users can
      * arrive
      * at the site by coming to the site directly, coming through Google
      * search, or in other ways.
@@ -5941,7 +5974,7 @@ public boolean containsAttributes(java.lang.String key) {
      * * For number attributes, at most 400 values are allowed.
      *
      * For product recommendations, an example of extra user information is
-     * ` traffic_channel`, which is how a user arrives at the site. Users can
+     * `traffic_channel`, which is how a user arrives at the site. Users can
      * arrive
      * at the site by coming to the site directly, coming through Google
      * search, or in other ways.
@@ -5995,7 +6028,7 @@ public Builder clearAttributes() {
      * * For number attributes, at most 400 values are allowed.
      *
      * For product recommendations, an example of extra user information is
-     * ` traffic_channel`, which is how a user arrives at the site. Users can
+     * `traffic_channel`, which is how a user arrives at the site. Users can
      * arrive
      * at the site by coming to the site directly, coming through Google
      * search, or in other ways.
@@ -6044,7 +6077,7 @@ public Builder removeAttributes(java.lang.String key) {
      * * For number attributes, at most 400 values are allowed.
      *
      * For product recommendations, an example of extra user information is
-     * ` traffic_channel`, which is how a user arrives at the site. Users can
+     * `traffic_channel`, which is how a user arrives at the site. Users can
      * arrive
      * at the site by coming to the site directly, coming through Google
      * search, or in other ways.
@@ -6091,7 +6124,7 @@ public Builder putAttributes(
      * * For number attributes, at most 400 values are allowed.
      *
      * For product recommendations, an example of extra user information is
-     * ` traffic_channel`, which is how a user arrives at the site. Users can
+     * `traffic_channel`, which is how a user arrives at the site. Users can
      * arrive
      * at the site by coming to the site directly, coming through Google
      * search, or in other ways.
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventOrBuilder.java
index 3b6b93909138..ab9ee33e4f99 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventOrBuilder.java
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventOrBuilder.java
@@ -99,7 +99,7 @@ public interface UserEventOrBuilder
    * quality.
    *
    * The field must be a UTF-8 encoded string with a length limit of 128
-   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
    *
    * The field should not contain PII or user-data. We recommend to use Google
    * Analytics [Client
@@ -127,7 +127,7 @@ public interface UserEventOrBuilder
    * quality.
    *
    * The field must be a UTF-8 encoded string with a length limit of 128
-   * characters. Otherwise, an INVALID_ARGUMENT error is returned.
+   * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
    *
    * The field should not contain PII or user-data. We recommend to use Google
    * Analytics [Client
@@ -333,20 +333,17 @@ public interface UserEventOrBuilder
    *
    * The value must be one of:
    *
-   * * [PredictResponse.attribution_token][] for events that are the result of
+   * * [RecommendResponse.attribution_token][] for events that are the result of
    * [RecommendationService.Recommend][].
    * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of
    * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search].
-   * * [CompleteQueryResponse.attribution_token][] for events that are the
-   * result of
-   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery].
    *
    * This token enables us to accurately attribute page view or conversion
    * completion back to the event and the particular predict response containing
    * this clicked/purchased product. If user clicks on product K in the
-   * recommendation results, pass [PredictResponse.attribution_token][] as a URL
-   * parameter to product K's page. When recording events on product K's page,
-   * log the [PredictResponse.attribution_token][] to this field.
+   * recommendation results, pass [RecommendResponse.attribution_token][] as a
+   * URL parameter to product K's page. When recording events on product K's
+   * page, log the [RecommendResponse.attribution_token][] to this field.
    * 
* * string attribution_token = 8; @@ -366,20 +363,17 @@ public interface UserEventOrBuilder * * The value must be one of: * - * * [PredictResponse.attribution_token][] for events that are the result of + * * [RecommendResponse.attribution_token][] for events that are the result of * [RecommendationService.Recommend][]. * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]. - * * [CompleteQueryResponse.attribution_token][] for events that are the - * result of - * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]. * * This token enables us to accurately attribute page view or conversion * completion back to the event and the particular predict response containing * this clicked/purchased product. If user clicks on product K in the - * recommendation results, pass [PredictResponse.attribution_token][] as a URL - * parameter to product K's page. When recording events on product K's page, - * log the [PredictResponse.attribution_token][] to this field. + * recommendation results, pass [RecommendResponse.attribution_token][] as a + * URL parameter to product K's page. When recording events on product K's + * page, log the [RecommendResponse.attribution_token][] to this field. *
* * string attribution_token = 8; @@ -397,8 +391,9 @@ public interface UserEventOrBuilder * * One example is for `search` events, the associated * [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain - * a filter expression in [SearchRequest.filter][] conforming to - * https://google.aip.dev/160#filtering. + * a filter expression in + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter] + * conforming to https://google.aip.dev/160#filtering. * * Similarly, for `view-item-list` events that are generated from a * [RecommendationService.RecommendRequest][], this field may be populated @@ -406,7 +401,7 @@ public interface UserEventOrBuilder * to https://google.aip.dev/160#filtering. * * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string filter = 9; @@ -423,8 +418,9 @@ public interface UserEventOrBuilder * * One example is for `search` events, the associated * [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain - * a filter expression in [SearchRequest.filter][] conforming to - * https://google.aip.dev/160#filtering. + * a filter expression in + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter] + * conforming to https://google.aip.dev/160#filtering. * * Similarly, for `view-item-list` events that are generated from a * [RecommendationService.RecommendRequest][], this field may be populated @@ -432,7 +428,7 @@ public interface UserEventOrBuilder * to https://google.aip.dev/160#filtering. * * The value must be a UTF-8 encoded string with a length limit of 1,000 - * characters. Otherwise, an INVALID_ARGUMENT error is returned. + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. *
* * string filter = 9; @@ -445,7 +441,8 @@ public interface UserEventOrBuilder * * *
-   * List of Documents associated with this user event.
+   * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+   * with this user event.
    *
    * This field is optional except for the following event types:
    *
@@ -471,7 +468,8 @@ public interface UserEventOrBuilder
    *
    *
    * 
-   * List of Documents associated with this user event.
+   * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+   * with this user event.
    *
    * This field is optional except for the following event types:
    *
@@ -497,7 +495,8 @@ public interface UserEventOrBuilder
    *
    *
    * 
-   * List of Documents associated with this user event.
+   * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+   * with this user event.
    *
    * This field is optional except for the following event types:
    *
@@ -523,7 +522,8 @@ public interface UserEventOrBuilder
    *
    *
    * 
-   * List of Documents associated with this user event.
+   * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+   * with this user event.
    *
    * This field is optional except for the following event types:
    *
@@ -550,7 +550,8 @@ public interface UserEventOrBuilder
    *
    *
    * 
-   * List of Documents associated with this user event.
+   * List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+   * with this user event.
    *
    * This field is optional except for the following event types:
    *
@@ -612,7 +613,8 @@ public interface UserEventOrBuilder
    *
    *
    * 
-   * Search API details related to the event.
+   * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+   * details related to the event.
    *
    * This field should be set for `search` event.
    * 
@@ -626,7 +628,8 @@ public interface UserEventOrBuilder * * *
-   * Search API details related to the event.
+   * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+   * details related to the event.
    *
    * This field should be set for `search` event.
    * 
@@ -640,7 +643,8 @@ public interface UserEventOrBuilder * * *
-   * Search API details related to the event.
+   * [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+   * details related to the event.
    *
    * This field should be set for `search` event.
    * 
@@ -653,7 +657,8 @@ public interface UserEventOrBuilder * * *
-   * CompleteQuery API details related to the event.
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+   * details related to the event.
    *
    * This field should be set for `search` event when autocomplete function is
    * enabled and the user clicks a suggestion for search.
@@ -668,7 +673,8 @@ public interface UserEventOrBuilder
    *
    *
    * 
-   * CompleteQuery API details related to the event.
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+   * details related to the event.
    *
    * This field should be set for `search` event when autocomplete function is
    * enabled and the user clicks a suggestion for search.
@@ -683,7 +689,8 @@ public interface UserEventOrBuilder
    *
    *
    * 
-   * CompleteQuery API details related to the event.
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+   * details related to the event.
    *
    * This field should be set for `search` event when autocomplete function is
    * enabled and the user clicks a suggestion for search.
@@ -868,7 +875,7 @@ public interface UserEventOrBuilder
    * * For number attributes, at most 400 values are allowed.
    *
    * For product recommendations, an example of extra user information is
-   * ` traffic_channel`, which is how a user arrives at the site. Users can
+   * `traffic_channel`, which is how a user arrives at the site. Users can
    * arrive
    * at the site by coming to the site directly, coming through Google
    * search, or in other ways.
@@ -904,7 +911,7 @@ public interface UserEventOrBuilder
    * * For number attributes, at most 400 values are allowed.
    *
    * For product recommendations, an example of extra user information is
-   * ` traffic_channel`, which is how a user arrives at the site. Users can
+   * `traffic_channel`, which is how a user arrives at the site. Users can
    * arrive
    * at the site by coming to the site directly, coming through Google
    * search, or in other ways.
@@ -944,7 +951,7 @@ public interface UserEventOrBuilder
    * * For number attributes, at most 400 values are allowed.
    *
    * For product recommendations, an example of extra user information is
-   * ` traffic_channel`, which is how a user arrives at the site. Users can
+   * `traffic_channel`, which is how a user arrives at the site. Users can
    * arrive
    * at the site by coming to the site directly, coming through Google
    * search, or in other ways.
@@ -981,7 +988,7 @@ public interface UserEventOrBuilder
    * * For number attributes, at most 400 values are allowed.
    *
    * For product recommendations, an example of extra user information is
-   * ` traffic_channel`, which is how a user arrives at the site. Users can
+   * `traffic_channel`, which is how a user arrives at the site. Users can
    * arrive
    * at the site by coming to the site directly, coming through Google
    * search, or in other ways.
@@ -1021,7 +1028,7 @@ com.google.cloud.discoveryengine.v1.CustomAttribute getAttributesOrDefault(
    * * For number attributes, at most 400 values are allowed.
    *
    * For product recommendations, an example of extra user information is
-   * ` traffic_channel`, which is how a user arrives at the site. Users can
+   * `traffic_channel`, which is how a user arrives at the site. Users can
    * arrive
    * at the site by coming to the site directly, coming through Google
    * search, or in other ways.
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventProto.java
index d9c5bc5af4e1..a9af22312fd6 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventProto.java
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserEventProto.java
@@ -113,26 +113,26 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "ncy\030\002 \001(\tB\004\342A\001\002\022\026\n\016transaction_id\030\003 \001(\t\022"
           + "\020\n\003tax\030\004 \001(\002H\001\210\001\001\022\021\n\004cost\030\005 \001(\002H\002\210\001\001\022\033\n\016"
           + "discount_value\030\006 \001(\002H\003\210\001\001B\010\n\006_valueB\006\n\004_"
-          + "taxB\007\n\005_costB\021\n\017_discount_value\"\266\001\n\014Docu"
-          + "mentInfo\022\022\n\002id\030\001 \001(\tB\004\342A\001\002H\000\022@\n\004name\030\002 \001"
-          + "(\tB0\342A\001\002\372A)\n\'discoveryengine.googleapis."
-          + "com/DocumentH\000\022\025\n\010quantity\030\003 \001(\005H\001\210\001\001\022\025\n"
-          + "\rpromotion_ids\030\004 \003(\tB\025\n\023document_descrip"
-          + "torB\013\n\t_quantity\"\225\001\n\tPanelInfo\022\026\n\010panel_"
-          + "id\030\002 \001(\tB\004\342A\001\002\022\024\n\014display_name\030\003 \001(\t\022\033\n\016"
-          + "panel_position\030\004 \001(\005H\000\210\001\001\022\031\n\014total_panel"
-          + "s\030\005 \001(\005H\001\210\001\001B\021\n\017_panel_positionB\017\n\r_tota"
-          + "l_panels\"\215\001\n\tMediaInfo\022:\n\027media_progress"
-          + "_duration\030\001 \001(\0132\031.google.protobuf.Durati"
-          + "on\022&\n\031media_progress_percentage\030\002 \001(\002H\000\210"
-          + "\001\001B\034\n\032_media_progress_percentageB\201\002\n#com"
-          + ".google.cloud.discoveryengine.v1B\016UserEv"
-          + "entProtoP\001ZMcloud.google.com/go/discover"
-          + "yengine/apiv1/discoveryenginepb;discover"
-          + "yenginepb\242\002\017DISCOVERYENGINE\252\002\037Google.Clo"
-          + "ud.DiscoveryEngine.V1\312\002\037Google\\Cloud\\Dis"
-          + "coveryEngine\\V1\352\002\"Google::Cloud::Discove"
-          + "ryEngine::V1b\006proto3"
+          + "taxB\007\n\005_costB\021\n\017_discount_value\"\273\001\n\014Docu"
+          + "mentInfo\022\014\n\002id\030\001 \001(\tH\000\022<\n\004name\030\002 \001(\tB,\372A"
+          + ")\n\'discoveryengine.googleapis.com/Docume"
+          + "ntH\000\022\r\n\003uri\030\006 \001(\tH\000\022\025\n\010quantity\030\003 \001(\005H\001\210"
+          + "\001\001\022\025\n\rpromotion_ids\030\004 \003(\tB\025\n\023document_de"
+          + "scriptorB\013\n\t_quantity\"\225\001\n\tPanelInfo\022\026\n\010p"
+          + "anel_id\030\002 \001(\tB\004\342A\001\002\022\024\n\014display_name\030\003 \001("
+          + "\t\022\033\n\016panel_position\030\004 \001(\005H\000\210\001\001\022\031\n\014total_"
+          + "panels\030\005 \001(\005H\001\210\001\001B\021\n\017_panel_positionB\017\n\r"
+          + "_total_panels\"\215\001\n\tMediaInfo\022:\n\027media_pro"
+          + "gress_duration\030\001 \001(\0132\031.google.protobuf.D"
+          + "uration\022&\n\031media_progress_percentage\030\002 \001"
+          + "(\002H\000\210\001\001B\034\n\032_media_progress_percentageB\201\002"
+          + "\n#com.google.cloud.discoveryengine.v1B\016U"
+          + "serEventProtoP\001ZMcloud.google.com/go/dis"
+          + "coveryengine/apiv1/discoveryenginepb;dis"
+          + "coveryenginepb\242\002\017DISCOVERYENGINE\252\002\037Googl"
+          + "e.Cloud.DiscoveryEngine.V1\312\002\037Google\\Clou"
+          + "d\\DiscoveryEngine\\V1\352\002\"Google::Cloud::Di"
+          + "scoveryEngine::V1b\006proto3"
     };
     descriptor =
         com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -226,7 +226,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_cloud_discoveryengine_v1_DocumentInfo_descriptor,
             new java.lang.String[] {
-              "Id", "Name", "Quantity", "PromotionIds", "DocumentDescriptor", "Quantity",
+              "Id", "Name", "Uri", "Quantity", "PromotionIds", "DocumentDescriptor", "Quantity",
             });
     internal_static_google_cloud_discoveryengine_v1_PanelInfo_descriptor =
         getDescriptor().getMessageTypes().get(6);
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserInfo.java
index d72f6c99a985..7f9b39f4dba6 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserInfo.java
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserInfo.java
@@ -142,8 +142,7 @@ public com.google.protobuf.ByteString getUserIdBytes() {
    *
    *
    * 
-   * User agent as included in the HTTP header. Required for getting
-   * [SearchResponse.sponsored_results][].
+   * User agent as included in the HTTP header.
    *
    * The field must be a UTF-8 encoded string with a length limit of 1,000
    * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
@@ -176,8 +175,7 @@ public java.lang.String getUserAgent() {
    *
    *
    * 
-   * User agent as included in the HTTP header. Required for getting
-   * [SearchResponse.sponsored_results][].
+   * User agent as included in the HTTP header.
    *
    * The field must be a UTF-8 encoded string with a length limit of 1,000
    * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
@@ -733,8 +731,7 @@ public Builder setUserIdBytes(com.google.protobuf.ByteString value) {
      *
      *
      * 
-     * User agent as included in the HTTP header. Required for getting
-     * [SearchResponse.sponsored_results][].
+     * User agent as included in the HTTP header.
      *
      * The field must be a UTF-8 encoded string with a length limit of 1,000
      * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
@@ -766,8 +763,7 @@ public java.lang.String getUserAgent() {
      *
      *
      * 
-     * User agent as included in the HTTP header. Required for getting
-     * [SearchResponse.sponsored_results][].
+     * User agent as included in the HTTP header.
      *
      * The field must be a UTF-8 encoded string with a length limit of 1,000
      * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
@@ -799,8 +795,7 @@ public com.google.protobuf.ByteString getUserAgentBytes() {
      *
      *
      * 
-     * User agent as included in the HTTP header. Required for getting
-     * [SearchResponse.sponsored_results][].
+     * User agent as included in the HTTP header.
      *
      * The field must be a UTF-8 encoded string with a length limit of 1,000
      * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
@@ -831,8 +826,7 @@ public Builder setUserAgent(java.lang.String value) {
      *
      *
      * 
-     * User agent as included in the HTTP header. Required for getting
-     * [SearchResponse.sponsored_results][].
+     * User agent as included in the HTTP header.
      *
      * The field must be a UTF-8 encoded string with a length limit of 1,000
      * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
@@ -859,8 +853,7 @@ public Builder clearUserAgent() {
      *
      *
      * 
-     * User agent as included in the HTTP header. Required for getting
-     * [SearchResponse.sponsored_results][].
+     * User agent as included in the HTTP header.
      *
      * The field must be a UTF-8 encoded string with a length limit of 1,000
      * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserInfoOrBuilder.java
index c82af2dc41ff..ea432818077d 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserInfoOrBuilder.java
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/java/com/google/cloud/discoveryengine/v1/UserInfoOrBuilder.java
@@ -72,8 +72,7 @@ public interface UserInfoOrBuilder
    *
    *
    * 
-   * User agent as included in the HTTP header. Required for getting
-   * [SearchResponse.sponsored_results][].
+   * User agent as included in the HTTP header.
    *
    * The field must be a UTF-8 encoded string with a length limit of 1,000
    * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
@@ -95,8 +94,7 @@ public interface UserInfoOrBuilder
    *
    *
    * 
-   * User agent as included in the HTTP header. Required for getting
-   * [SearchResponse.sponsored_results][].
+   * User agent as included in the HTTP header.
    *
    * The field must be a UTF-8 encoded string with a length limit of 1,000
    * characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/common.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/common.proto
index b6f887c33cdc..05dc8ca95c8d 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/common.proto
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/common.proto
@@ -42,6 +42,35 @@ option (google.api.resource_definition) = {
   pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}"
 };
 
+// A floating point interval.
+message Interval {
+  // The lower bound of the interval. If neither of the min fields are
+  // set, then the lower bound is negative infinity.
+  //
+  // This field must be not larger than max.
+  // Otherwise, an `INVALID_ARGUMENT` error is returned.
+  oneof min {
+    // Inclusive lower bound.
+    double minimum = 1;
+
+    // Exclusive lower bound.
+    double exclusive_minimum = 2;
+  }
+
+  // The upper bound of the interval. If neither of the max fields are
+  // set, then the upper bound is positive infinity.
+  //
+  // This field must be not smaller than min.
+  // Otherwise, an `INVALID_ARGUMENT` error is returned.
+  oneof max {
+    // Inclusive upper bound.
+    double maximum = 3;
+
+    // Exclusive upper bound.
+    double exclusive_maximum = 4;
+  }
+}
+
 // A custom attribute that is not explicitly modeled in a resource, e.g.
 // [UserEvent][google.cloud.discoveryengine.v1.UserEvent].
 message CustomAttribute {
@@ -84,8 +113,7 @@ message UserInfo {
   // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
   string user_id = 1;
 
-  // User agent as included in the HTTP header. Required for getting
-  // [SearchResponse.sponsored_results][].
+  // User agent as included in the HTTP header.
   //
   // The field must be a UTF-8 encoded string with a length limit of 1,000
   // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/completion_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/completion_service.proto
index 29ba6317dc1a..f693a9fc0d7d 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/completion_service.proto
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/completion_service.proto
@@ -74,13 +74,14 @@ message CompleteQueryRequest {
   // API calls. Do not use it when there is no traffic for Search API.
   // * `user-event` - Using suggestions generated from user-imported search
   // events.
+  // * `document-completable` - Using suggestions taken directly from
+  // user-imported document fields marked as completable.
   //
   // Default values:
   //
   // * `document` is the default model for regular dataStores.
   // * `search-history` is the default model for
-  // [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH]
-  // dataStores.
+  // [IndustryVertical.SITE_SEARCH][] dataStores.
   string query_model = 3;
 
   // A unique identifier for tracking visitors. For example, this could be
@@ -98,6 +99,12 @@ message CompleteQueryRequest {
   // The field must be a UTF-8 encoded string with a length limit of 128
   // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
   string user_pseudo_id = 4;
+
+  // Indicates if tail suggestions should be returned if there are no
+  // suggestions that match the full query. Even if set to true, if there are
+  // suggestions that match the full query, those are returned and no
+  // tail suggestions are returned.
+  bool include_tail_suggestions = 5;
 }
 
 // Response message for
@@ -113,4 +120,10 @@ message CompleteQueryResponse {
   // Results of the matched query suggestions. The result list is ordered and
   // the first result is a top suggestion.
   repeated QuerySuggestion query_suggestions = 1;
+
+  // True if the returned suggestions are all tail suggestions.
+  //
+  // For tail matching to be triggered, include_tail_suggestions in the request
+  // must be true and there must be no suggestions that match the full query.
+  bool tail_match_triggered = 2;
 }
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/conversation.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/conversation.proto
new file mode 100644
index 000000000000..f5f7fe9d5327
--- /dev/null
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/conversation.proto
@@ -0,0 +1,114 @@
+// 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
+//
+//     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.discoveryengine.v1;
+
+import "google/api/field_behavior.proto";
+import "google/api/resource.proto";
+import "google/cloud/discoveryengine/v1/search_service.proto";
+import "google/protobuf/timestamp.proto";
+
+option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
+option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
+option java_multiple_files = true;
+option java_outer_classname = "ConversationProto";
+option java_package = "com.google.cloud.discoveryengine.v1";
+option objc_class_prefix = "DISCOVERYENGINE";
+option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
+option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
+
+// External conversation proto definition.
+message Conversation {
+  option (google.api.resource) = {
+    type: "discoveryengine.googleapis.com/Conversation"
+    pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}"
+    pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}"
+  };
+
+  // Enumeration of the state of the conversation.
+  enum State {
+    // Unknown.
+    STATE_UNSPECIFIED = 0;
+
+    // Conversation is currently open.
+    IN_PROGRESS = 1;
+
+    // Conversation has been completed.
+    COMPLETED = 2;
+  }
+
+  // Immutable. Fully qualified name
+  // `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
+
+  // The state of the Conversation.
+  State state = 2;
+
+  // A unique identifier for tracking users.
+  string user_pseudo_id = 3;
+
+  // Conversation messages.
+  repeated ConversationMessage messages = 4;
+
+  // Output only. The time the conversation started.
+  google.protobuf.Timestamp start_time = 5
+      [(google.api.field_behavior) = OUTPUT_ONLY];
+
+  // Output only. The time the conversation finished.
+  google.protobuf.Timestamp end_time = 6
+      [(google.api.field_behavior) = OUTPUT_ONLY];
+}
+
+// Defines a reply message to user.
+message Reply {
+  // Summary based on search results.
+  SearchResponse.Summary summary = 3;
+}
+
+// Defines context of the conversation
+message ConversationContext {
+  // The current list of documents the user is seeing.
+  // It contains the document resource references.
+  repeated string context_documents = 1;
+
+  // The current active document the user opened.
+  // It contains the document resource reference.
+  string active_document = 2;
+}
+
+// Defines text input.
+message TextInput {
+  // Text input.
+  string input = 1;
+
+  // Conversation context of the input.
+  ConversationContext context = 2;
+}
+
+// Defines a conversation message.
+message ConversationMessage {
+  oneof message {
+    // User text input.
+    TextInput user_input = 1;
+
+    // Search reply.
+    Reply reply = 2;
+  }
+
+  // Output only. Message creation timestamp.
+  google.protobuf.Timestamp create_time = 3
+      [(google.api.field_behavior) = OUTPUT_ONLY];
+}
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/conversational_search_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/conversational_search_service.proto
new file mode 100644
index 000000000000..c146ab5876bd
--- /dev/null
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/conversational_search_service.proto
@@ -0,0 +1,303 @@
+// 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
+//
+//     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.discoveryengine.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/discoveryengine/v1/conversation.proto";
+import "google/cloud/discoveryengine/v1/search_service.proto";
+import "google/protobuf/empty.proto";
+import "google/protobuf/field_mask.proto";
+
+option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
+option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
+option java_multiple_files = true;
+option java_outer_classname = "ConversationalSearchServiceProto";
+option java_package = "com.google.cloud.discoveryengine.v1";
+option objc_class_prefix = "DISCOVERYENGINE";
+option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
+option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
+
+// Service for conversational search.
+service ConversationalSearchService {
+  option (google.api.default_host) = "discoveryengine.googleapis.com";
+  option (google.api.oauth_scopes) =
+      "https://www.googleapis.com/auth/cloud-platform";
+
+  // Converses a conversation.
+  rpc ConverseConversation(ConverseConversationRequest)
+      returns (ConverseConversationResponse) {
+    option (google.api.http) = {
+      post: "/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}:converse"
+      body: "*"
+      additional_bindings {
+        post: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}:converse"
+        body: "*"
+      }
+    };
+    option (google.api.method_signature) = "name,query";
+  }
+
+  // Creates a Conversation.
+  //
+  // If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to
+  // create already exists, an ALREADY_EXISTS error is returned.
+  rpc CreateConversation(CreateConversationRequest) returns (Conversation) {
+    option (google.api.http) = {
+      post: "/v1/{parent=projects/*/locations/*/dataStores/*}/conversations"
+      body: "conversation"
+      additional_bindings {
+        post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations"
+        body: "conversation"
+      }
+    };
+    option (google.api.method_signature) = "parent,conversation";
+  }
+
+  // Deletes a Conversation.
+  //
+  // If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to
+  // delete does not exist, a NOT_FOUND error is returned.
+  rpc DeleteConversation(DeleteConversationRequest)
+      returns (google.protobuf.Empty) {
+    option (google.api.http) = {
+      delete: "/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}"
+      additional_bindings {
+        delete: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}"
+      }
+    };
+    option (google.api.method_signature) = "name";
+  }
+
+  // Updates a Conversation.
+  //
+  // [Conversation][google.cloud.discoveryengine.v1.Conversation] action type
+  // cannot be changed. If the
+  // [Conversation][google.cloud.discoveryengine.v1.Conversation] to update does
+  // not exist, a NOT_FOUND error is returned.
+  rpc UpdateConversation(UpdateConversationRequest) returns (Conversation) {
+    option (google.api.http) = {
+      patch: "/v1/{conversation.name=projects/*/locations/*/dataStores/*/conversations/*}"
+      body: "conversation"
+      additional_bindings {
+        patch: "/v1/{conversation.name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}"
+        body: "conversation"
+      }
+    };
+    option (google.api.method_signature) = "conversation,update_mask";
+  }
+
+  // Gets a Conversation.
+  rpc GetConversation(GetConversationRequest) returns (Conversation) {
+    option (google.api.http) = {
+      get: "/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}"
+      additional_bindings {
+        get: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}"
+      }
+    };
+    option (google.api.method_signature) = "name";
+  }
+
+  // Lists all Conversations by their parent
+  // [DataStore][google.cloud.discoveryengine.v1.DataStore].
+  rpc ListConversations(ListConversationsRequest)
+      returns (ListConversationsResponse) {
+    option (google.api.http) = {
+      get: "/v1/{parent=projects/*/locations/*/dataStores/*}/conversations"
+      additional_bindings {
+        get: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations"
+      }
+    };
+    option (google.api.method_signature) = "parent";
+  }
+}
+
+// Request message for
+// [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1.ConversationalSearchService.ConverseConversation]
+// method.
+message ConverseConversationRequest {
+  // Required. The resource name of the Conversation to get. Format:
+  // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+  // Use
+  // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+  // to activate auto session mode, which automatically creates a new
+  // conversation inside a ConverseConversation session.
+  string name = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = {
+      type: "discoveryengine.googleapis.com/Conversation"
+    }
+  ];
+
+  // Required. Current user input.
+  TextInput query = 2 [(google.api.field_behavior) = REQUIRED];
+
+  // The resource name of the Serving Config to use. Format:
+  // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+  // If this is not set, the default serving config will be used.
+  string serving_config = 3 [(google.api.resource_reference) = {
+    type: "discoveryengine.googleapis.com/ServingConfig"
+  }];
+
+  // The conversation to be used by auto session only. The name field will be
+  // ignored as we automatically assign new name for the conversation in auto
+  // session.
+  Conversation conversation = 5;
+
+  // Whether to turn on safe search.
+  bool safe_search = 6;
+
+  // The user labels applied to a resource must meet the following requirements:
+  //
+  // * Each resource can have multiple labels, up to a maximum of 64.
+  // * Each label must be a key-value pair.
+  // * Keys have a minimum length of 1 character and a maximum length of 63
+  //   characters and cannot be empty. Values can be empty and have a maximum
+  //   length of 63 characters.
+  // * Keys and values can contain only lowercase letters, numeric characters,
+  //   underscores, and dashes. All characters must use UTF-8 encoding, and
+  //   international characters are allowed.
+  // * The key portion of a label must be unique. However, you can use the same
+  //   key with multiple resources.
+  // * Keys must start with a lowercase letter or international character.
+  //
+  // See [Google Cloud
+  // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+  // for more details.
+  map user_labels = 7;
+
+  // A specification for configuring the summary returned in the response.
+  SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8;
+}
+
+// Response message for
+// [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1.ConversationalSearchService.ConverseConversation]
+// method.
+message ConverseConversationResponse {
+  // Answer to the current query.
+  Reply reply = 1;
+
+  // Updated conversation including the answer.
+  Conversation conversation = 2;
+
+  // Search Results.
+  repeated SearchResponse.SearchResult search_results = 3;
+}
+
+// Request for CreateConversation method.
+message CreateConversationRequest {
+  // Required. Full resource name of parent data store. Format:
+  // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+  string parent = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = {
+      type: "discoveryengine.googleapis.com/DataStore"
+    }
+  ];
+
+  // Required. The conversation to create.
+  Conversation conversation = 2 [(google.api.field_behavior) = REQUIRED];
+}
+
+// Request for UpdateConversation method.
+message UpdateConversationRequest {
+  // Required. The Conversation to update.
+  Conversation conversation = 1 [(google.api.field_behavior) = REQUIRED];
+
+  // Indicates which fields in the provided
+  // [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
+  // following are NOT supported:
+  //
+  // * [conversation.name][]
+  //
+  // If not set or empty, all supported fields are updated.
+  google.protobuf.FieldMask update_mask = 2;
+}
+
+// Request for DeleteConversation method.
+message DeleteConversationRequest {
+  // Required. The resource name of the Conversation to delete. Format:
+  // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+  string name = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = {
+      type: "discoveryengine.googleapis.com/Conversation"
+    }
+  ];
+}
+
+// Request for GetConversation method.
+message GetConversationRequest {
+  // Required. The resource name of the Conversation to get. Format:
+  // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+  string name = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = {
+      type: "discoveryengine.googleapis.com/Conversation"
+    }
+  ];
+}
+
+// Request for ListConversations method.
+message ListConversationsRequest {
+  // Required. The data store resource name. Format:
+  // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+  string parent = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = {
+      type: "discoveryengine.googleapis.com/DataStore"
+    }
+  ];
+
+  // Maximum number of results to return. If unspecified, defaults
+  // to 50. Max allowed value is 1000.
+  int32 page_size = 2;
+
+  // A page token, received from a previous `ListConversations` call.
+  // Provide this to retrieve the subsequent page.
+  string page_token = 3;
+
+  // A filter to apply on the list results. The supported features are:
+  // user_pseudo_id, state.
+  //
+  // Example:
+  // "user_pseudo_id = some_id"
+  string filter = 4;
+
+  // A comma-separated list of fields to order by, sorted in ascending order.
+  // Use "desc" after a field name for descending.
+  // Supported fields:
+  //   * `update_time`
+  //   * `create_time`
+  //   * `conversation_name`
+  //
+  // Example:
+  // "update_time desc"
+  // "create_time"
+  string order_by = 5;
+}
+
+// Response for ListConversations method.
+message ListConversationsResponse {
+  // All the Conversations for a given data store.
+  repeated Conversation conversations = 1;
+
+  // Pagination token, if not returned indicates the last page.
+  string next_page_token = 2;
+}
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/document.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/document.proto
index 2935f206b8ba..26a4e8c70adf 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/document.proto
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/document.proto
@@ -59,8 +59,11 @@ message Document {
 
     // The MIME type of the content. Supported types:
     //
-    // * `application/pdf` (PDF)
+    // * `application/pdf` (PDF, only native PDFs are supported for now)
     // * `text/html` (HTML)
+    // * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+    // * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+    // * `text/plain` (TXT)
     //
     // See https://www.iana.org/assignments/media-types/media-types.xhtml.
     string mime_type = 1;
@@ -72,13 +75,13 @@ message Document {
   // provided otherwise an `INVALID_ARGUMENT` error is thrown.
   oneof data {
     // The structured JSON data for the document. It should conform to the
-    // registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-    // or an `INVALID_ARGUMENT` error is thrown.
+    // registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+    // `INVALID_ARGUMENT` error is thrown.
     google.protobuf.Struct struct_data = 4;
 
     // The JSON string representation of the document. It should conform to the
-    // registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
-    // or an `INVALID_ARGUMENT` error is thrown.
+    // registered [Schema][google.cloud.discoveryengine.v1.Schema] or an
+    // `INVALID_ARGUMENT` error is thrown.
     string json_data = 5;
   }
 
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/document_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/document_service.proto
index b46cd918f4c4..17011168603d 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/document_service.proto
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/document_service.proto
@@ -187,9 +187,10 @@ message ListDocumentsRequest {
   // Use `default_branch` as the branch ID, to list documents under the default
   // branch.
   //
-  // If the caller does not have permission to list [Documents][]s under this
-  // branch, regardless of whether or not this branch exists, a
-  // `PERMISSION_DENIED` error is returned.
+  // If the caller does not have permission to list
+  // [Document][google.cloud.discoveryengine.v1.Document]s under this branch,
+  // regardless of whether or not this branch exists, a `PERMISSION_DENIED`
+  // error is returned.
   string parent = 1 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = {
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/import_config.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/import_config.proto
index 4680ebafde21..754777a69f48 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/import_config.proto
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/import_config.proto
@@ -54,11 +54,15 @@ message GcsSource {
   // document must
   //   have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id].
   // * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
-  //   `input_uris` will become a document, with the ID set to the first 128
+  //   `input_uris` becomes a document, with the ID set to the first 128
   //   bits of SHA256(URI) encoded as a hex string.
   // * `custom`: One custom data JSON per row in arbitrary format that conforms
-  //   the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data
-  //   store. This can only be used by the GENERIC Data Store vertical.
+  //   to the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the
+  //   data store. This can only be used by Gen App Builder.
+  // * `csv`: A CSV file with header conforming to the defined
+  // [Schema][google.cloud.discoveryengine.v1.Schema] of the
+  //   data store. Each entry after the header is imported as a Document.
+  //   This can only be used by Gen App Builder.
   //
   // Supported values for user even imports:
   //
@@ -110,9 +114,9 @@ message BigQuerySource {
   //   [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data]
   //   or
   //   [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data].
-  // * `custom`: One custom data per row in arbitrary format that conforms the
-  //   defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data
-  //   store. This can only be used by the GENERIC Data Store vertical.
+  // * `custom`: One custom data per row in arbitrary format that conforms to
+  //   the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data
+  //   store. This can only be used by Gen App Builder.
   string data_schema = 6;
 }
 
@@ -121,7 +125,7 @@ message ImportErrorConfig {
   // Required. Errors destination.
   oneof destination {
     // Cloud Storage prefix for import errors. This must be an empty,
-    // existing Cloud Storage directory. Import errors will be written to
+    // existing Cloud Storage directory. Import errors are written to
     // sharded files in this directory, one per line, as a JSON-encoded
     // `google.rpc.Status` message.
     string gcs_prefix = 1;
@@ -136,16 +140,16 @@ message ImportUserEventsRequest {
     repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED];
   }
 
-  // The desired input source of the user event data.
+  // Required - The desired input source of the user event data.
   oneof source {
-    // Required. The Inline source for the input content for UserEvents.
-    InlineSource inline_source = 2 [(google.api.field_behavior) = REQUIRED];
+    // The Inline source for the input content for UserEvents.
+    InlineSource inline_source = 2;
 
-    // Required. Cloud Storage location for the input content.
-    GcsSource gcs_source = 3 [(google.api.field_behavior) = REQUIRED];
+    // Cloud Storage location for the input content.
+    GcsSource gcs_source = 3;
 
-    // Required. BigQuery input source.
-    BigQuerySource bigquery_source = 4 [(google.api.field_behavior) = REQUIRED];
+    // BigQuery input source.
+    BigQuerySource bigquery_source = 4;
   }
 
   // Required. Parent DataStore resource name, of the form
@@ -181,7 +185,7 @@ message ImportUserEventsResponse {
   int64 unjoined_events_count = 4;
 }
 
-// Metadata related to the progress of the Import operation. This will be
+// Metadata related to the progress of the Import operation. This is
 // returned by the google.longrunning.Operation.metadata field.
 message ImportUserEventsMetadata {
   // Operation create time.
@@ -198,8 +202,8 @@ message ImportUserEventsMetadata {
   int64 failure_count = 4;
 }
 
-// Metadata related to the progress of the ImportDocuments operation. This will
-// be returned by the google.longrunning.Operation.metadata field.
+// Metadata related to the progress of the ImportDocuments operation. This is
+// returned by the google.longrunning.Operation.metadata field.
 message ImportDocumentsMetadata {
   // Operation create time.
   google.protobuf.Timestamp create_time = 1;
@@ -228,7 +232,7 @@ message ImportDocumentsRequest {
   // Indicates how imported documents are reconciled with the existing documents
   // created or imported before.
   enum ReconciliationMode {
-    // Defaults to INCREMENTAL.
+    // Defaults to `INCREMENTAL`.
     RECONCILIATION_MODE_UNSPECIFIED = 0;
 
     // Inserts new documents or updates existing documents.
@@ -280,7 +284,7 @@ message ImportDocumentsRequest {
   // `false`, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have
   // to be specified using
   // [id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field],
-  // otherwises, documents without IDs will fail to be imported.
+  // otherwise, documents without IDs fail to be imported.
   //
   // Only set this field when using
   // [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or
@@ -288,7 +292,7 @@ message ImportDocumentsRequest {
   // [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema]
   // or
   // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema]
-  // is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown.
+  // is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
   bool auto_generate_ids = 8;
 
   // The field in the Cloud Storage and BigQuery sources that indicates the
@@ -299,12 +303,12 @@ message ImportDocumentsRequest {
   // For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is
   // the column name of the BigQuery table where the unique ids are stored.
   //
-  // The values of the JSON field or the BigQuery column will be used as the
+  // The values of the JSON field or the BigQuery column are used as the
   // [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field
   // or the BigQuery column must be of string type, and the values must be set
   // as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
-  // with 1-63 characters. Otherwise, documents without valid IDs will fail to
-  // be imported.
+  // with 1-63 characters. Otherwise, documents without valid IDs fail to be
+  // imported.
   //
   // Only set this field when using
   // [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/schema.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/schema.proto
index 1d8709acb126..11fa2833d610 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/schema.proto
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/schema.proto
@@ -40,7 +40,7 @@ message Schema {
   // Schema representation. One of
   // [struct_schema][google.cloud.discoveryengine.v1.Schema.struct_schema] or
   // [json_schema][google.cloud.discoveryengine.v1.Schema.json_schema] should be
-  // provided otherwise an INVALID_ARGUMENT error is thrown.
+  // provided otherwise an `INVALID_ARGUMENT` error is thrown.
   oneof schema {
     // The structured representation of the schema.
     google.protobuf.Struct struct_schema = 2;
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/search_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/search_service.proto
index 6062d593cae2..4f128391a1de 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/search_service.proto
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/search_service.proto
@@ -56,6 +56,190 @@ service SearchService {
 // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
 // method.
 message SearchRequest {
+  // Specifies the image query input.
+  message ImageQuery {
+    oneof image {
+      // Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+      // BMP.
+      string image_bytes = 1;
+    }
+  }
+
+  // A facet specification to perform faceted search.
+  message FacetSpec {
+    // Specifies how a facet is computed.
+    message FacetKey {
+      // Required. Supported textual and numerical facet keys in
+      // [Document][google.cloud.discoveryengine.v1.Document] object, over which
+      // the facet values are computed. Facet key is case-sensitive.
+      string key = 1 [(google.api.field_behavior) = REQUIRED];
+
+      // Set only if values should be bucketed into intervals. Must be set
+      // for facets with numerical values. Must not be set for facet with text
+      // values. Maximum number of intervals is 30.
+      repeated Interval intervals = 2;
+
+      // Only get facet for the given restricted values. Only supported on
+      // textual fields. For example, suppose "category" has three values
+      // "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+      // "restricted_values" to "Action > 2022", the "category" facet only
+      // contains "Action > 2022". Only supported on textual fields. Maximum
+      // is 10.
+      repeated string restricted_values = 3;
+
+      // Only get facet values that start with the given string prefix. For
+      // example, suppose "category" has three values "Action > 2022",
+      // "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+      // "category" facet only contains "Action > 2022" and "Action > 2021".
+      // Only supported on textual fields. Maximum is 10.
+      repeated string prefixes = 4;
+
+      // Only get facet values that contains the given strings. For example,
+      // suppose "category" has three values "Action > 2022",
+      // "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+      // "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+      // Only supported on textual fields. Maximum is 10.
+      repeated string contains = 5;
+
+      // True to make facet keys case insensitive when getting faceting
+      // values with prefixes or contains; false otherwise.
+      bool case_insensitive = 6;
+
+      // The order in which documents are returned.
+      //
+      // Allowed values are:
+      //
+      // * "count desc", which means order by
+      // [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count]
+      // descending.
+      //
+      // * "value desc", which means order by
+      // [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value]
+      // descending.
+      //   Only applies to textual facets.
+      //
+      // If not set, textual values are sorted in [natural
+      // order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical
+      // intervals are sorted in the order given by
+      // [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+      string order_by = 7;
+    }
+
+    // Required. The facet key specification.
+    FacetKey facet_key = 1 [(google.api.field_behavior) = REQUIRED];
+
+    // Maximum of facet values that should be returned for this facet. If
+    // unspecified, defaults to 20. The maximum allowed value is 300. Values
+    // above 300 are coerced to 300.
+    //
+    // If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+    int32 limit = 2;
+
+    // List of keys to exclude when faceting.
+    //
+    //
+    // By default,
+    // [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+    // is not excluded from the filter unless it is listed in this field.
+    //
+    // Listing a facet key in this field allows its values to appear as facet
+    // results, even when they are filtered out of search results. Using this
+    // field does not affect what search results are returned.
+    //
+    // For example, suppose there are 100 documents with the color facet "Red"
+    // and 200 documents with the color facet "Blue". A query containing the
+    // filter "color:ANY("Red")" and having "color" as
+    // [FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key]
+    // would by default return only "Red" documents in the search results, and
+    // also return "Red" with count 100 as the only color facet. Although there
+    // are also blue documents available, "Blue" would not be shown as an
+    // available facet value.
+    //
+    // If "color" is listed in "excludedFilterKeys", then the query returns the
+    // facet values "Red" with count 100 and "Blue" with count 200, because the
+    // "color" key is now excluded from the filter. Because this field doesn't
+    // affect search results, the search results are still correctly filtered to
+    // return only "Red" documents.
+    //
+    // A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+    // error is returned.
+    repeated string excluded_filter_keys = 3;
+
+    // Enables dynamic position for this facet. If set to true, the position of
+    // this facet among all facets in the response is determined automatically.
+    // If dynamic facets are enabled, it is ordered together.
+    // If set to false, the position of this facet in the
+    // response is the same as in the request, and it is ranked before
+    // the facets with dynamic position enable and all dynamic facets.
+    //
+    // For example, you may always want to have rating facet returned in
+    // the response, but it's not necessarily to always display the rating facet
+    // at the top. In that case, you can set enable_dynamic_position to true so
+    // that the position of rating facet in response is determined
+    // automatically.
+    //
+    // Another example, assuming you have the following facets in the request:
+    //
+    // * "rating", enable_dynamic_position = true
+    //
+    // * "price", enable_dynamic_position = false
+    //
+    // * "brands", enable_dynamic_position = false
+    //
+    // And also you have a dynamic facets enabled, which generates a facet
+    // `gender`. Then the final order of the facets in the response can be
+    // ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
+    // "rating") depends on how API orders "gender" and "rating" facets.
+    // However, notice that "price" and "brands" are always
+    // ranked at first and second position because their enable_dynamic_position
+    // is false.
+    bool enable_dynamic_position = 4;
+  }
+
+  // Boost specification to boost certain documents.
+  message BoostSpec {
+    // Boost applies to documents which match a condition.
+    message ConditionBoostSpec {
+      // An expression which specifies a boost condition. The syntax and
+      // supported fields are the same as a filter expression. See
+      // [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+      // for detail syntax and limitations.
+      //
+      // Examples:
+      //
+      // * To boost documents with document ID "doc_1" or "doc_2", and
+      // color
+      //   "Red" or "Blue":
+      //     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+      string condition = 1;
+
+      // Strength of the condition boost, which should be in [-1, 1]. Negative
+      // boost means demotion. Default is 0.0.
+      //
+      // Setting to 1.0 gives the document a big promotion. However, it does not
+      // necessarily mean that the boosted document will be the top result at
+      // all times, nor that other documents will be excluded. Results could
+      // still be shown even when none of them matches the condition. And
+      // results that are significantly more relevant to the search query can
+      // still trump your heavily favored but irrelevant documents.
+      //
+      // Setting to -1.0 gives the document a big demotion. However, results
+      // that are deeply relevant might still be shown. The document will have
+      // an upstream battle to get a fairly high ranking, but it is not blocked
+      // out completely.
+      //
+      // Setting to 0.0 means no boost applied. The boosting condition is
+      // ignored.
+      float boost = 2;
+    }
+
+    // Condition boost specifications. If a document matches multiple conditions
+    // in the specifictions, boost scores from these specifications are all
+    // applied and combined in a non-linear way. Maximum number of
+    // specifications is 20.
+    repeated ConditionBoostSpec condition_boost_specs = 1;
+  }
+
   // Specification to determine under which conditions query expansion should
   // occur.
   message QueryExpansionSpec {
@@ -78,6 +262,11 @@ message SearchRequest {
     // The condition under which query expansion should occur. Default to
     // [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
     Condition condition = 1;
+
+    // Whether to pin unexpanded results. If this field is set to true,
+    // unexpanded products are always at the top of the search results, followed
+    // by the expanded results.
+    bool pin_unexpanded_results = 2;
   }
 
   // The specification for query spell correction.
@@ -106,25 +295,91 @@ message SearchRequest {
     Mode mode = 1;
   }
 
-  // The specification that configs the desired behavior of the UCS content
-  // search.
+  // A specification for configuring the behavior of content search.
   message ContentSearchSpec {
-    // The specification that configs the snippet in the search results.
+    // A specification for configuring snippets in a search response.
     message SnippetSpec {
-      // Max number of snippets returned in each search result.
-      // If the matching snippets is less than the max_snippet_count, return all
-      // of the snippets; otherwise, return the max_snippet_count.
+      // [DEPRECATED] This field is deprecated. To control snippet return, use
+      // `return_snippet` field. For backwards compatibility, we will return
+      // snippet if max_snippet_count > 0.
+      int32 max_snippet_count = 1 [deprecated = true];
+
+      // [DEPRECATED] This field is deprecated and will have no affect on the
+      // snippet.
+      bool reference_only = 2 [deprecated = true];
+
+      // If `true`, then return snippet. If no snippet can be generated, we
+      // return "No snippet is available for this page." A `snippet_status` with
+      // `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+      bool return_snippet = 3;
+    }
+
+    // A specification for configuring a summary returned in a search
+    // response.
+    message SummarySpec {
+      // The number of top results to generate the summary from. If the number
+      // of results returned is less than `summaryResultCount`, the summary is
+      // generated from all of the results.
       //
-      // At most 5 snippets will be returned for each SearchResult.
-      int32 max_snippet_count = 1;
+      // At most five results can be used to generate a summary.
+      int32 summary_result_count = 1;
 
-      // if true, only snippet reference is returned.
-      bool reference_only = 2;
+      // Specifies whether to include citations in the summary. The default
+      // value is `false`.
+      //
+      // When this field is set to `true`, summaries include in-line citation
+      // numbers.
+      //
+      // Example summary including citations:
+      //
+      // BigQuery is Google Cloud's fully managed and completely serverless
+      // enterprise data warehouse [1]. BigQuery supports all data types, works
+      // across clouds, and has built-in machine learning and business
+      // intelligence, all within a unified platform [2, 3].
+      //
+      // The citation numbers refer to the returned search results and are
+      // 1-indexed. For example, [1] means that the sentence is attributed to
+      // the first search result. [2, 3] means that the sentence is attributed
+      // to both the second and third search results.
+      bool include_citations = 2;
+
+      // Specifies whether to filter out adversarial queries. The default value
+      // is `false`.
+      //
+      // Google employs search-query classification to detect adversarial
+      // queries. No summary is returned if the search query is classified as an
+      // adversarial query. For example, a user might ask a question regarding
+      // negative comments about the company or submit a query designed to
+      // generate unsafe, policy-violating output. If this field is set to
+      // `true`, we skip generating summaries for adversarial queries and return
+      // fallback messages instead.
+      bool ignore_adversarial_query = 3;
+
+      // Specifies whether to filter out queries that are not summary-seeking.
+      // The default value is `false`.
+      //
+      // Google employs search-query classification to detect summary-seeking
+      // queries. No summary is returned if the search query is classified as a
+      // non-summary seeking query. For example, `why is the sky blue` and `Who
+      // is the best soccer player in the world?` are summary-seeking queries,
+      // but `SFO airport` and `world cup 2026` are not. They are most likely
+      // navigational queries. If this field is set to `true`, we skip
+      // generating summaries for non-summary seeking queries and return
+      // fallback messages instead.
+      bool ignore_non_summary_seeking_query = 4;
+
+      // Language code for Summary. Use language tags defined by
+      // [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+      string language_code = 6;
     }
 
-    // If there is no snippet spec provided, there will be no snippet in the
-    // search result.
+    // If `snippetSpec` is not specified, snippets are not included in the
+    // search response.
     SnippetSpec snippet_spec = 1;
+
+    // If `summarySpec` is not specified, summaries are not included in the
+    // search response.
+    SummarySpec summary_spec = 2;
   }
 
   // Required. The resource name of the Search serving config, such as
@@ -150,9 +405,12 @@ message SearchRequest {
   // Raw search query.
   string query = 3;
 
+  // Raw image query.
+  ImageQuery image_query = 19;
+
   // Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
   // return. If unspecified, defaults to a reasonable value. The maximum allowed
-  // value is 100. Values above 100 will be coerced to 100.
+  // value is 100. Values above 100 are coerced to 100.
   //
   // If this field is negative, an  `INVALID_ARGUMENT`  is returned.
   int32 page_size = 4;
@@ -177,11 +435,36 @@ message SearchRequest {
   // If this field is negative, an  `INVALID_ARGUMENT`  is returned.
   int32 offset = 6;
 
+  // The filter syntax consists of an expression language for constructing a
+  // predicate from one or more fields of the documents being filtered. Filter
+  // expression is case-sensitive.
+  //
+  // If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+  string filter = 7;
+
+  // The order in which documents are returned. Documents can be ordered by
+  // a field in an [Document][google.cloud.discoveryengine.v1.Document] object.
+  // Leave it unset if ordered by relevance. `order_by` expression is
+  // case-sensitive.
+  //
+  // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+  string order_by = 8;
+
   // Information about the end user.
-  // Highly recommended for analytics. The user_agent string in UserInfo will
-  // be used to deduce device_type for analytics.
+  // Highly recommended for analytics.
+  // [UserInfo.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent]
+  // is used to deduce `device_type` for analytics.
   UserInfo user_info = 21;
 
+  // Facet specifications for faceted search. If empty, no facets are returned.
+  //
+  // A maximum of 100 values are allowed. Otherwise, an  `INVALID_ARGUMENT`
+  // error is returned.
+  repeated FacetSpec facet_specs = 9;
+
+  // Boost specification to boost certain documents.
+  BoostSpec boost_spec = 10;
+
   // Additional search parameters.
   //
   // For public website search only, supported values are:
@@ -194,11 +477,11 @@ message SearchRequest {
   map params = 11;
 
   // The query expansion specification that specifies the conditions under which
-  // query expansion will occur.
+  // query expansion occurs.
   QueryExpansionSpec query_expansion_spec = 13;
 
   // The spell correction specification that specifies the mode under
-  // which spell correction will take effect.
+  // which spell correction takes effect.
   SpellCorrectionSpec spell_correction_spec = 14;
 
   // A unique identifier for tracking visitors. For example, this could be
@@ -217,12 +500,11 @@ message SearchRequest {
   // characters. Otherwise, an  `INVALID_ARGUMENT`  error is returned.
   string user_pseudo_id = 15;
 
-  // The content search spec that configs the desired behavior of content
-  // search.
+  // A specification for configuring the behavior of content search.
   ContentSearchSpec content_search_spec = 24;
 
   // Whether to turn on safe search. This is only supported for
-  // [ContentConfig.PUBLIC_WEBSITE][].
+  // website search.
   bool safe_search = 20;
 
   // The user labels applied to a resource must meet the following requirements:
@@ -260,9 +542,118 @@ message SearchResponse {
     Document document = 2;
   }
 
+  // A facet result.
+  message Facet {
+    // A facet value which contains value names and their count.
+    message FacetValue {
+      // A facet value which contains values.
+      oneof facet_value {
+        // Text value of a facet, such as "Black" for facet "colors".
+        string value = 1;
+
+        // Interval value for a facet, such as [10, 20) for facet "price". It
+        // matches
+        // [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
+        Interval interval = 2;
+      }
+
+      // Number of items that have this facet value.
+      int64 count = 3;
+    }
+
+    // The key for this facet. E.g., "colors" or "price". It matches
+    // [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.key].
+    string key = 1;
+
+    // The facet values for this field.
+    repeated FacetValue values = 2;
+
+    // Whether the facet is dynamically generated.
+    bool dynamic_facet = 3;
+  }
+
+  // Summary of the top N search result specified by the summary spec.
+  message Summary {
+    // Safety Attribute categories and their associated confidence scores.
+    message SafetyAttributes {
+      // The display names of Safety Attribute categories associated with the
+      // generated content. Order matches the Scores.
+      repeated string categories = 1;
+
+      // The confidence scores of the each category, higher
+      // value means higher confidence. Order matches the Categories.
+      repeated float scores = 2;
+    }
+
+    // An Enum for summary-skipped reasons.
+    enum SummarySkippedReason {
+      // Default value. The summary skipped reason is not specified.
+      SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0;
+
+      // The adversarial query ignored case.
+      //
+      // Only populated when
+      // [SummarySpec.ignore_adversarial_query][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ignore_adversarial_query]
+      // is set to `true`.
+      ADVERSARIAL_QUERY_IGNORED = 1;
+
+      // The non-summary seeking query ignored case.
+      //
+      // Only populated when
+      // [SummarySpec.ignore_non_summary_seeking_query][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_summary_seeking_query]
+      // is set to `true`.
+      NON_SUMMARY_SEEKING_QUERY_IGNORED = 2;
+
+      // The out-of-domain query ignored case.
+      //
+      // Google skips the summary if there are no high-relevance search results.
+      // For example, the data store contains facts about company A but the
+      // user query is asking questions about company B.
+      OUT_OF_DOMAIN_QUERY_IGNORED = 3;
+
+      // The potential policy violation case.
+      //
+      // Google skips the summary if there is a potential policy violation
+      // detected. This includes content that may be violent or toxic.
+      POTENTIAL_POLICY_VIOLATION = 4;
+
+      // The LLM addon not enabled case.
+      //
+      // Google skips the summary if the LLM addon is not enabled.
+      LLM_ADDON_NOT_ENABLED = 5;
+    }
+
+    // The summary content.
+    string summary_text = 1;
+
+    // Additional summary-skipped reasons. This provides the reason for ignored
+    // cases. If nothing is skipped, this field is not set.
+    repeated SummarySkippedReason summary_skipped_reasons = 2;
+
+    // A collection of Safety Attribute categories and their associated
+    // confidence scores.
+    SafetyAttributes safety_attributes = 3;
+  }
+
+  // Information describing query expansion including whether expansion has
+  // occurred.
+  message QueryExpansionInfo {
+    // Bool describing whether query expansion has occurred.
+    bool expanded_query = 1;
+
+    // Number of pinned results. This field will only be set when expansion
+    // happens and
+    // [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+    // is set to true.
+    int64 pinned_result_count = 2;
+  }
+
   // A list of matched documents. The order represents the ranking.
   repeated SearchResult results = 1;
 
+  // Results of facets requested by user.
+  repeated Facet facets = 2;
+
   // The estimated total count of matched items irrespective of pagination. The
   // count of [results][google.cloud.discoveryengine.v1.SearchResponse.results]
   // returned by pagination may be less than the
@@ -276,6 +667,14 @@ message SearchResponse {
   // performance.
   string attribution_token = 4;
 
+  // The URI of a customer-defined redirect page. If redirect action is
+  // triggered, no search is performed, and only
+  // [redirect_uri][google.cloud.discoveryengine.v1.SearchResponse.redirect_uri]
+  // and
+  // [attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token]
+  // are set in the response.
+  string redirect_uri = 12;
+
   // A token that can be sent as
   // [SearchRequest.page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token]
   // to retrieve the next page. If this field is omitted, there are no
@@ -286,4 +685,13 @@ message SearchResponse {
   // is AUTOMATIC, then the search results are based on corrected_query.
   // Otherwise the original query is used for search.
   string corrected_query = 7;
+
+  // A summary as part of the search results.
+  // This field is only returned if
+  // [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
+  // is set.
+  Summary summary = 9;
+
+  // Query expansion information for the returned results.
+  QueryExpansionInfo query_expansion_info = 14;
 }
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/user_event.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/user_event.proto
index f141a2911e44..addcf784e0f8 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/user_event.proto
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/user_event.proto
@@ -66,7 +66,7 @@ message UserEvent {
   // quality.
   //
   // The field must be a UTF-8 encoded string with a length limit of 128
-  // characters. Otherwise, an INVALID_ARGUMENT error is returned.
+  // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
   //
   // The field should not contain PII or user-data. We recommend to use Google
   // Analytics [Client
@@ -119,20 +119,17 @@ message UserEvent {
   //
   // The value must be one of:
   //
-  // * [PredictResponse.attribution_token][] for events that are the result of
+  // * [RecommendResponse.attribution_token][] for events that are the result of
   // [RecommendationService.Recommend][].
   // * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of
   // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search].
-  // * [CompleteQueryResponse.attribution_token][] for events that are the
-  // result of
-  // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery].
   //
   // This token enables us to accurately attribute page view or conversion
   // completion back to the event and the particular predict response containing
   // this clicked/purchased product. If user clicks on product K in the
-  // recommendation results, pass [PredictResponse.attribution_token][] as a URL
-  // parameter to product K's page. When recording events on product K's page,
-  // log the [PredictResponse.attribution_token][] to this field.
+  // recommendation results, pass [RecommendResponse.attribution_token][] as a
+  // URL parameter to product K's page. When recording events on product K's
+  // page, log the [RecommendResponse.attribution_token][] to this field.
   string attribution_token = 8;
 
   // The filter syntax consists of an expression language for constructing a
@@ -140,8 +137,9 @@ message UserEvent {
   //
   // One example is for `search` events, the associated
   // [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain
-  // a filter expression in [SearchRequest.filter][] conforming to
-  // https://google.aip.dev/160#filtering.
+  // a filter expression in
+  // [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]
+  // conforming to https://google.aip.dev/160#filtering.
   //
   // Similarly, for `view-item-list` events that are generated from a
   // [RecommendationService.RecommendRequest][], this field may be populated
@@ -149,10 +147,11 @@ message UserEvent {
   // to https://google.aip.dev/160#filtering.
   //
   // The value must be a UTF-8 encoded string with a length limit of 1,000
-  // characters. Otherwise, an INVALID_ARGUMENT error is returned.
+  // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
   string filter = 9;
 
-  // List of Documents associated with this user event.
+  // List of [Document][google.cloud.discoveryengine.v1.Document]s associated
+  // with this user event.
   //
   // This field is optional except for the following event types:
   //
@@ -174,12 +173,14 @@ message UserEvent {
   // Panel metadata associated with this user event.
   PanelInfo panel = 11;
 
-  // Search API details related to the event.
+  // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
+  // details related to the event.
   //
   // This field should be set for `search` event.
   SearchInfo search_info = 12;
 
-  // CompleteQuery API details related to the event.
+  // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
+  // details related to the event.
   //
   // This field should be set for `search` event when autocomplete function is
   // enabled and the user clicks a suggestion for search.
@@ -219,7 +220,7 @@ message UserEvent {
   // * For number attributes, at most 400 values are allowed.
   //
   // For product recommendations, an example of extra user information is
-  // ` traffic_channel`, which is how a user arrives at the site. Users can
+  // `traffic_channel`, which is how a user arrives at the site. Users can
   // arrive
   // at the site by coming to the site directly, coming through Google
   // search, or in other ways.
@@ -235,7 +236,7 @@ message PageInfo {
   //
   // This should be kept the same for all user events triggered from the same
   // pageview. For example, an item detail page view could trigger multiple
-  // events as the user is browsing the page. The `pageViewId` property should
+  // events as the user is browsing the page. The `pageview_id` property should
   // be kept the same for all these events so that they can be grouped together
   // properly.
   //
@@ -251,10 +252,10 @@ message PageInfo {
   //
   // Category pages include special pages such as sales or promotions. For
   // instance, a special sale page may have the category hierarchy:
-  // "pageCategory" : "Sales > 2017 Black Friday Deals".
+  // `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
   //
   // Required for `view-category-page` events. Other event types should not set
-  // this field. Otherwise, an INVALID_ARGUMENT error is returned.
+  // this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
   string page_category = 2;
 
   // Complete URL (window.location.href) of the user's current page.
@@ -281,24 +282,26 @@ message SearchInfo {
   // for definition.
   //
   // The value must be a UTF-8 encoded string with a length limit of 5,000
-  // characters. Otherwise, an INVALID_ARGUMENT error is returned.
+  // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
   //
   // At least one of
   // [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or
   // [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category]
   // is required for `search` events. Other event types should not set this
-  // field. Otherwise, an INVALID_ARGUMENT error is returned.
+  // field. Otherwise, an `INVALID_ARGUMENT` error is returned.
   string search_query = 1;
 
   // The order in which products are returned, if applicable.
   //
-  // See [SearchRequest.order_by][] for definition and syntax.
+  // See
+  // [SearchRequest.order_by][google.cloud.discoveryengine.v1.SearchRequest.order_by]
+  // for definition and syntax.
   //
   // The value must be a UTF-8 encoded string with a length limit of 1,000
-  // characters. Otherwise, an INVALID_ARGUMENT error is returned.
+  // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
   //
   // This can only be set for `search` events. Other event types should not set
-  // this field. Otherwise, an INVALID_ARGUMENT error is returned.
+  // this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
   string order_by = 2;
 
   // An integer that specifies the current offset for pagination (the 0-indexed
@@ -308,20 +311,22 @@ message SearchInfo {
   // [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset]
   // for definition.
   //
-  // If this field is negative, an INVALID_ARGUMENT is returned.
+  // If this field is negative, an `INVALID_ARGUMENT` is returned.
   //
   // This can only be set for `search` events. Other event types should not set
-  // this field. Otherwise, an INVALID_ARGUMENT error is returned.
+  // this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
   optional int32 offset = 3;
 }
 
 // Detailed completion information including completion attribution token and
 // clicked completion info.
 message CompletionInfo {
-  // End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
+  // End user selected
+  // [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion].
   string selected_suggestion = 1;
 
-  // End user selected [CompleteQueryResponse.CompletionResult.suggestion][]
+  // End user selected
+  // [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.suggestion]
   // position, starting from 0.
   int32 selected_position = 2;
 }
@@ -389,17 +394,19 @@ message DocumentInfo {
   // `{location}`, `{collection_id}`, `{data_store_id}`, and
   // `{branch_id}` are used when annotating with the stored Document.
   oneof document_descriptor {
-    // Required. The Document resource ID.
-    string id = 1 [(google.api.field_behavior) = REQUIRED];
+    // The [Document][google.cloud.discoveryengine.v1.Document] resource ID.
+    string id = 1;
 
-    // Required. The Document resource full name, of the form:
+    // The [Document][google.cloud.discoveryengine.v1.Document] resource full
+    // name, of the form:
     // `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
-    string name = 2 [
-      (google.api.field_behavior) = REQUIRED,
-      (google.api.resource_reference) = {
-        type: "discoveryengine.googleapis.com/Document"
-      }
-    ];
+    string name = 2 [(google.api.resource_reference) = {
+      type: "discoveryengine.googleapis.com/Document"
+    }];
+
+    // The [Document][google.cloud.discoveryengine.v1.Document] URI - only
+    // allowed for website data stores.
+    string uri = 6;
   }
 
   // Quantity of the Document associated with the user event. Defaults to 1.
@@ -443,11 +450,13 @@ message PanelInfo {
 message MediaInfo {
   // The media progress time in seconds, if applicable.
   // For example, if the end user has finished 90 seconds of a playback video,
-  // then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should
-  // be set to 90.
+  // then
+  // [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+  // should be set to 90.
   google.protobuf.Duration media_progress_duration = 1;
 
-  // Media progress should be computed using only the media_progress_duration
+  // Media progress should be computed using only the
+  // [media_progress_duration][google.cloud.discoveryengine.v1.MediaInfo.media_progress_duration]
   // relative to the media total length.
   //
   // This value must be between `[0, 1.0]` inclusive.
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/user_event_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/user_event_service.proto
index 4dbeea46c583..faedebe66545 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/user_event_service.proto
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1/src/main/proto/google/cloud/discoveryengine/v1/user_event_service.proto
@@ -53,7 +53,7 @@ service UserEventService {
   }
 
   // Writes a single user event from the browser. This uses a GET request to
-  // due to browser restriction of POST-ing to a 3rd party domain.
+  // due to browser restriction of POST-ing to a third-party domain.
   //
   // This method is used only by the Discovery Engine API JavaScript pixel and
   // Google Tag Manager. Users should not call this method directly.
@@ -122,7 +122,7 @@ message CollectUserEventRequest {
 
   // The URL including cgi-parameters but excluding the hash fragment with a
   // length limit of 5,000 characters. This is often more useful than the
-  // referer URL, because many browsers only send the domain for 3rd party
+  // referer URL, because many browsers only send the domain for third-party
   // requests.
   optional string uri = 3;
 
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/CommonProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/CommonProto.java
index a077385fef7f..cf83d89afe4a 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/CommonProto.java
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/CommonProto.java
@@ -39,6 +39,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
       internal_static_google_cloud_discoveryengine_v1beta_UserInfo_descriptor;
   static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
       internal_static_google_cloud_discoveryengine_v1beta_UserInfo_fieldAccessorTable;
+  static final com.google.protobuf.Descriptors.Descriptor
+      internal_static_google_cloud_discoveryengine_v1beta_DoubleList_descriptor;
+  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_google_cloud_discoveryengine_v1beta_DoubleList_fieldAccessorTable;
 
   public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
     return descriptor;
@@ -56,32 +60,32 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "lusive_maximum\030\004 \001(\001H\001B\005\n\003minB\005\n\003max\"0\n\017"
           + "CustomAttribute\022\014\n\004text\030\001 \003(\t\022\017\n\007numbers"
           + "\030\002 \003(\001\"/\n\010UserInfo\022\017\n\007user_id\030\001 \001(\t\022\022\n\nu"
-          + "ser_agent\030\002 \001(\tB\322\007\n\'com.google.cloud.dis"
-          + "coveryengine.v1betaB\013CommonProtoP\001ZQclou"
-          + "d.google.com/go/discoveryengine/apiv1bet"
-          + "a/discoveryenginepb;discoveryenginepb\242\002\017"
-          + "DISCOVERYENGINE\252\002#Google.Cloud.Discovery"
-          + "Engine.V1Beta\312\002#Google\\Cloud\\DiscoveryEn"
-          + "gine\\V1beta\352\002&Google::Cloud::DiscoveryEn"
-          + "gine::V1beta\352A\346\001\n%discoveryengine.google"
-          + "apis.com/Branch\022Qprojects/{project}/loca"
-          + "tions/{location}/dataStores/{data_store}"
-          + "/branches/{branch}\022jprojects/{project}/l"
-          + "ocations/{location}/collections/{collect"
-          + "ion}/dataStores/{data_store}/branches/{b"
-          + "ranch}\352A\305\001\n(discoveryengine.googleapis.c"
-          + "om/DataStore\022?projects/{project}/locatio"
-          + "ns/{location}/dataStores/{data_store}\022Xp"
-          + "rojects/{project}/locations/{location}/c"
-          + "ollections/{collection}/dataStores/{data"
-          + "_store}\352A\211\002\n,discoveryengine.googleapis."
-          + "com/ServingConfig\022_projects/{project}/lo"
-          + "cations/{location}/dataStores/{data_stor"
-          + "e}/servingConfigs/{serving_config}\022xproj"
-          + "ects/{project}/locations/{location}/coll"
-          + "ections/{collection}/dataStores/{data_st"
-          + "ore}/servingConfigs/{serving_config}b\006pr"
-          + "oto3"
+          + "ser_agent\030\002 \001(\t\"\034\n\nDoubleList\022\016\n\006values\030"
+          + "\001 \003(\001B\322\007\n\'com.google.cloud.discoveryengi"
+          + "ne.v1betaB\013CommonProtoP\001ZQcloud.google.c"
+          + "om/go/discoveryengine/apiv1beta/discover"
+          + "yenginepb;discoveryenginepb\242\002\017DISCOVERYE"
+          + "NGINE\252\002#Google.Cloud.DiscoveryEngine.V1B"
+          + "eta\312\002#Google\\Cloud\\DiscoveryEngine\\V1bet"
+          + "a\352\002&Google::Cloud::DiscoveryEngine::V1be"
+          + "ta\352A\346\001\n%discoveryengine.googleapis.com/B"
+          + "ranch\022Qprojects/{project}/locations/{loc"
+          + "ation}/dataStores/{data_store}/branches/"
+          + "{branch}\022jprojects/{project}/locations/{"
+          + "location}/collections/{collection}/dataS"
+          + "tores/{data_store}/branches/{branch}\352A\305\001"
+          + "\n(discoveryengine.googleapis.com/DataSto"
+          + "re\022?projects/{project}/locations/{locati"
+          + "on}/dataStores/{data_store}\022Xprojects/{p"
+          + "roject}/locations/{location}/collections"
+          + "/{collection}/dataStores/{data_store}\352A\211"
+          + "\002\n,discoveryengine.googleapis.com/Servin"
+          + "gConfig\022_projects/{project}/locations/{l"
+          + "ocation}/dataStores/{data_store}/serving"
+          + "Configs/{serving_config}\022xprojects/{proj"
+          + "ect}/locations/{location}/collections/{c"
+          + "ollection}/dataStores/{data_store}/servi"
+          + "ngConfigs/{serving_config}b\006proto3"
     };
     descriptor =
         com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -113,6 +117,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
             new java.lang.String[] {
               "UserId", "UserAgent",
             });
+    internal_static_google_cloud_discoveryengine_v1beta_DoubleList_descriptor =
+        getDescriptor().getMessageTypes().get(3);
+    internal_static_google_cloud_discoveryengine_v1beta_DoubleList_fieldAccessorTable =
+        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+            internal_static_google_cloud_discoveryengine_v1beta_DoubleList_descriptor,
+            new java.lang.String[] {
+              "Values",
+            });
     com.google.protobuf.ExtensionRegistry registry =
         com.google.protobuf.ExtensionRegistry.newInstance();
     registry.add(com.google.api.ResourceProto.resourceDefinition);
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationProto.java
index 3d0d87bdb329..4a61b7517492 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationProto.java
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationProto.java
@@ -63,46 +63,50 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
       "\n6google/cloud/discoveryengine/v1beta/co"
           + "nversation.proto\022#google.cloud.discovery"
           + "engine.v1beta\032\037google/api/field_behavior"
-          + ".proto\032\031google/api/resource.proto\032\037googl"
-          + "e/protobuf/timestamp.proto\"\201\005\n\014Conversat"
-          + "ion\022\022\n\004name\030\001 \001(\tB\004\342A\001\005\022F\n\005state\030\002 \001(\01627"
-          + ".google.cloud.discoveryengine.v1beta.Con"
-          + "versation.State\022\026\n\016user_pseudo_id\030\003 \001(\t\022"
-          + "J\n\010messages\030\004 \003(\01328.google.cloud.discove"
-          + "ryengine.v1beta.ConversationMessage\0224\n\ns"
-          + "tart_time\030\005 \001(\0132\032.google.protobuf.Timest"
-          + "ampB\004\342A\001\003\0222\n\010end_time\030\006 \001(\0132\032.google.pro"
-          + "tobuf.TimestampB\004\342A\001\003\">\n\005State\022\025\n\021STATE_"
-          + "UNSPECIFIED\020\000\022\017\n\013IN_PROGRESS\020\001\022\r\n\tCOMPLE"
-          + "TED\020\002:\206\002\352A\202\002\n+discoveryengine.googleapis"
-          + ".com/Conversation\022\\projects/{project}/lo"
-          + "cations/{location}/dataStores/{data_stor"
-          + "e}/conversations/{conversation}\022uproject"
-          + "s/{project}/locations/{location}/collect"
-          + "ions/{collection}/dataStores/{data_store"
-          + "}/conversations/{conversation}\"\253\001\n\005Reply"
-          + "\022\r\n\005reply\030\001 \001(\t\022H\n\nreferences\030\002 \003(\01324.go"
-          + "ogle.cloud.discoveryengine.v1beta.Reply."
-          + "Reference\032I\n\tReference\022\013\n\003uri\030\001 \001(\t\022\023\n\013a"
-          + "nchor_text\030\002 \001(\t\022\r\n\005start\030\003 \001(\005\022\013\n\003end\030\004"
-          + " \001(\005\"I\n\023ConversationContext\022\031\n\021context_d"
-          + "ocuments\030\001 \003(\t\022\027\n\017active_document\030\002 \001(\t\""
-          + "e\n\tTextInput\022\r\n\005input\030\001 \001(\t\022I\n\007context\030\002"
-          + " \001(\01328.google.cloud.discoveryengine.v1be"
-          + "ta.ConversationContext\"\332\001\n\023ConversationM"
-          + "essage\022D\n\nuser_input\030\001 \001(\0132..google.clou"
-          + "d.discoveryengine.v1beta.TextInputH\000\022;\n\005"
-          + "reply\030\002 \001(\0132*.google.cloud.discoveryengi"
-          + "ne.v1beta.ReplyH\000\0225\n\013create_time\030\003 \001(\0132\032"
-          + ".google.protobuf.TimestampB\004\342A\001\003B\t\n\007mess"
-          + "ageB\230\002\n\'com.google.cloud.discoveryengine"
-          + ".v1betaB\021ConversationProtoP\001ZQcloud.goog"
-          + "le.com/go/discoveryengine/apiv1beta/disc"
-          + "overyenginepb;discoveryenginepb\242\002\017DISCOV"
-          + "ERYENGINE\252\002#Google.Cloud.DiscoveryEngine"
-          + ".V1Beta\312\002#Google\\Cloud\\DiscoveryEngine\\V"
-          + "1beta\352\002&Google::Cloud::DiscoveryEngine::"
-          + "V1betab\006proto3"
+          + ".proto\032\031google/api/resource.proto\0328googl"
+          + "e/cloud/discoveryengine/v1beta/search_se"
+          + "rvice.proto\032\037google/protobuf/timestamp.p"
+          + "roto\"\201\005\n\014Conversation\022\022\n\004name\030\001 \001(\tB\004\342A\001"
+          + "\005\022F\n\005state\030\002 \001(\01627.google.cloud.discover"
+          + "yengine.v1beta.Conversation.State\022\026\n\016use"
+          + "r_pseudo_id\030\003 \001(\t\022J\n\010messages\030\004 \003(\01328.go"
+          + "ogle.cloud.discoveryengine.v1beta.Conver"
+          + "sationMessage\0224\n\nstart_time\030\005 \001(\0132\032.goog"
+          + "le.protobuf.TimestampB\004\342A\001\003\0222\n\010end_time\030"
+          + "\006 \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\""
+          + ">\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\017\n\013IN_PR"
+          + "OGRESS\020\001\022\r\n\tCOMPLETED\020\002:\206\002\352A\202\002\n+discover"
+          + "yengine.googleapis.com/Conversation\022\\pro"
+          + "jects/{project}/locations/{location}/dat"
+          + "aStores/{data_store}/conversations/{conv"
+          + "ersation}\022uprojects/{project}/locations/"
+          + "{location}/collections/{collection}/data"
+          + "Stores/{data_store}/conversations/{conve"
+          + "rsation}\"\205\002\n\005Reply\022\021\n\005reply\030\001 \001(\tB\002\030\001\022L\n"
+          + "\nreferences\030\002 \003(\01324.google.cloud.discove"
+          + "ryengine.v1beta.Reply.ReferenceB\002\030\001\022L\n\007s"
+          + "ummary\030\003 \001(\0132;.google.cloud.discoveryeng"
+          + "ine.v1beta.SearchResponse.Summary\032M\n\tRef"
+          + "erence\022\013\n\003uri\030\001 \001(\t\022\023\n\013anchor_text\030\002 \001(\t"
+          + "\022\r\n\005start\030\003 \001(\005\022\013\n\003end\030\004 \001(\005:\002\030\001\"I\n\023Conv"
+          + "ersationContext\022\031\n\021context_documents\030\001 \003"
+          + "(\t\022\027\n\017active_document\030\002 \001(\t\"e\n\tTextInput"
+          + "\022\r\n\005input\030\001 \001(\t\022I\n\007context\030\002 \001(\01328.googl"
+          + "e.cloud.discoveryengine.v1beta.Conversat"
+          + "ionContext\"\332\001\n\023ConversationMessage\022D\n\nus"
+          + "er_input\030\001 \001(\0132..google.cloud.discoverye"
+          + "ngine.v1beta.TextInputH\000\022;\n\005reply\030\002 \001(\0132"
+          + "*.google.cloud.discoveryengine.v1beta.Re"
+          + "plyH\000\0225\n\013create_time\030\003 \001(\0132\032.google.prot"
+          + "obuf.TimestampB\004\342A\001\003B\t\n\007messageB\230\002\n\'com."
+          + "google.cloud.discoveryengine.v1betaB\021Con"
+          + "versationProtoP\001ZQcloud.google.com/go/di"
+          + "scoveryengine/apiv1beta/discoveryenginep"
+          + "b;discoveryenginepb\242\002\017DISCOVERYENGINE\252\002#"
+          + "Google.Cloud.DiscoveryEngine.V1Beta\312\002#Go"
+          + "ogle\\Cloud\\DiscoveryEngine\\V1beta\352\002&Goog"
+          + "le::Cloud::DiscoveryEngine::V1betab\006prot"
+          + "o3"
     };
     descriptor =
         com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -110,6 +114,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
             new com.google.protobuf.Descriptors.FileDescriptor[] {
               com.google.api.FieldBehaviorProto.getDescriptor(),
               com.google.api.ResourceProto.getDescriptor(),
+              com.google.cloud.discoveryengine.v1beta.SearchServiceProto.getDescriptor(),
               com.google.protobuf.TimestampProto.getDescriptor(),
             });
     internal_static_google_cloud_discoveryengine_v1beta_Conversation_descriptor =
@@ -126,7 +131,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_cloud_discoveryengine_v1beta_Reply_descriptor,
             new java.lang.String[] {
-              "Reply", "References",
+              "Reply", "References", "Summary",
             });
     internal_static_google_cloud_discoveryengine_v1beta_Reply_Reference_descriptor =
         internal_static_google_cloud_discoveryengine_v1beta_Reply_descriptor
@@ -170,6 +175,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
         descriptor, registry);
     com.google.api.FieldBehaviorProto.getDescriptor();
     com.google.api.ResourceProto.getDescriptor();
+    com.google.cloud.discoveryengine.v1beta.SearchServiceProto.getDescriptor();
     com.google.protobuf.TimestampProto.getDescriptor();
   }
 
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceProto.java
index 3698f27a29bf..1bd279860bb8 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceProto.java
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConversationalSearchServiceProto.java
@@ -31,6 +31,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
       internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_descriptor;
   static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
       internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_fieldAccessorTable;
+  static final com.google.protobuf.Descriptors.Descriptor
+      internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_UserLabelsEntry_descriptor;
+  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_UserLabelsEntry_fieldAccessorTable;
   static final com.google.protobuf.Descriptors.Descriptor
       internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationResponse_descriptor;
   static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
@@ -78,7 +82,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "o\0328google/cloud/discoveryengine/v1beta/s"
           + "earch_service.proto\032\033google/protobuf/emp"
           + "ty.proto\032 google/protobuf/field_mask.pro"
-          + "to\"\317\002\n\033ConverseConversationRequest\022B\n\004na"
+          + "to\"\321\004\n\033ConverseConversationRequest\022B\n\004na"
           + "me\030\001 \001(\tB4\342A\001\002\372A-\n+discoveryengine.googl"
           + "eapis.com/Conversation\022C\n\005query\030\002 \001(\0132.."
           + "google.cloud.discoveryengine.v1beta.Text"
@@ -86,94 +90,101 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\n,discoveryengine.googleapis.com/Serving"
           + "Config\022G\n\014conversation\030\005 \001(\01321.google.cl"
           + "oud.discoveryengine.v1beta.Conversation\022"
-          + "\023\n\013safe_search\030\006 \001(\010\"\374\001\n\034ConverseConvers"
-          + "ationResponse\0229\n\005reply\030\001 \001(\0132*.google.cl"
-          + "oud.discoveryengine.v1beta.Reply\022G\n\014conv"
-          + "ersation\030\002 \001(\01321.google.cloud.discoverye"
-          + "ngine.v1beta.Conversation\022X\n\016search_resu"
-          + "lts\030\003 \003(\0132@.google.cloud.discoveryengine"
-          + ".v1beta.SearchResponse.SearchResult\"\255\001\n\031"
-          + "CreateConversationRequest\022A\n\006parent\030\001 \001("
-          + "\tB1\342A\001\002\372A*\n(discoveryengine.googleapis.c"
-          + "om/DataStore\022M\n\014conversation\030\002 \001(\01321.goo"
-          + "gle.cloud.discoveryengine.v1beta.Convers"
-          + "ationB\004\342A\001\002\"\233\001\n\031UpdateConversationReques"
-          + "t\022M\n\014conversation\030\001 \001(\01321.google.cloud.d"
-          + "iscoveryengine.v1beta.ConversationB\004\342A\001\002"
-          + "\022/\n\013update_mask\030\002 \001(\0132\032.google.protobuf."
-          + "FieldMask\"_\n\031DeleteConversationRequest\022B"
-          + "\n\004name\030\001 \001(\tB4\342A\001\002\372A-\n+discoveryengine.g"
-          + "oogleapis.com/Conversation\"\\\n\026GetConvers"
-          + "ationRequest\022B\n\004name\030\001 \001(\tB4\342A\001\002\372A-\n+dis"
-          + "coveryengine.googleapis.com/Conversation"
-          + "\"\246\001\n\030ListConversationsRequest\022A\n\006parent\030"
-          + "\001 \001(\tB1\342A\001\002\372A*\n(discoveryengine.googleap"
-          + "is.com/DataStore\022\021\n\tpage_size\030\002 \001(\005\022\022\n\np"
-          + "age_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010order"
-          + "_by\030\005 \001(\t\"~\n\031ListConversationsResponse\022H"
-          + "\n\rconversations\030\001 \003(\01321.google.cloud.dis"
-          + "coveryengine.v1beta.Conversation\022\027\n\017next"
-          + "_page_token\030\002 \001(\t2\266\020\n\033ConversationalSear"
-          + "chService\022\342\002\n\024ConverseConversation\022@.goo"
-          + "gle.cloud.discoveryengine.v1beta.Convers"
-          + "eConversationRequest\032A.google.cloud.disc"
-          + "overyengine.v1beta.ConverseConversationR"
-          + "esponse\"\304\001\332A\nname,query\202\323\344\223\002\260\001\"K/v1beta/"
-          + "{name=projects/*/locations/*/dataStores/"
-          + "*/conversations/*}:converse:\001*Z^\"Y/v1bet"
-          + "a/{name=projects/*/locations/*/collectio"
-          + "ns/*/dataStores/*/conversations/*}:conve"
-          + "rse:\001*\022\333\002\n\022CreateConversation\022>.google.c"
-          + "loud.discoveryengine.v1beta.CreateConver"
-          + "sationRequest\0321.google.cloud.discoveryen"
-          + "gine.v1beta.Conversation\"\321\001\332A\023parent,con"
-          + "versation\202\323\344\223\002\264\001\"B/v1beta/{parent=projec"
-          + "ts/*/locations/*/dataStores/*}/conversat"
-          + "ions:\014conversationZ`\"P/v1beta/{parent=pr"
-          + "ojects/*/locations/*/collections/*/dataS"
-          + "tores/*}/conversations:\014conversation\022\225\002\n"
-          + "\022DeleteConversation\022>.google.cloud.disco"
-          + "veryengine.v1beta.DeleteConversationRequ"
-          + "est\032\026.google.protobuf.Empty\"\246\001\332A\004name\202\323\344"
-          + "\223\002\230\001*B/v1beta/{name=projects/*/locations"
-          + "/*/dataStores/*/conversations/*}ZR*P/v1b"
-          + "eta/{name=projects/*/locations/*/collect"
-          + "ions/*/dataStores/*/conversations/*}\022\372\002\n"
-          + "\022UpdateConversation\022>.google.cloud.disco"
-          + "veryengine.v1beta.UpdateConversationRequ"
-          + "est\0321.google.cloud.discoveryengine.v1bet"
-          + "a.Conversation\"\360\001\332A\030conversation,update_"
-          + "mask\202\323\344\223\002\316\0012O/v1beta/{conversation.name="
-          + "projects/*/locations/*/dataStores/*/conv"
-          + "ersations/*}:\014conversationZm2]/v1beta/{c"
-          + "onversation.name=projects/*/locations/*/"
-          + "collections/*/dataStores/*/conversations"
-          + "/*}:\014conversation\022\252\002\n\017GetConversation\022;."
-          + "google.cloud.discoveryengine.v1beta.GetC"
+          + "\023\n\013safe_search\030\006 \001(\010\022e\n\013user_labels\030\007 \003("
+          + "\0132P.google.cloud.discoveryengine.v1beta."
+          + "ConverseConversationRequest.UserLabelsEn"
+          + "try\022f\n\014summary_spec\030\010 \001(\0132P.google.cloud"
+          + ".discoveryengine.v1beta.SearchRequest.Co"
+          + "ntentSearchSpec.SummarySpec\0321\n\017UserLabel"
+          + "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\227"
+          + "\002\n\034ConverseConversationResponse\0229\n\005reply"
+          + "\030\001 \001(\0132*.google.cloud.discoveryengine.v1"
+          + "beta.Reply\022G\n\014conversation\030\002 \001(\01321.googl"
+          + "e.cloud.discoveryengine.v1beta.Conversat"
+          + "ion\022\031\n\021related_questions\030\006 \003(\t\022X\n\016search"
+          + "_results\030\003 \003(\0132@.google.cloud.discoverye"
+          + "ngine.v1beta.SearchResponse.SearchResult"
+          + "\"\255\001\n\031CreateConversationRequest\022A\n\006parent"
+          + "\030\001 \001(\tB1\342A\001\002\372A*\n(discoveryengine.googlea"
+          + "pis.com/DataStore\022M\n\014conversation\030\002 \001(\0132"
+          + "1.google.cloud.discoveryengine.v1beta.Co"
+          + "nversationB\004\342A\001\002\"\233\001\n\031UpdateConversationR"
+          + "equest\022M\n\014conversation\030\001 \001(\01321.google.cl"
+          + "oud.discoveryengine.v1beta.ConversationB"
+          + "\004\342A\001\002\022/\n\013update_mask\030\002 \001(\0132\032.google.prot"
+          + "obuf.FieldMask\"_\n\031DeleteConversationRequ"
+          + "est\022B\n\004name\030\001 \001(\tB4\342A\001\002\372A-\n+discoveryeng"
+          + "ine.googleapis.com/Conversation\"\\\n\026GetCo"
+          + "nversationRequest\022B\n\004name\030\001 \001(\tB4\342A\001\002\372A-"
+          + "\n+discoveryengine.googleapis.com/Convers"
+          + "ation\"\246\001\n\030ListConversationsRequest\022A\n\006pa"
+          + "rent\030\001 \001(\tB1\342A\001\002\372A*\n(discoveryengine.goo"
+          + "gleapis.com/DataStore\022\021\n\tpage_size\030\002 \001(\005"
+          + "\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010"
+          + "order_by\030\005 \001(\t\"~\n\031ListConversationsRespo"
+          + "nse\022H\n\rconversations\030\001 \003(\01321.google.clou"
+          + "d.discoveryengine.v1beta.Conversation\022\027\n"
+          + "\017next_page_token\030\002 \001(\t2\266\020\n\033Conversationa"
+          + "lSearchService\022\342\002\n\024ConverseConversation\022"
+          + "@.google.cloud.discoveryengine.v1beta.Co"
+          + "nverseConversationRequest\032A.google.cloud"
+          + ".discoveryengine.v1beta.ConverseConversa"
+          + "tionResponse\"\304\001\332A\nname,query\202\323\344\223\002\260\001\"K/v1"
+          + "beta/{name=projects/*/locations/*/dataSt"
+          + "ores/*/conversations/*}:converse:\001*Z^\"Y/"
+          + "v1beta/{name=projects/*/locations/*/coll"
+          + "ections/*/dataStores/*/conversations/*}:"
+          + "converse:\001*\022\333\002\n\022CreateConversation\022>.goo"
+          + "gle.cloud.discoveryengine.v1beta.CreateC"
           + "onversationRequest\0321.google.cloud.discov"
-          + "eryengine.v1beta.Conversation\"\246\001\332A\004name\202"
-          + "\323\344\223\002\230\001\022B/v1beta/{name=projects/*/locatio"
-          + "ns/*/dataStores/*/conversations/*}ZR\022P/v"
-          + "1beta/{name=projects/*/locations/*/colle"
-          + "ctions/*/dataStores/*/conversations/*}\022\275"
-          + "\002\n\021ListConversations\022=.google.cloud.disc"
-          + "overyengine.v1beta.ListConversationsRequ"
-          + "est\032>.google.cloud.discoveryengine.v1bet"
-          + "a.ListConversationsResponse\"\250\001\332A\006parent\202"
-          + "\323\344\223\002\230\001\022B/v1beta/{parent=projects/*/locat"
-          + "ions/*/dataStores/*}/conversationsZR\022P/v"
-          + "1beta/{parent=projects/*/locations/*/col"
-          + "lections/*/dataStores/*}/conversations\032R"
-          + "\312A\036discoveryengine.googleapis.com\322A.http"
-          + "s://www.googleapis.com/auth/cloud-platfo"
-          + "rmB\247\002\n\'com.google.cloud.discoveryengine."
-          + "v1betaB ConversationalSearchServiceProto"
-          + "P\001ZQcloud.google.com/go/discoveryengine/"
-          + "apiv1beta/discoveryenginepb;discoveryeng"
-          + "inepb\242\002\017DISCOVERYENGINE\252\002#Google.Cloud.D"
-          + "iscoveryEngine.V1Beta\312\002#Google\\Cloud\\Dis"
-          + "coveryEngine\\V1beta\352\002&Google::Cloud::Dis"
-          + "coveryEngine::V1betab\006proto3"
+          + "eryengine.v1beta.Conversation\"\321\001\332A\023paren"
+          + "t,conversation\202\323\344\223\002\264\001\"B/v1beta/{parent=p"
+          + "rojects/*/locations/*/dataStores/*}/conv"
+          + "ersations:\014conversationZ`\"P/v1beta/{pare"
+          + "nt=projects/*/locations/*/collections/*/"
+          + "dataStores/*}/conversations:\014conversatio"
+          + "n\022\225\002\n\022DeleteConversation\022>.google.cloud."
+          + "discoveryengine.v1beta.DeleteConversatio"
+          + "nRequest\032\026.google.protobuf.Empty\"\246\001\332A\004na"
+          + "me\202\323\344\223\002\230\001*B/v1beta/{name=projects/*/loca"
+          + "tions/*/dataStores/*/conversations/*}ZR*"
+          + "P/v1beta/{name=projects/*/locations/*/co"
+          + "llections/*/dataStores/*/conversations/*"
+          + "}\022\372\002\n\022UpdateConversation\022>.google.cloud."
+          + "discoveryengine.v1beta.UpdateConversatio"
+          + "nRequest\0321.google.cloud.discoveryengine."
+          + "v1beta.Conversation\"\360\001\332A\030conversation,up"
+          + "date_mask\202\323\344\223\002\316\0012O/v1beta/{conversation."
+          + "name=projects/*/locations/*/dataStores/*"
+          + "/conversations/*}:\014conversationZm2]/v1be"
+          + "ta/{conversation.name=projects/*/locatio"
+          + "ns/*/collections/*/dataStores/*/conversa"
+          + "tions/*}:\014conversation\022\252\002\n\017GetConversati"
+          + "on\022;.google.cloud.discoveryengine.v1beta"
+          + ".GetConversationRequest\0321.google.cloud.d"
+          + "iscoveryengine.v1beta.Conversation\"\246\001\332A\004"
+          + "name\202\323\344\223\002\230\001\022B/v1beta/{name=projects/*/lo"
+          + "cations/*/dataStores/*/conversations/*}Z"
+          + "R\022P/v1beta/{name=projects/*/locations/*/"
+          + "collections/*/dataStores/*/conversations"
+          + "/*}\022\275\002\n\021ListConversations\022=.google.cloud"
+          + ".discoveryengine.v1beta.ListConversation"
+          + "sRequest\032>.google.cloud.discoveryengine."
+          + "v1beta.ListConversationsResponse\"\250\001\332A\006pa"
+          + "rent\202\323\344\223\002\230\001\022B/v1beta/{parent=projects/*/"
+          + "locations/*/dataStores/*}/conversationsZ"
+          + "R\022P/v1beta/{parent=projects/*/locations/"
+          + "*/collections/*/dataStores/*}/conversati"
+          + "ons\032R\312A\036discoveryengine.googleapis.com\322A"
+          + ".https://www.googleapis.com/auth/cloud-p"
+          + "latformB\247\002\n\'com.google.cloud.discoveryen"
+          + "gine.v1betaB ConversationalSearchService"
+          + "ProtoP\001ZQcloud.google.com/go/discoveryen"
+          + "gine/apiv1beta/discoveryenginepb;discove"
+          + "ryenginepb\242\002\017DISCOVERYENGINE\252\002#Google.Cl"
+          + "oud.DiscoveryEngine.V1Beta\312\002#Google\\Clou"
+          + "d\\DiscoveryEngine\\V1beta\352\002&Google::Cloud"
+          + "::DiscoveryEngine::V1betab\006proto3"
     };
     descriptor =
         com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -194,7 +205,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_descriptor,
             new java.lang.String[] {
-              "Name", "Query", "ServingConfig", "Conversation", "SafeSearch",
+              "Name",
+              "Query",
+              "ServingConfig",
+              "Conversation",
+              "SafeSearch",
+              "UserLabels",
+              "SummarySpec",
+            });
+    internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_UserLabelsEntry_descriptor =
+        internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_descriptor
+            .getNestedTypes()
+            .get(0);
+    internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_UserLabelsEntry_fieldAccessorTable =
+        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+            internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_UserLabelsEntry_descriptor,
+            new java.lang.String[] {
+              "Key", "Value",
             });
     internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationResponse_descriptor =
         getDescriptor().getMessageTypes().get(1);
@@ -202,7 +229,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationResponse_descriptor,
             new java.lang.String[] {
-              "Reply", "Conversation", "SearchResults",
+              "Reply", "Conversation", "RelatedQuestions", "SearchResults",
             });
     internal_static_google_cloud_discoveryengine_v1beta_CreateConversationRequest_descriptor =
         getDescriptor().getMessageTypes().get(2);
diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationRequest.java
index fba66b430244..676bb8df8def 100644
--- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationRequest.java
+++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationRequest.java
@@ -55,6 +55,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         .internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_descriptor;
   }
 
+  @SuppressWarnings({"rawtypes"})
+  @java.lang.Override
+  protected com.google.protobuf.MapField internalGetMapField(int number) {
+    switch (number) {
+      case 7:
+        return internalGetUserLabels();
+      default:
+        throw new RuntimeException("Invalid map field number: " + number);
+    }
+  }
+
   @java.lang.Override
   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
       internalGetFieldAccessorTable() {
@@ -315,6 +326,234 @@ public boolean getSafeSearch() {
     return safeSearch_;
   }
 
+  public static final int USER_LABELS_FIELD_NUMBER = 7;
+
+  private static final class UserLabelsDefaultEntryHolder {
+    static final com.google.protobuf.MapEntry defaultEntry =
+        com.google.protobuf.MapEntry.newDefaultInstance(
+            com.google.cloud.discoveryengine.v1beta.ConversationalSearchServiceProto
+                .internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_UserLabelsEntry_descriptor,
+            com.google.protobuf.WireFormat.FieldType.STRING,
+            "",
+            com.google.protobuf.WireFormat.FieldType.STRING,
+            "");
+  }
+
+  @SuppressWarnings("serial")
+  private com.google.protobuf.MapField userLabels_;
+
+  private com.google.protobuf.MapField internalGetUserLabels() {
+    if (userLabels_ == null) {
+      return com.google.protobuf.MapField.emptyMapField(UserLabelsDefaultEntryHolder.defaultEntry);
+    }
+    return userLabels_;
+  }
+
+  public int getUserLabelsCount() {
+    return internalGetUserLabels().getMap().size();
+  }
+  /**
+   *
+   *
+   * 
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SUMMARY_SPEC_FIELD_NUMBER = 8; + private com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + summarySpec_; + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return Whether the summarySpec field is set. + */ + @java.lang.Override + public boolean hasSummarySpec() { + return summarySpec_ != null; + } + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return The summarySpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec() { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder + getSummarySpecOrBuilder() { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -344,6 +583,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (safeSearch_ != false) { output.writeBool(6, safeSearch_); } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 7); + if (summarySpec_ != null) { + output.writeMessage(8, getSummarySpec()); + } getUnknownFields().writeTo(output); } @@ -368,6 +612,19 @@ public int getSerializedSize() { if (safeSearch_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, safeSearch_); } + for (java.util.Map.Entry entry : + internalGetUserLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry userLabels__ = + UserLabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, userLabels__); + } + if (summarySpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSummarySpec()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -395,6 +652,11 @@ public boolean equals(final java.lang.Object obj) { if (!getConversation().equals(other.getConversation())) return false; } if (getSafeSearch() != other.getSafeSearch()) return false; + if (!internalGetUserLabels().equals(other.internalGetUserLabels())) return false; + if (hasSummarySpec() != other.hasSummarySpec()) return false; + if (hasSummarySpec()) { + if (!getSummarySpec().equals(other.getSummarySpec())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -420,6 +682,14 @@ public int hashCode() { } hash = (37 * hash) + SAFE_SEARCH_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSafeSearch()); + if (!internalGetUserLabels().getMap().isEmpty()) { + hash = (37 * hash) + USER_LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetUserLabels().hashCode(); + } + if (hasSummarySpec()) { + hash = (37 * hash) + SUMMARY_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSummarySpec().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -542,6 +812,26 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_discoveryengine_v1beta_ConverseConversationRequest_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -577,6 +867,12 @@ public Builder clear() { conversationBuilder_ = null; } safeSearch_ = false; + internalGetMutableUserLabels().clear(); + summarySpec_ = null; + if (summarySpecBuilder_ != null) { + summarySpecBuilder_.dispose(); + summarySpecBuilder_ = null; + } return this; } @@ -632,6 +928,14 @@ private void buildPartial0( if (((from_bitField0_ & 0x00000010) != 0)) { result.safeSearch_ = safeSearch_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.userLabels_ = internalGetUserLabels(); + result.userLabels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.summarySpec_ = + summarySpecBuilder_ == null ? summarySpec_ : summarySpecBuilder_.build(); + } } @java.lang.Override @@ -702,6 +1006,11 @@ public Builder mergeFrom( if (other.getSafeSearch() != false) { setSafeSearch(other.getSafeSearch()); } + internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); + bitField0_ |= 0x00000020; + if (other.hasSummarySpec()) { + mergeSummarySpec(other.getSummarySpec()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -758,6 +1067,24 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 48 + case 58: + { + com.google.protobuf.MapEntry userLabels__ = + input.readMessage( + UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableUserLabels() + .getMutableMap() + .put(userLabels__.getKey(), userLabels__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 66: + { + input.readMessage(getSummarySpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1493,6 +1820,504 @@ public Builder clearSafeSearch() { return this; } + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField + internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + private com.google.protobuf.MapField + internalGetMutableUserLabels() { + if (userLabels_ == null) { + userLabels_ = + com.google.protobuf.MapField.newMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + if (!userLabels_.isMutable()) { + userLabels_ = userLabels_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearUserLabels() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableUserLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + public Builder removeUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableUserLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableUserLabels() { + bitField0_ |= 0x00000020; + return internalGetMutableUserLabels().getMutableMap(); + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + public Builder putUserLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableUserLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+     * The user labels applied to a resource must meet the following requirements:
+     *
+     * * Each resource can have multiple labels, up to a maximum of 64.
+     * * Each label must be a key-value pair.
+     * * Keys have a minimum length of 1 character and a maximum length of 63
+     *   characters and cannot be empty. Values can be empty and have a maximum
+     *   length of 63 characters.
+     * * Keys and values can contain only lowercase letters, numeric characters,
+     *   underscores, and dashes. All characters must use UTF-8 encoding, and
+     *   international characters are allowed.
+     * * The key portion of a label must be unique. However, you can use the same
+     *   key with multiple resources.
+     * * Keys must start with a lowercase letter or international character.
+     *
+     * See [Google Cloud
+     * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 7; + */ + public Builder putAllUserLabels(java.util.Map values) { + internalGetMutableUserLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + summarySpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + .Builder, + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder> + summarySpecBuilder_; + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return Whether the summarySpec field is set. + */ + public boolean hasSummarySpec() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return The summarySpec. + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec() { + if (summarySpecBuilder_ == null) { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } else { + return summarySpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder setSummarySpec( + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec value) { + if (summarySpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summarySpec_ = value; + } else { + summarySpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder setSummarySpec( + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.Builder + builderForValue) { + if (summarySpecBuilder_ == null) { + summarySpec_ = builderForValue.build(); + } else { + summarySpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder mergeSummarySpec( + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec value) { + if (summarySpecBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && summarySpec_ != null + && summarySpec_ + != com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec + .SummarySpec.getDefaultInstance()) { + getSummarySpecBuilder().mergeFrom(value); + } else { + summarySpec_ = value; + } + } else { + summarySpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder clearSummarySpec() { + bitField0_ = (bitField0_ & ~0x00000040); + summarySpec_ = null; + if (summarySpecBuilder_ != null) { + summarySpecBuilder_.dispose(); + summarySpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + .Builder + getSummarySpecBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getSummarySpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder + getSummarySpecOrBuilder() { + if (summarySpecBuilder_ != null) { + return summarySpecBuilder_.getMessageOrBuilder(); + } else { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + .Builder, + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder> + getSummarySpecFieldBuilder() { + if (summarySpecBuilder_ == null) { + summarySpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + .Builder, + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder>(getSummarySpec(), getParentForChildren(), isClean()); + summarySpec_ = null; + } + return summarySpecBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationRequestOrBuilder.java index f104409444e6..c96aa5891ea5 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationRequestOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationRequestOrBuilder.java @@ -185,4 +185,185 @@ public interface ConverseConversationRequestOrBuilder * @return The safeSearch. */ boolean getSafeSearch(); + + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + int getUserLabelsCount(); + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + boolean containsUserLabels(java.lang.String key); + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getUserLabels(); + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + java.util.Map getUserLabelsMap(); + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + /* nullable */ + java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The user labels applied to a resource must meet the following requirements:
+   *
+   * * Each resource can have multiple labels, up to a maximum of 64.
+   * * Each label must be a key-value pair.
+   * * Keys have a minimum length of 1 character and a maximum length of 63
+   *   characters and cannot be empty. Values can be empty and have a maximum
+   *   length of 63 characters.
+   * * Keys and values can contain only lowercase letters, numeric characters,
+   *   underscores, and dashes. All characters must use UTF-8 encoding, and
+   *   international characters are allowed.
+   * * The key portion of a label must be unique. However, you can use the same
+   *   key with multiple resources.
+   * * Keys must start with a lowercase letter or international character.
+   *
+   * See [Google Cloud
+   * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 7; + */ + java.lang.String getUserLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return Whether the summarySpec field is set. + */ + boolean hasSummarySpec(); + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return The summarySpec. + */ + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec(); + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpecOrBuilder + getSummarySpecOrBuilder(); } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationResponse.java index 5b4b633f0f0b..432c89194c5c 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationResponse.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationResponse.java @@ -40,6 +40,7 @@ private ConverseConversationResponse(com.google.protobuf.GeneratedMessageV3.Buil } private ConverseConversationResponse() { + relatedQuestions_ = com.google.protobuf.LazyStringArrayList.emptyList(); searchResults_ = java.util.Collections.emptyList(); } @@ -164,6 +165,70 @@ public com.google.cloud.discoveryengine.v1beta.ConversationOrBuilder getConversa : conversation_; } + public static final int RELATED_QUESTIONS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList relatedQuestions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @return A list containing the relatedQuestions. + */ + public com.google.protobuf.ProtocolStringList getRelatedQuestionsList() { + return relatedQuestions_; + } + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @return The count of relatedQuestions. + */ + public int getRelatedQuestionsCount() { + return relatedQuestions_.size(); + } + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the element to return. + * @return The relatedQuestions at the given index. + */ + public java.lang.String getRelatedQuestions(int index) { + return relatedQuestions_.get(index); + } + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the value to return. + * @return The bytes of the relatedQuestions at the given index. + */ + public com.google.protobuf.ByteString getRelatedQuestionsBytes(int index) { + return relatedQuestions_.getByteString(index); + } + public static final int SEARCH_RESULTS_FIELD_NUMBER = 3; @SuppressWarnings("serial") @@ -273,6 +338,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < searchResults_.size(); i++) { output.writeMessage(3, searchResults_.get(i)); } + for (int i = 0; i < relatedQuestions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, relatedQuestions_.getRaw(i)); + } getUnknownFields().writeTo(output); } @@ -291,6 +359,14 @@ public int getSerializedSize() { for (int i = 0; i < searchResults_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, searchResults_.get(i)); } + { + int dataSize = 0; + for (int i = 0; i < relatedQuestions_.size(); i++) { + dataSize += computeStringSizeNoTag(relatedQuestions_.getRaw(i)); + } + size += dataSize; + size += 1 * getRelatedQuestionsList().size(); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -315,6 +391,7 @@ public boolean equals(final java.lang.Object obj) { if (hasConversation()) { if (!getConversation().equals(other.getConversation())) return false; } + if (!getRelatedQuestionsList().equals(other.getRelatedQuestionsList())) return false; if (!getSearchResultsList().equals(other.getSearchResultsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; @@ -335,6 +412,10 @@ public int hashCode() { hash = (37 * hash) + CONVERSATION_FIELD_NUMBER; hash = (53 * hash) + getConversation().hashCode(); } + if (getRelatedQuestionsCount() > 0) { + hash = (37 * hash) + RELATED_QUESTIONS_FIELD_NUMBER; + hash = (53 * hash) + getRelatedQuestionsList().hashCode(); + } if (getSearchResultsCount() > 0) { hash = (37 * hash) + SEARCH_RESULTS_FIELD_NUMBER; hash = (53 * hash) + getSearchResultsList().hashCode(); @@ -493,13 +574,14 @@ public Builder clear() { conversationBuilder_.dispose(); conversationBuilder_ = null; } + relatedQuestions_ = com.google.protobuf.LazyStringArrayList.emptyList(); if (searchResultsBuilder_ == null) { searchResults_ = java.util.Collections.emptyList(); } else { searchResults_ = null; searchResultsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -540,9 +622,9 @@ public com.google.cloud.discoveryengine.v1beta.ConverseConversationResponse buil private void buildPartialRepeatedFields( com.google.cloud.discoveryengine.v1beta.ConverseConversationResponse result) { if (searchResultsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000008) != 0)) { searchResults_ = java.util.Collections.unmodifiableList(searchResults_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); } result.searchResults_ = searchResults_; } else { @@ -560,6 +642,10 @@ private void buildPartial0( result.conversation_ = conversationBuilder_ == null ? conversation_ : conversationBuilder_.build(); } + if (((from_bitField0_ & 0x00000004) != 0)) { + relatedQuestions_.makeImmutable(); + result.relatedQuestions_ = relatedQuestions_; + } } @java.lang.Override @@ -617,11 +703,21 @@ public Builder mergeFrom( if (other.hasConversation()) { mergeConversation(other.getConversation()); } + if (!other.relatedQuestions_.isEmpty()) { + if (relatedQuestions_.isEmpty()) { + relatedQuestions_ = other.relatedQuestions_; + bitField0_ |= 0x00000004; + } else { + ensureRelatedQuestionsIsMutable(); + relatedQuestions_.addAll(other.relatedQuestions_); + } + onChanged(); + } if (searchResultsBuilder_ == null) { if (!other.searchResults_.isEmpty()) { if (searchResults_.isEmpty()) { searchResults_ = other.searchResults_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureSearchResultsIsMutable(); searchResults_.addAll(other.searchResults_); @@ -634,7 +730,7 @@ public Builder mergeFrom( searchResultsBuilder_.dispose(); searchResultsBuilder_ = null; searchResults_ = other.searchResults_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); searchResultsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getSearchResultsFieldBuilder() @@ -697,6 +793,13 @@ public Builder mergeFrom( } break; } // case 26 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRelatedQuestionsIsMutable(); + relatedQuestions_.add(s); + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1085,16 +1188,190 @@ public com.google.cloud.discoveryengine.v1beta.Conversation.Builder getConversat return conversationBuilder_; } + private com.google.protobuf.LazyStringArrayList relatedQuestions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRelatedQuestionsIsMutable() { + if (!relatedQuestions_.isModifiable()) { + relatedQuestions_ = new com.google.protobuf.LazyStringArrayList(relatedQuestions_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @return A list containing the relatedQuestions. + */ + public com.google.protobuf.ProtocolStringList getRelatedQuestionsList() { + relatedQuestions_.makeImmutable(); + return relatedQuestions_; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @return The count of relatedQuestions. + */ + public int getRelatedQuestionsCount() { + return relatedQuestions_.size(); + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the element to return. + * @return The relatedQuestions at the given index. + */ + public java.lang.String getRelatedQuestions(int index) { + return relatedQuestions_.get(index); + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the value to return. + * @return The bytes of the relatedQuestions at the given index. + */ + public com.google.protobuf.ByteString getRelatedQuestionsBytes(int index) { + return relatedQuestions_.getByteString(index); + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param index The index to set the value at. + * @param value The relatedQuestions to set. + * @return This builder for chaining. + */ + public Builder setRelatedQuestions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedQuestionsIsMutable(); + relatedQuestions_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param value The relatedQuestions to add. + * @return This builder for chaining. + */ + public Builder addRelatedQuestions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedQuestionsIsMutable(); + relatedQuestions_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param values The relatedQuestions to add. + * @return This builder for chaining. + */ + public Builder addAllRelatedQuestions(java.lang.Iterable values) { + ensureRelatedQuestionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, relatedQuestions_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @return This builder for chaining. + */ + public Builder clearRelatedQuestions() { + relatedQuestions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param value The bytes of the relatedQuestions to add. + * @return This builder for chaining. + */ + public Builder addRelatedQuestionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRelatedQuestionsIsMutable(); + relatedQuestions_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + private java.util.List searchResults_ = java.util.Collections.emptyList(); private void ensureSearchResultsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000008) != 0)) { searchResults_ = new java.util.ArrayList< com.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult>( searchResults_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; } } @@ -1344,7 +1621,7 @@ public Builder addAllSearchResults( public Builder clearSearchResults() { if (searchResultsBuilder_ == null) { searchResults_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { searchResultsBuilder_.clear(); @@ -1492,7 +1769,7 @@ public Builder removeSearchResults(int index) { com.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.Builder, com.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResultOrBuilder>( searchResults_, - ((bitField0_ & 0x00000004) != 0), + ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); searchResults_ = null; diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationResponseOrBuilder.java index d28fe268277b..823d53f56136 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationResponseOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ConverseConversationResponseOrBuilder.java @@ -93,6 +93,57 @@ public interface ConverseConversationResponseOrBuilder */ com.google.cloud.discoveryengine.v1beta.ConversationOrBuilder getConversationOrBuilder(); + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @return A list containing the relatedQuestions. + */ + java.util.List getRelatedQuestionsList(); + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @return The count of relatedQuestions. + */ + int getRelatedQuestionsCount(); + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the element to return. + * @return The relatedQuestions at the given index. + */ + java.lang.String getRelatedQuestions(int index); + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the value to return. + * @return The bytes of the relatedQuestions at the given index. + */ + com.google.protobuf.ByteString getRelatedQuestionsBytes(int index); + /** * * diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DocumentInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DocumentInfo.java index ccb7ba9bb5cc..f2af16ef7050 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DocumentInfo.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DocumentInfo.java @@ -74,6 +74,7 @@ public enum DocumentDescriptorCase com.google.protobuf.AbstractMessage.InternalOneOfEnum { ID(1), NAME(2), + URI(6), DOCUMENTDESCRIPTOR_NOT_SET(0); private final int value; @@ -96,6 +97,8 @@ public static DocumentDescriptorCase forNumber(int value) { return ID; case 2: return NAME; + case 6: + return URI; case 0: return DOCUMENTDESCRIPTOR_NOT_SET; default: @@ -258,6 +261,79 @@ public com.google.protobuf.ByteString getNameBytes() { } } + public static final int URI_FIELD_NUMBER = 6; + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return documentDescriptorCase_ == 6; + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = s; + } + return s; + } + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int QUANTITY_FIELD_NUMBER = 3; private int quantity_ = 0; /** @@ -401,6 +477,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < promotionIds_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, promotionIds_.getRaw(i)); } + if (documentDescriptorCase_ == 6) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, documentDescriptor_); + } getUnknownFields().writeTo(output); } @@ -427,6 +506,9 @@ public int getSerializedSize() { size += dataSize; size += 1 * getPromotionIdsList().size(); } + if (documentDescriptorCase_ == 6) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, documentDescriptor_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -456,6 +538,9 @@ public boolean equals(final java.lang.Object obj) { case 2: if (!getName().equals(other.getName())) return false; break; + case 6: + if (!getUri().equals(other.getUri())) return false; + break; case 0: default: } @@ -487,6 +572,10 @@ public int hashCode() { hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); break; + case 6: + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + break; case 0: default: } @@ -671,11 +760,11 @@ public com.google.cloud.discoveryengine.v1beta.DocumentInfo buildPartial() { private void buildPartial0(com.google.cloud.discoveryengine.v1beta.DocumentInfo result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000004) != 0)) { + if (((from_bitField0_ & 0x00000008) != 0)) { result.quantity_ = quantity_; to_bitField0_ |= 0x00000001; } - if (((from_bitField0_ & 0x00000008) != 0)) { + if (((from_bitField0_ & 0x00000010) != 0)) { promotionIds_.makeImmutable(); result.promotionIds_ = promotionIds_; } @@ -739,7 +828,7 @@ public Builder mergeFrom(com.google.cloud.discoveryengine.v1beta.DocumentInfo ot if (!other.promotionIds_.isEmpty()) { if (promotionIds_.isEmpty()) { promotionIds_ = other.promotionIds_; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; } else { ensurePromotionIdsIsMutable(); promotionIds_.addAll(other.promotionIds_); @@ -761,6 +850,13 @@ public Builder mergeFrom(com.google.cloud.discoveryengine.v1beta.DocumentInfo ot onChanged(); break; } + case URI: + { + documentDescriptorCase_ = 6; + documentDescriptor_ = other.documentDescriptor_; + onChanged(); + break; + } case DOCUMENTDESCRIPTOR_NOT_SET: { break; @@ -809,7 +905,7 @@ public Builder mergeFrom( case 24: { quantity_ = input.readInt32(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; break; } // case 24 case 34: @@ -819,6 +915,13 @@ public Builder mergeFrom( promotionIds_.add(s); break; } // case 34 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + documentDescriptorCase_ = 6; + documentDescriptor_ = s; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1132,6 +1235,146 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { return this; } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return documentDescriptorCase_ == 6; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + documentDescriptorCase_ = 6; + documentDescriptor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + if (documentDescriptorCase_ == 6) { + documentDescriptorCase_ = 0; + documentDescriptor_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + documentDescriptorCase_ = 6; + documentDescriptor_ = value; + onChanged(); + return this; + } + private int quantity_; /** * @@ -1154,7 +1397,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { */ @java.lang.Override public boolean hasQuantity() { - return ((bitField0_ & 0x00000004) != 0); + return ((bitField0_ & 0x00000008) != 0); } /** * @@ -1202,7 +1445,7 @@ public int getQuantity() { public Builder setQuantity(int value) { quantity_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1226,7 +1469,7 @@ public Builder setQuantity(int value) { * @return This builder for chaining. */ public Builder clearQuantity() { - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); quantity_ = 0; onChanged(); return this; @@ -1239,7 +1482,7 @@ private void ensurePromotionIdsIsMutable() { if (!promotionIds_.isModifiable()) { promotionIds_ = new com.google.protobuf.LazyStringArrayList(promotionIds_); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; } /** * @@ -1324,7 +1567,7 @@ public Builder setPromotionIds(int index, java.lang.String value) { } ensurePromotionIdsIsMutable(); promotionIds_.set(index, value); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1347,7 +1590,7 @@ public Builder addPromotionIds(java.lang.String value) { } ensurePromotionIdsIsMutable(); promotionIds_.add(value); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1367,7 +1610,7 @@ public Builder addPromotionIds(java.lang.String value) { public Builder addAllPromotionIds(java.lang.Iterable values) { ensurePromotionIdsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, promotionIds_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1385,7 +1628,7 @@ public Builder addAllPromotionIds(java.lang.Iterable values) { */ public Builder clearPromotionIds() { promotionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000010); ; onChanged(); return this; @@ -1410,7 +1653,7 @@ public Builder addPromotionIdsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensurePromotionIdsIsMutable(); promotionIds_.add(value); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DocumentInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DocumentInfoOrBuilder.java index 509ea20e7878..6a9915afde8b 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DocumentInfoOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DocumentInfoOrBuilder.java @@ -103,6 +103,46 @@ public interface DocumentInfoOrBuilder */ com.google.protobuf.ByteString getNameBytes(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return Whether the uri field is set. + */ + boolean hasUri(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + /** * * diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DoubleList.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DoubleList.java new file mode 100644 index 000000000000..e652bd580c24 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DoubleList.java @@ -0,0 +1,684 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/discoveryengine/v1beta/common.proto + +package com.google.cloud.discoveryengine.v1beta; + +/** + * + * + *
+ * Double list.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1beta.DoubleList} + */ +public final class DoubleList extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.DoubleList) + DoubleListOrBuilder { + private static final long serialVersionUID = 0L; + // Use DoubleList.newBuilder() to construct. + private DoubleList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DoubleList() { + values_ = emptyDoubleList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DoubleList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.CommonProto + .internal_static_google_cloud_discoveryengine_v1beta_DoubleList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.CommonProto + .internal_static_google_cloud_discoveryengine_v1beta_DoubleList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.DoubleList.class, + com.google.cloud.discoveryengine.v1beta.DoubleList.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList values_; + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @return A list containing the values. + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public double getValues(int index) { + return values_.getDouble(index); + } + + private int valuesMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (getValuesList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valuesMemoizedSerializedSize); + } + for (int i = 0; i < values_.size(); i++) { + output.writeDoubleNoTag(values_.getDouble(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 8 * getValuesList().size(); + size += dataSize; + if (!getValuesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + valuesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1beta.DoubleList)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1beta.DoubleList other = + (com.google.cloud.discoveryengine.v1beta.DoubleList) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1beta.DoubleList parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.DoubleList 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.discoveryengine.v1beta.DoubleList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.DoubleList 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.discoveryengine.v1beta.DoubleList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.DoubleList parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1beta.DoubleList parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.DoubleList 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.discoveryengine.v1beta.DoubleList parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.DoubleList 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.discoveryengine.v1beta.DoubleList parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.DoubleList 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.discoveryengine.v1beta.DoubleList 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; + } + /** + * + * + *
+   * Double list.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1beta.DoubleList} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.DoubleList) + com.google.cloud.discoveryengine.v1beta.DoubleListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.CommonProto + .internal_static_google_cloud_discoveryengine_v1beta_DoubleList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.CommonProto + .internal_static_google_cloud_discoveryengine_v1beta_DoubleList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.DoubleList.class, + com.google.cloud.discoveryengine.v1beta.DoubleList.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1beta.DoubleList.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + values_ = emptyDoubleList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1beta.CommonProto + .internal_static_google_cloud_discoveryengine_v1beta_DoubleList_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.DoubleList getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1beta.DoubleList.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.DoubleList build() { + com.google.cloud.discoveryengine.v1beta.DoubleList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.DoubleList buildPartial() { + com.google.cloud.discoveryengine.v1beta.DoubleList result = + new com.google.cloud.discoveryengine.v1beta.DoubleList(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1beta.DoubleList result) { + if (((bitField0_ & 0x00000001) != 0)) { + values_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1beta.DoubleList 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.discoveryengine.v1beta.DoubleList) { + return mergeFrom((com.google.cloud.discoveryengine.v1beta.DoubleList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1beta.DoubleList other) { + if (other == com.google.cloud.discoveryengine.v1beta.DoubleList.getDefaultInstance()) + return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + double v = input.readDouble(); + ensureValuesIsMutable(); + values_.addDouble(v); + break; + } // case 9 + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValuesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + values_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.DoubleList values_ = emptyDoubleList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = mutableCopy(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @return A list containing the values. + */ + public java.util.List getValuesList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(values_) + : values_; + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public double getValues(int index) { + return values_.getDouble(index); + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, double value) { + + ensureValuesIsMutable(); + values_.setDouble(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(double value) { + + ensureValuesIsMutable(); + values_.addDouble(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1beta.DoubleList) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.DoubleList) + private static final com.google.cloud.discoveryengine.v1beta.DoubleList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1beta.DoubleList(); + } + + public static com.google.cloud.discoveryengine.v1beta.DoubleList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DoubleList 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.discoveryengine.v1beta.DoubleList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DoubleListOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DoubleListOrBuilder.java new file mode 100644 index 000000000000..873a59eff9d7 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/DoubleListOrBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1beta/common.proto + +package com.google.cloud.discoveryengine.v1beta; + +public interface DoubleListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.DoubleList) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + double getValues(int index); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/Reply.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/Reply.java index bd7149b663f4..5f3f4bd4f804 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/Reply.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/Reply.java @@ -63,6 +63,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.discoveryengine.v1beta.Reply.Builder.class); } + @java.lang.Deprecated public interface ReferenceOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.Reply.Reference) @@ -153,6 +154,7 @@ public interface ReferenceOrBuilder * * Protobuf type {@code google.cloud.discoveryengine.v1beta.Reply.Reference} */ + @java.lang.Deprecated public static final class Reference extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.Reply.Reference) @@ -1132,14 +1134,18 @@ public com.google.cloud.discoveryengine.v1beta.Reply.Reference getDefaultInstanc * * *
+   * DEPRECATED: use `summary` instead.
    * Text reply.
    * 
* - * string reply = 1; + * string reply = 1 [deprecated = true]; * + * @deprecated google.cloud.discoveryengine.v1beta.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1beta/conversation.proto;l=95 * @return The reply. */ @java.lang.Override + @java.lang.Deprecated public java.lang.String getReply() { java.lang.Object ref = reply_; if (ref instanceof java.lang.String) { @@ -1155,14 +1161,18 @@ public java.lang.String getReply() { * * *
+   * DEPRECATED: use `summary` instead.
    * Text reply.
    * 
* - * string reply = 1; + * string reply = 1 [deprecated = true]; * + * @deprecated google.cloud.discoveryengine.v1beta.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1beta/conversation.proto;l=95 * @return The bytes for reply. */ @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString getReplyBytes() { java.lang.Object ref = reply_; if (ref instanceof java.lang.String) { @@ -1186,9 +1196,12 @@ public com.google.protobuf.ByteString getReplyBytes() { * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ @java.lang.Override + @java.lang.Deprecated public java.util.List getReferencesList() { return references_; @@ -1200,9 +1213,12 @@ public com.google.protobuf.ByteString getReplyBytes() { * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ @java.lang.Override + @java.lang.Deprecated public java.util.List getReferencesOrBuilderList() { return references_; @@ -1214,9 +1230,12 @@ public com.google.protobuf.ByteString getReplyBytes() { * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ @java.lang.Override + @java.lang.Deprecated public int getReferencesCount() { return references_.size(); } @@ -1227,9 +1246,12 @@ public int getReferencesCount() { * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.discoveryengine.v1beta.Reply.Reference getReferences(int index) { return references_.get(index); } @@ -1240,14 +1262,68 @@ public com.google.cloud.discoveryengine.v1beta.Reply.Reference getReferences(int * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.discoveryengine.v1beta.Reply.ReferenceOrBuilder getReferencesOrBuilder( int index) { return references_.get(index); } + public static final int SUMMARY_FIELD_NUMBER = 3; + private com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary_; + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + * + * @return Whether the summary field is set. + */ + @java.lang.Override + public boolean hasSummary() { + return summary_ != null; + } + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + * + * @return The summary. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary getSummary() { + return summary_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.SummaryOrBuilder + getSummaryOrBuilder() { + return summary_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1268,6 +1344,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < references_.size(); i++) { output.writeMessage(2, references_.get(i)); } + if (summary_ != null) { + output.writeMessage(3, getSummary()); + } getUnknownFields().writeTo(output); } @@ -1283,6 +1362,9 @@ public int getSerializedSize() { for (int i = 0; i < references_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, references_.get(i)); } + if (summary_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSummary()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1301,6 +1383,10 @@ public boolean equals(final java.lang.Object obj) { if (!getReply().equals(other.getReply())) return false; if (!getReferencesList().equals(other.getReferencesList())) return false; + if (hasSummary() != other.hasSummary()) return false; + if (hasSummary()) { + if (!getSummary().equals(other.getSummary())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1318,6 +1404,10 @@ public int hashCode() { hash = (37 * hash) + REFERENCES_FIELD_NUMBER; hash = (53 * hash) + getReferencesList().hashCode(); } + if (hasSummary()) { + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummary().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1465,6 +1555,11 @@ public Builder clear() { referencesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } return this; } @@ -1517,6 +1612,9 @@ private void buildPartial0(com.google.cloud.discoveryengine.v1beta.Reply result) if (((from_bitField0_ & 0x00000001) != 0)) { result.reply_ = reply_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.summary_ = summaryBuilder_ == null ? summary_ : summaryBuilder_.build(); + } } @java.lang.Override @@ -1596,6 +1694,9 @@ public Builder mergeFrom(com.google.cloud.discoveryengine.v1beta.Reply other) { } } } + if (other.hasSummary()) { + mergeSummary(other.getSummary()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1642,6 +1743,12 @@ public Builder mergeFrom( } break; } // case 18 + case 26: + { + input.readMessage(getSummaryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1666,13 +1773,17 @@ public Builder mergeFrom( * * *
+     * DEPRECATED: use `summary` instead.
      * Text reply.
      * 
* - * string reply = 1; + * string reply = 1 [deprecated = true]; * + * @deprecated google.cloud.discoveryengine.v1beta.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1beta/conversation.proto;l=95 * @return The reply. */ + @java.lang.Deprecated public java.lang.String getReply() { java.lang.Object ref = reply_; if (!(ref instanceof java.lang.String)) { @@ -1688,13 +1799,17 @@ public java.lang.String getReply() { * * *
+     * DEPRECATED: use `summary` instead.
      * Text reply.
      * 
* - * string reply = 1; + * string reply = 1 [deprecated = true]; * + * @deprecated google.cloud.discoveryengine.v1beta.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1beta/conversation.proto;l=95 * @return The bytes for reply. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getReplyBytes() { java.lang.Object ref = reply_; if (ref instanceof String) { @@ -1710,14 +1825,18 @@ public com.google.protobuf.ByteString getReplyBytes() { * * *
+     * DEPRECATED: use `summary` instead.
      * Text reply.
      * 
* - * string reply = 1; + * string reply = 1 [deprecated = true]; * + * @deprecated google.cloud.discoveryengine.v1beta.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1beta/conversation.proto;l=95 * @param value The reply to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setReply(java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -1731,13 +1850,17 @@ public Builder setReply(java.lang.String value) { * * *
+     * DEPRECATED: use `summary` instead.
      * Text reply.
      * 
* - * string reply = 1; + * string reply = 1 [deprecated = true]; * + * @deprecated google.cloud.discoveryengine.v1beta.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1beta/conversation.proto;l=95 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearReply() { reply_ = getDefaultInstance().getReply(); bitField0_ = (bitField0_ & ~0x00000001); @@ -1748,14 +1871,18 @@ public Builder clearReply() { * * *
+     * DEPRECATED: use `summary` instead.
      * Text reply.
      * 
* - * string reply = 1; + * string reply = 1 [deprecated = true]; * + * @deprecated google.cloud.discoveryengine.v1beta.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1beta/conversation.proto;l=95 * @param value The bytes for reply to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setReplyBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1792,8 +1919,11 @@ private void ensureReferencesIsMutable() { * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public java.util.List getReferencesList() { if (referencesBuilder_ == null) { @@ -1809,8 +1939,11 @@ private void ensureReferencesIsMutable() { * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public int getReferencesCount() { if (referencesBuilder_ == null) { return references_.size(); @@ -1825,8 +1958,11 @@ public int getReferencesCount() { * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public com.google.cloud.discoveryengine.v1beta.Reply.Reference getReferences(int index) { if (referencesBuilder_ == null) { return references_.get(index); @@ -1841,8 +1977,11 @@ public com.google.cloud.discoveryengine.v1beta.Reply.Reference getReferences(int * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder setReferences( int index, com.google.cloud.discoveryengine.v1beta.Reply.Reference value) { if (referencesBuilder_ == null) { @@ -1864,8 +2003,11 @@ public Builder setReferences( * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder setReferences( int index, com.google.cloud.discoveryengine.v1beta.Reply.Reference.Builder builderForValue) { @@ -1885,8 +2027,11 @@ public Builder setReferences( * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder addReferences(com.google.cloud.discoveryengine.v1beta.Reply.Reference value) { if (referencesBuilder_ == null) { if (value == null) { @@ -1907,8 +2052,11 @@ public Builder addReferences(com.google.cloud.discoveryengine.v1beta.Reply.Refer * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder addReferences( int index, com.google.cloud.discoveryengine.v1beta.Reply.Reference value) { if (referencesBuilder_ == null) { @@ -1930,8 +2078,11 @@ public Builder addReferences( * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder addReferences( com.google.cloud.discoveryengine.v1beta.Reply.Reference.Builder builderForValue) { if (referencesBuilder_ == null) { @@ -1950,8 +2101,11 @@ public Builder addReferences( * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder addReferences( int index, com.google.cloud.discoveryengine.v1beta.Reply.Reference.Builder builderForValue) { @@ -1971,8 +2125,11 @@ public Builder addReferences( * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder addAllReferences( java.lang.Iterable values) { @@ -1992,8 +2149,11 @@ public Builder addAllReferences( * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder clearReferences() { if (referencesBuilder_ == null) { references_ = java.util.Collections.emptyList(); @@ -2011,8 +2171,11 @@ public Builder clearReferences() { * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder removeReferences(int index) { if (referencesBuilder_ == null) { ensureReferencesIsMutable(); @@ -2030,8 +2193,11 @@ public Builder removeReferences(int index) { * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public com.google.cloud.discoveryengine.v1beta.Reply.Reference.Builder getReferencesBuilder( int index) { return getReferencesFieldBuilder().getBuilder(index); @@ -2043,8 +2209,11 @@ public com.google.cloud.discoveryengine.v1beta.Reply.Reference.Builder getRefere * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public com.google.cloud.discoveryengine.v1beta.Reply.ReferenceOrBuilder getReferencesOrBuilder( int index) { if (referencesBuilder_ == null) { @@ -2060,8 +2229,11 @@ public com.google.cloud.discoveryengine.v1beta.Reply.ReferenceOrBuilder getRefer * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public java.util.List< ? extends com.google.cloud.discoveryengine.v1beta.Reply.ReferenceOrBuilder> getReferencesOrBuilderList() { @@ -2078,8 +2250,11 @@ public com.google.cloud.discoveryengine.v1beta.Reply.ReferenceOrBuilder getRefer * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public com.google.cloud.discoveryengine.v1beta.Reply.Reference.Builder addReferencesBuilder() { return getReferencesFieldBuilder() .addBuilder(com.google.cloud.discoveryengine.v1beta.Reply.Reference.getDefaultInstance()); @@ -2091,8 +2266,11 @@ public com.google.cloud.discoveryengine.v1beta.Reply.Reference.Builder addRefere * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public com.google.cloud.discoveryengine.v1beta.Reply.Reference.Builder addReferencesBuilder( int index) { return getReferencesFieldBuilder() @@ -2106,8 +2284,11 @@ public com.google.cloud.discoveryengine.v1beta.Reply.Reference.Builder addRefere * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated public java.util.List getReferencesBuilderList() { return getReferencesFieldBuilder().getBuilderList(); @@ -2130,6 +2311,196 @@ public com.google.cloud.discoveryengine.v1beta.Reply.Reference.Builder addRefere return referencesBuilder_; } + private com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1beta.SearchResponse.SummaryOrBuilder> + summaryBuilder_; + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + * + * @return Whether the summary field is set. + */ + public boolean hasSummary() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + * + * @return The summary. + */ + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary getSummary() { + if (summaryBuilder_ == null) { + return summary_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.getDefaultInstance() + : summary_; + } else { + return summaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + */ + public Builder setSummary( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary value) { + if (summaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summary_ = value; + } else { + summaryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + */ + public Builder setSummary( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.Builder builderForValue) { + if (summaryBuilder_ == null) { + summary_ = builderForValue.build(); + } else { + summaryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + */ + public Builder mergeSummary( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary value) { + if (summaryBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && summary_ != null + && summary_ + != com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .getDefaultInstance()) { + getSummaryBuilder().mergeFrom(value); + } else { + summary_ = value; + } + } else { + summaryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + */ + public Builder clearSummary() { + bitField0_ = (bitField0_ & ~0x00000004); + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + */ + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.Builder + getSummaryBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + */ + public com.google.cloud.discoveryengine.v1beta.SearchResponse.SummaryOrBuilder + getSummaryOrBuilder() { + if (summaryBuilder_ != null) { + return summaryBuilder_.getMessageOrBuilder(); + } else { + return summary_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1beta.SearchResponse.SummaryOrBuilder> + getSummaryFieldBuilder() { + if (summaryBuilder_ == null) { + summaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1beta.SearchResponse.SummaryOrBuilder>( + getSummary(), getParentForChildren(), isClean()); + summary_ = null; + } + return summaryBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ReplyOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ReplyOrBuilder.java index bd6bf5f74ab2..59e45276704a 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ReplyOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/ReplyOrBuilder.java @@ -27,25 +27,33 @@ public interface ReplyOrBuilder * * *
+   * DEPRECATED: use `summary` instead.
    * Text reply.
    * 
* - * string reply = 1; + * string reply = 1 [deprecated = true]; * + * @deprecated google.cloud.discoveryengine.v1beta.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1beta/conversation.proto;l=95 * @return The reply. */ + @java.lang.Deprecated java.lang.String getReply(); /** * * *
+   * DEPRECATED: use `summary` instead.
    * Text reply.
    * 
* - * string reply = 1; + * string reply = 1 [deprecated = true]; * + * @deprecated google.cloud.discoveryengine.v1beta.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1beta/conversation.proto;l=95 * @return The bytes for reply. */ + @java.lang.Deprecated com.google.protobuf.ByteString getReplyBytes(); /** @@ -55,8 +63,11 @@ public interface ReplyOrBuilder * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated java.util.List getReferencesList(); /** * @@ -65,8 +76,11 @@ public interface ReplyOrBuilder * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated com.google.cloud.discoveryengine.v1beta.Reply.Reference getReferences(int index); /** * @@ -75,8 +89,11 @@ public interface ReplyOrBuilder * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated int getReferencesCount(); /** * @@ -85,8 +102,11 @@ public interface ReplyOrBuilder * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated java.util.List getReferencesOrBuilderList(); /** @@ -96,8 +116,46 @@ public interface ReplyOrBuilder * References in the reply. *
* - * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2; + * + * repeated .google.cloud.discoveryengine.v1beta.Reply.Reference references = 2 [deprecated = true]; + * */ + @java.lang.Deprecated com.google.cloud.discoveryengine.v1beta.Reply.ReferenceOrBuilder getReferencesOrBuilder( int index); + + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + * + * @return Whether the summary field is set. + */ + boolean hasSummary(); + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + * + * @return The summary. + */ + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary getSummary(); + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary summary = 3; + */ + com.google.cloud.discoveryengine.v1beta.SearchResponse.SummaryOrBuilder getSummaryOrBuilder(); } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchRequest.java index a659abbb79b8..418a72255be8 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchRequest.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchRequest.java @@ -48,6 +48,7 @@ private SearchRequest() { orderBy_ = ""; facetSpecs_ = java.util.Collections.emptyList(); userPseudoId_ = ""; + rankingExpression_ = ""; } @java.lang.Override @@ -8020,6 +8021,21 @@ public interface QueryExpansionSpecOrBuilder */ com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition getCondition(); + + /** + * + * + *
+     * Whether to pin unexpanded results. If this field is set to true,
+     * unexpanded products are always at the top of the search results, followed
+     * by the expanded results.
+     * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + boolean getPinUnexpandedResults(); } /** * @@ -8282,6 +8298,26 @@ public int getConditionValue() { : result; } + public static final int PIN_UNEXPANDED_RESULTS_FIELD_NUMBER = 2; + private boolean pinUnexpandedResults_ = false; + /** + * + * + *
+     * Whether to pin unexpanded results. If this field is set to true,
+     * unexpanded products are always at the top of the search results, followed
+     * by the expanded results.
+     * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + @java.lang.Override + public boolean getPinUnexpandedResults() { + return pinUnexpandedResults_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -8302,6 +8338,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(1, condition_); } + if (pinUnexpandedResults_ != false) { + output.writeBool(2, pinUnexpandedResults_); + } getUnknownFields().writeTo(output); } @@ -8317,6 +8356,9 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, condition_); } + if (pinUnexpandedResults_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, pinUnexpandedResults_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -8335,6 +8377,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec) obj; if (condition_ != other.condition_) return false; + if (getPinUnexpandedResults() != other.getPinUnexpandedResults()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -8348,6 +8391,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CONDITION_FIELD_NUMBER; hash = (53 * hash) + condition_; + hash = (37 * hash) + PIN_UNEXPANDED_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPinUnexpandedResults()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -8500,6 +8545,7 @@ public Builder clear() { super.clear(); bitField0_ = 0; condition_ = 0; + pinUnexpandedResults_ = false; return this; } @@ -8544,6 +8590,9 @@ private void buildPartial0( if (((from_bitField0_ & 0x00000001) != 0)) { result.condition_ = condition_; } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pinUnexpandedResults_ = pinUnexpandedResults_; + } } @java.lang.Override @@ -8601,6 +8650,9 @@ public Builder mergeFrom( if (other.condition_ != 0) { setConditionValue(other.getConditionValue()); } + if (other.getPinUnexpandedResults() != false) { + setPinUnexpandedResults(other.getPinUnexpandedResults()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -8633,6 +8685,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 8 + case 16: + { + pinUnexpandedResults_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -8764,6 +8822,65 @@ public Builder clearCondition() { return this; } + private boolean pinUnexpandedResults_; + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return The pinUnexpandedResults. + */ + @java.lang.Override + public boolean getPinUnexpandedResults() { + return pinUnexpandedResults_; + } + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @param value The pinUnexpandedResults to set. + * @return This builder for chaining. + */ + public Builder setPinUnexpandedResults(boolean value) { + + pinUnexpandedResults_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether to pin unexpanded results. If this field is set to true,
+       * unexpanded products are always at the top of the search results, followed
+       * by the expanded results.
+       * 
+ * + * bool pin_unexpanded_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearPinUnexpandedResults() { + bitField0_ = (bitField0_ & ~0x00000002); + pinUnexpandedResults_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -9885,7 +10002,7 @@ public interface SnippetSpecOrBuilder * * @deprecated * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count - * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=299 + * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=304 * @return The maxSnippetCount. */ @java.lang.Deprecated @@ -9903,7 +10020,7 @@ public interface SnippetSpecOrBuilder * * @deprecated * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only - * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=303 + * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=308 * @return The referenceOnly. */ @java.lang.Deprecated @@ -9984,7 +10101,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * @deprecated * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count - * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=299 + * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=304 * @return The maxSnippetCount. */ @java.lang.Override @@ -10007,7 +10124,7 @@ public int getMaxSnippetCount() { * * @deprecated * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only - * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=303 + * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=308 * @return The referenceOnly. */ @java.lang.Override @@ -10485,7 +10602,7 @@ public Builder mergeFrom( * * @deprecated * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count - * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=299 + * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=304 * @return The maxSnippetCount. */ @java.lang.Override @@ -10506,7 +10623,7 @@ public int getMaxSnippetCount() { * * @deprecated * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count - * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=299 + * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=304 * @param value The maxSnippetCount to set. * @return This builder for chaining. */ @@ -10531,7 +10648,7 @@ public Builder setMaxSnippetCount(int value) { * * @deprecated * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count - * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=299 + * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=304 * @return This builder for chaining. */ @java.lang.Deprecated @@ -10555,7 +10672,7 @@ public Builder clearMaxSnippetCount() { * * @deprecated * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only - * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=303 + * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=308 * @return The referenceOnly. */ @java.lang.Override @@ -10575,7 +10692,7 @@ public boolean getReferenceOnly() { * * @deprecated * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only - * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=303 + * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=308 * @param value The referenceOnly to set. * @return This builder for chaining. */ @@ -10599,7 +10716,7 @@ public Builder setReferenceOnly(boolean value) { * * @deprecated * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only - * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=303 + * is deprecated. See google/cloud/discoveryengine/v1beta/search_service.proto;l=308 * @return This builder for chaining. */ @java.lang.Deprecated @@ -10835,6 +10952,33 @@ public interface SummarySpecOrBuilder * @return The ignoreNonSummarySeekingQuery. */ boolean getIgnoreNonSummarySeekingQuery(); + + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+       * 
+ * + * string language_code = 6; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+       * 
+ * + * string language_code = 6; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); } /** * @@ -10857,7 +11001,9 @@ private SummarySpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private SummarySpec() {} + private SummarySpec() { + languageCode_ = ""; + } @java.lang.Override @SuppressWarnings({"unused"}) @@ -10993,6 +11139,59 @@ public boolean getIgnoreNonSummarySeekingQuery() { return ignoreNonSummarySeekingQuery_; } + public static final int LANGUAGE_CODE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object languageCode_ = ""; + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+       * 
+ * + * string language_code = 6; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+       * 
+ * + * string language_code = 6; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -11019,6 +11218,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (ignoreNonSummarySeekingQuery_ != false) { output.writeBool(4, ignoreNonSummarySeekingQuery_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, languageCode_); + } getUnknownFields().writeTo(output); } @@ -11042,6 +11244,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBoolSize( 4, ignoreNonSummarySeekingQuery_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, languageCode_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -11066,6 +11271,7 @@ public boolean equals(final java.lang.Object obj) { if (getIgnoreAdversarialQuery() != other.getIgnoreAdversarialQuery()) return false; if (getIgnoreNonSummarySeekingQuery() != other.getIgnoreNonSummarySeekingQuery()) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -11087,6 +11293,8 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreNonSummarySeekingQuery()); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -11260,6 +11468,7 @@ public Builder clear() { includeCitations_ = false; ignoreAdversarialQuery_ = false; ignoreNonSummarySeekingQuery_ = false; + languageCode_ = ""; return this; } @@ -11317,6 +11526,9 @@ private void buildPartial0( if (((from_bitField0_ & 0x00000008) != 0)) { result.ignoreNonSummarySeekingQuery_ = ignoreNonSummarySeekingQuery_; } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.languageCode_ = languageCode_; + } } @java.lang.Override @@ -11387,6 +11599,11 @@ public Builder mergeFrom( if (other.getIgnoreNonSummarySeekingQuery() != false) { setIgnoreNonSummarySeekingQuery(other.getIgnoreNonSummarySeekingQuery()); } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + bitField0_ |= 0x00000010; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -11437,6 +11654,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000008; break; } // case 32 + case 50: + { + languageCode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -11785,6 +12008,117 @@ public Builder clearIgnoreNonSummarySeekingQuery() { return this; } + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+         * 
+ * + * string language_code = 6; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+         * 
+ * + * string language_code = 6; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+         * 
+ * + * string language_code = 6; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + languageCode_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+         * 
+ * + * string language_code = 6; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + languageCode_ = getDefaultInstance().getLanguageCode(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
+         * 
+ * + * string language_code = 6; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + languageCode_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -11907,9 +12241,6 @@ public interface ExtractiveContentSpecOrBuilder * If the number of matching segments is less than * `max_extractive_segment_count`, return all of the segments. Otherwise, * return the `max_extractive_segment_count`. - * - * Currently one segment is returned for each - * [SearchResult][google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult]. *
* * int32 max_extractive_segment_count = 2; @@ -11917,6 +12248,50 @@ public interface ExtractiveContentSpecOrBuilder * @return The maxExtractiveSegmentCount. */ int getMaxExtractiveSegmentCount(); + + /** + * + * + *
+       * Specifies whether to return the confidence score from the extractive
+       * segments in each search result. The default value is `false`.
+       * 
+ * + * bool return_extractive_segment_score = 3; + * + * @return The returnExtractiveSegmentScore. + */ + boolean getReturnExtractiveSegmentScore(); + + /** + * + * + *
+       * Specifies whether to also include the adjacent from each selected
+       * segments.
+       * Return at most `num_previous_segments` segments before each selected
+       * segments.
+       * 
+ * + * int32 num_previous_segments = 4; + * + * @return The numPreviousSegments. + */ + int getNumPreviousSegments(); + + /** + * + * + *
+       * Return at most `num_next_segments` segments after each selected
+       * segments.
+       * 
+ * + * int32 num_next_segments = 5; + * + * @return The numNextSegments. + */ + int getNumNextSegments(); } /** * @@ -12017,9 +12392,6 @@ public int getMaxExtractiveAnswerCount() { * If the number of matching segments is less than * `max_extractive_segment_count`, return all of the segments. Otherwise, * return the `max_extractive_segment_count`. - * - * Currently one segment is returned for each - * [SearchResult][google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult]. *
* * int32 max_extractive_segment_count = 2; @@ -12031,13 +12403,72 @@ public int getMaxExtractiveSegmentCount() { return maxExtractiveSegmentCount_; } - private byte memoizedIsInitialized = -1; - + public static final int RETURN_EXTRACTIVE_SEGMENT_SCORE_FIELD_NUMBER = 3; + private boolean returnExtractiveSegmentScore_ = false; + /** + * + * + *
+       * Specifies whether to return the confidence score from the extractive
+       * segments in each search result. The default value is `false`.
+       * 
+ * + * bool return_extractive_segment_score = 3; + * + * @return The returnExtractiveSegmentScore. + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + public boolean getReturnExtractiveSegmentScore() { + return returnExtractiveSegmentScore_; + } + + public static final int NUM_PREVIOUS_SEGMENTS_FIELD_NUMBER = 4; + private int numPreviousSegments_ = 0; + /** + * + * + *
+       * Specifies whether to also include the adjacent from each selected
+       * segments.
+       * Return at most `num_previous_segments` segments before each selected
+       * segments.
+       * 
+ * + * int32 num_previous_segments = 4; + * + * @return The numPreviousSegments. + */ + @java.lang.Override + public int getNumPreviousSegments() { + return numPreviousSegments_; + } + + public static final int NUM_NEXT_SEGMENTS_FIELD_NUMBER = 5; + private int numNextSegments_ = 0; + /** + * + * + *
+       * Return at most `num_next_segments` segments after each selected
+       * segments.
+       * 
+ * + * int32 num_next_segments = 5; + * + * @return The numNextSegments. + */ + @java.lang.Override + public int getNumNextSegments() { + return numNextSegments_; + } + + 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; @@ -12051,6 +12482,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (maxExtractiveSegmentCount_ != 0) { output.writeInt32(2, maxExtractiveSegmentCount_); } + if (returnExtractiveSegmentScore_ != false) { + output.writeBool(3, returnExtractiveSegmentScore_); + } + if (numPreviousSegments_ != 0) { + output.writeInt32(4, numPreviousSegments_); + } + if (numNextSegments_ != 0) { + output.writeInt32(5, numNextSegments_); + } getUnknownFields().writeTo(output); } @@ -12068,6 +12508,17 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxExtractiveSegmentCount_); } + if (returnExtractiveSegmentScore_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 3, returnExtractiveSegmentScore_); + } + if (numPreviousSegments_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, numPreviousSegments_); + } + if (numNextSegments_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, numNextSegments_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -12093,6 +12544,10 @@ public boolean equals(final java.lang.Object obj) { if (getMaxExtractiveAnswerCount() != other.getMaxExtractiveAnswerCount()) return false; if (getMaxExtractiveSegmentCount() != other.getMaxExtractiveSegmentCount()) return false; + if (getReturnExtractiveSegmentScore() != other.getReturnExtractiveSegmentScore()) + return false; + if (getNumPreviousSegments() != other.getNumPreviousSegments()) return false; + if (getNumNextSegments() != other.getNumNextSegments()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -12108,6 +12563,14 @@ public int hashCode() { hash = (53 * hash) + getMaxExtractiveAnswerCount(); hash = (37 * hash) + MAX_EXTRACTIVE_SEGMENT_COUNT_FIELD_NUMBER; hash = (53 * hash) + getMaxExtractiveSegmentCount(); + hash = (37 * hash) + RETURN_EXTRACTIVE_SEGMENT_SCORE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getReturnExtractiveSegmentScore()); + hash = (37 * hash) + NUM_PREVIOUS_SEGMENTS_FIELD_NUMBER; + hash = (53 * hash) + getNumPreviousSegments(); + hash = (37 * hash) + NUM_NEXT_SEGMENTS_FIELD_NUMBER; + hash = (53 * hash) + getNumNextSegments(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -12280,6 +12743,9 @@ public Builder clear() { bitField0_ = 0; maxExtractiveAnswerCount_ = 0; maxExtractiveSegmentCount_ = 0; + returnExtractiveSegmentScore_ = false; + numPreviousSegments_ = 0; + numNextSegments_ = 0; return this; } @@ -12337,6 +12803,15 @@ private void buildPartial0( if (((from_bitField0_ & 0x00000002) != 0)) { result.maxExtractiveSegmentCount_ = maxExtractiveSegmentCount_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.returnExtractiveSegmentScore_ = returnExtractiveSegmentScore_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.numPreviousSegments_ = numPreviousSegments_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.numNextSegments_ = numNextSegments_; + } } @java.lang.Override @@ -12403,6 +12878,15 @@ public Builder mergeFrom( if (other.getMaxExtractiveSegmentCount() != 0) { setMaxExtractiveSegmentCount(other.getMaxExtractiveSegmentCount()); } + if (other.getReturnExtractiveSegmentScore() != false) { + setReturnExtractiveSegmentScore(other.getReturnExtractiveSegmentScore()); + } + if (other.getNumPreviousSegments() != 0) { + setNumPreviousSegments(other.getNumPreviousSegments()); + } + if (other.getNumNextSegments() != 0) { + setNumNextSegments(other.getNumNextSegments()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -12441,6 +12925,24 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 16 + case 24: + { + returnExtractiveSegmentScore_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + numPreviousSegments_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + numNextSegments_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -12571,9 +13073,6 @@ public Builder clearMaxExtractiveAnswerCount() { * If the number of matching segments is less than * `max_extractive_segment_count`, return all of the segments. Otherwise, * return the `max_extractive_segment_count`. - * - * Currently one segment is returned for each - * [SearchResult][google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult]. *
* * int32 max_extractive_segment_count = 2; @@ -12605,9 +13104,6 @@ public int getMaxExtractiveSegmentCount() { * If the number of matching segments is less than * `max_extractive_segment_count`, return all of the segments. Otherwise, * return the `max_extractive_segment_count`. - * - * Currently one segment is returned for each - * [SearchResult][google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult]. *
* * int32 max_extractive_segment_count = 2; @@ -12643,9 +13139,6 @@ public Builder setMaxExtractiveSegmentCount(int value) { * If the number of matching segments is less than * `max_extractive_segment_count`, return all of the segments. Otherwise, * return the `max_extractive_segment_count`. - * - * Currently one segment is returned for each - * [SearchResult][google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult]. *
* * int32 max_extractive_segment_count = 2; @@ -12659,6 +13152,180 @@ public Builder clearMaxExtractiveSegmentCount() { return this; } + private boolean returnExtractiveSegmentScore_; + /** + * + * + *
+         * Specifies whether to return the confidence score from the extractive
+         * segments in each search result. The default value is `false`.
+         * 
+ * + * bool return_extractive_segment_score = 3; + * + * @return The returnExtractiveSegmentScore. + */ + @java.lang.Override + public boolean getReturnExtractiveSegmentScore() { + return returnExtractiveSegmentScore_; + } + /** + * + * + *
+         * Specifies whether to return the confidence score from the extractive
+         * segments in each search result. The default value is `false`.
+         * 
+ * + * bool return_extractive_segment_score = 3; + * + * @param value The returnExtractiveSegmentScore to set. + * @return This builder for chaining. + */ + public Builder setReturnExtractiveSegmentScore(boolean value) { + + returnExtractiveSegmentScore_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Specifies whether to return the confidence score from the extractive
+         * segments in each search result. The default value is `false`.
+         * 
+ * + * bool return_extractive_segment_score = 3; + * + * @return This builder for chaining. + */ + public Builder clearReturnExtractiveSegmentScore() { + bitField0_ = (bitField0_ & ~0x00000004); + returnExtractiveSegmentScore_ = false; + onChanged(); + return this; + } + + private int numPreviousSegments_; + /** + * + * + *
+         * Specifies whether to also include the adjacent from each selected
+         * segments.
+         * Return at most `num_previous_segments` segments before each selected
+         * segments.
+         * 
+ * + * int32 num_previous_segments = 4; + * + * @return The numPreviousSegments. + */ + @java.lang.Override + public int getNumPreviousSegments() { + return numPreviousSegments_; + } + /** + * + * + *
+         * Specifies whether to also include the adjacent from each selected
+         * segments.
+         * Return at most `num_previous_segments` segments before each selected
+         * segments.
+         * 
+ * + * int32 num_previous_segments = 4; + * + * @param value The numPreviousSegments to set. + * @return This builder for chaining. + */ + public Builder setNumPreviousSegments(int value) { + + numPreviousSegments_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Specifies whether to also include the adjacent from each selected
+         * segments.
+         * Return at most `num_previous_segments` segments before each selected
+         * segments.
+         * 
+ * + * int32 num_previous_segments = 4; + * + * @return This builder for chaining. + */ + public Builder clearNumPreviousSegments() { + bitField0_ = (bitField0_ & ~0x00000008); + numPreviousSegments_ = 0; + onChanged(); + return this; + } + + private int numNextSegments_; + /** + * + * + *
+         * Return at most `num_next_segments` segments after each selected
+         * segments.
+         * 
+ * + * int32 num_next_segments = 5; + * + * @return The numNextSegments. + */ + @java.lang.Override + public int getNumNextSegments() { + return numNextSegments_; + } + /** + * + * + *
+         * Return at most `num_next_segments` segments after each selected
+         * segments.
+         * 
+ * + * int32 num_next_segments = 5; + * + * @param value The numNextSegments to set. + * @return This builder for chaining. + */ + public Builder setNumNextSegments(int value) { + + numNextSegments_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Return at most `num_next_segments` segments after each selected
+         * segments.
+         * 
+ * + * int32 num_next_segments = 5; + * + * @return This builder for chaining. + */ + public Builder clearNumNextSegments() { + bitField0_ = (bitField0_ & ~0x00000010); + numNextSegments_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -14138,37 +14805,2143 @@ public com.google.protobuf.Parser getParserForType() { } } - public static final int SERVING_CONFIG_FIELD_NUMBER = 1; + public interface EmbeddingSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec) + com.google.protobuf.MessageOrBuilder { - @SuppressWarnings("serial") - private volatile java.lang.Object servingConfig_ = ""; + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + java.util.List< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector> + getEmbeddingVectorsList(); + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + getEmbeddingVectors(int index); + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + int getEmbeddingVectorsCount(); + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder> + getEmbeddingVectorsOrBuilderList(); + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVectorOrBuilder + getEmbeddingVectorsOrBuilder(int index); + } /** * * *
-   * Required. The resource name of the Search serving config, such as
-   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
-   * This field is used to identify the serving configuration name, set
-   * of models used to make the search.
+   * The specification that uses customized query embedding vector to do
+   * semantic document retrieval.
    * 
* - * - * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The servingConfig. + * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec} */ - @java.lang.Override - public java.lang.String getServingConfig() { - java.lang.Object ref = servingConfig_; - 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(); - servingConfig_ = s; - return s; - } + public static final class EmbeddingSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec) + EmbeddingSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use EmbeddingSpec.newBuilder() to construct. + private EmbeddingSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EmbeddingSpec() { + embeddingVectors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EmbeddingSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.class, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.Builder.class); + } + + public interface EmbeddingVectorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Embedding field path in schema.
+       * 
+ * + * string field_path = 1; + * + * @return The fieldPath. + */ + java.lang.String getFieldPath(); + /** + * + * + *
+       * Embedding field path in schema.
+       * 
+ * + * string field_path = 1; + * + * @return The bytes for fieldPath. + */ + com.google.protobuf.ByteString getFieldPathBytes(); + + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @return A list containing the vector. + */ + java.util.List getVectorList(); + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @return The count of vector. + */ + int getVectorCount(); + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @param index The index of the element to return. + * @return The vector at the given index. + */ + float getVector(int index); + } + /** + * + * + *
+     * Embedding vector.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector} + */ + public static final class EmbeddingVector extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector) + EmbeddingVectorOrBuilder { + private static final long serialVersionUID = 0L; + // Use EmbeddingVector.newBuilder() to construct. + private EmbeddingVector(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EmbeddingVector() { + fieldPath_ = ""; + vector_ = emptyFloatList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EmbeddingVector(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_EmbeddingVector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .class, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder.class); + } + + public static final int FIELD_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fieldPath_ = ""; + /** + * + * + *
+       * Embedding field path in schema.
+       * 
+ * + * string field_path = 1; + * + * @return The fieldPath. + */ + @java.lang.Override + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + 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(); + fieldPath_ = s; + return s; + } + } + /** + * + * + *
+       * Embedding field path in schema.
+       * 
+ * + * string field_path = 1; + * + * @return The bytes for fieldPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VECTOR_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList vector_; + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @return A list containing the vector. + */ + @java.lang.Override + public java.util.List getVectorList() { + return vector_; + } + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @return The count of vector. + */ + public int getVectorCount() { + return vector_.size(); + } + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @param index The index of the element to return. + * @return The vector at the given index. + */ + public float getVector(int index) { + return vector_.getFloat(index); + } + + private int vectorMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fieldPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fieldPath_); + } + if (getVectorList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(vectorMemoizedSerializedSize); + } + for (int i = 0; i < vector_.size(); i++) { + output.writeFloatNoTag(vector_.getFloat(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(fieldPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fieldPath_); + } + { + int dataSize = 0; + dataSize = 4 * getVectorList().size(); + size += dataSize; + if (!getVectorList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + vectorMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector other = + (com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector) + obj; + + if (!getFieldPath().equals(other.getFieldPath())) return false; + if (!getVectorList().equals(other.getVectorList())) 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) + FIELD_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFieldPath().hashCode(); + if (getVectorCount() > 0) { + hash = (37 * hash) + VECTOR_FIELD_NUMBER; + hash = (53 * hash) + getVectorList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + 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; + } + /** + * + * + *
+       * Embedding vector.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector) + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_EmbeddingVector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector.class, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fieldPath_ = ""; + vector_ = emptyFloatList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + build() { + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + buildPartial() { + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + result = + new com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + result) { + if (((bitField0_ & 0x00000002) != 0)) { + vector_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.vector_ = vector_; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fieldPath_ = fieldPath_; + } + } + + @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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + other) { + if (other + == com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .getDefaultInstance()) return this; + if (!other.getFieldPath().isEmpty()) { + fieldPath_ = other.fieldPath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.vector_.isEmpty()) { + if (vector_.isEmpty()) { + vector_ = other.vector_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureVectorIsMutable(); + vector_.addAll(other.vector_); + } + 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: + { + fieldPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: + { + float v = input.readFloat(); + ensureVectorIsMutable(); + vector_.addFloat(v); + break; + } // case 21 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureVectorIsMutable(); + while (input.getBytesUntilLimit() > 0) { + vector_.addFloat(input.readFloat()); + } + input.popLimit(limit); + 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 fieldPath_ = ""; + /** + * + * + *
+         * Embedding field path in schema.
+         * 
+ * + * string field_path = 1; + * + * @return The fieldPath. + */ + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Embedding field path in schema.
+         * 
+ * + * string field_path = 1; + * + * @return The bytes for fieldPath. + */ + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Embedding field path in schema.
+         * 
+ * + * string field_path = 1; + * + * @param value The fieldPath to set. + * @return This builder for chaining. + */ + public Builder setFieldPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fieldPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Embedding field path in schema.
+         * 
+ * + * string field_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearFieldPath() { + fieldPath_ = getDefaultInstance().getFieldPath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * Embedding field path in schema.
+         * 
+ * + * string field_path = 1; + * + * @param value The bytes for fieldPath to set. + * @return This builder for chaining. + */ + public Builder setFieldPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fieldPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.FloatList vector_ = emptyFloatList(); + + private void ensureVectorIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + vector_ = mutableCopy(vector_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @return A list containing the vector. + */ + public java.util.List getVectorList() { + return ((bitField0_ & 0x00000002) != 0) + ? java.util.Collections.unmodifiableList(vector_) + : vector_; + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @return The count of vector. + */ + public int getVectorCount() { + return vector_.size(); + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @param index The index of the element to return. + * @return The vector at the given index. + */ + public float getVector(int index) { + return vector_.getFloat(index); + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @param index The index to set the value at. + * @param value The vector to set. + * @return This builder for chaining. + */ + public Builder setVector(int index, float value) { + + ensureVectorIsMutable(); + vector_.setFloat(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @param value The vector to add. + * @return This builder for chaining. + */ + public Builder addVector(float value) { + + ensureVectorIsMutable(); + vector_.addFloat(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @param values The vector to add. + * @return This builder for chaining. + */ + public Builder addAllVector(java.lang.Iterable values) { + ensureVectorIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, vector_); + onChanged(); + return this; + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @return This builder for chaining. + */ + public Builder clearVector() { + vector_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector) + private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector(); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EmbeddingVector 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int EMBEDDING_VECTORS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector> + embeddingVectors_; + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector> + getEmbeddingVectorsList() { + return embeddingVectors_; + } + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder> + getEmbeddingVectorsOrBuilderList() { + return embeddingVectors_; + } + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + @java.lang.Override + public int getEmbeddingVectorsCount() { + return embeddingVectors_.size(); + } + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + getEmbeddingVectors(int index) { + return embeddingVectors_.get(index); + } + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder + getEmbeddingVectorsOrBuilder(int index) { + return embeddingVectors_.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 < embeddingVectors_.size(); i++) { + output.writeMessage(1, embeddingVectors_.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 < embeddingVectors_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, embeddingVectors_.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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec other = + (com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec) obj; + + if (!getEmbeddingVectorsList().equals(other.getEmbeddingVectorsList())) 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 (getEmbeddingVectorsCount() > 0) { + hash = (37 * hash) + EMBEDDING_VECTORS_FIELD_NUMBER; + hash = (53 * hash) + getEmbeddingVectorsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec 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 specification that uses customized query embedding vector to do
+     * semantic document retrieval.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec) + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.class, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (embeddingVectorsBuilder_ == null) { + embeddingVectors_ = java.util.Collections.emptyList(); + } else { + embeddingVectors_ = null; + embeddingVectorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec build() { + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec buildPartial() { + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec result = + new com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec result) { + if (embeddingVectorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + embeddingVectors_ = java.util.Collections.unmodifiableList(embeddingVectors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.embeddingVectors_ = embeddingVectors_; + } else { + result.embeddingVectors_ = embeddingVectorsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec other) { + if (other + == com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .getDefaultInstance()) return this; + if (embeddingVectorsBuilder_ == null) { + if (!other.embeddingVectors_.isEmpty()) { + if (embeddingVectors_.isEmpty()) { + embeddingVectors_ = other.embeddingVectors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.addAll(other.embeddingVectors_); + } + onChanged(); + } + } else { + if (!other.embeddingVectors_.isEmpty()) { + if (embeddingVectorsBuilder_.isEmpty()) { + embeddingVectorsBuilder_.dispose(); + embeddingVectorsBuilder_ = null; + embeddingVectors_ = other.embeddingVectors_; + bitField0_ = (bitField0_ & ~0x00000001); + embeddingVectorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEmbeddingVectorsFieldBuilder() + : null; + } else { + embeddingVectorsBuilder_.addAllMessages(other.embeddingVectors_); + } + } + } + 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector + m = + input.readMessage( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector.parser(), + extensionRegistry); + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.add(m); + } else { + embeddingVectorsBuilder_.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< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector> + embeddingVectors_ = java.util.Collections.emptyList(); + + private void ensureEmbeddingVectorsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + embeddingVectors_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector>(embeddingVectors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder> + embeddingVectorsBuilder_; + + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector> + getEmbeddingVectorsList() { + if (embeddingVectorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(embeddingVectors_); + } else { + return embeddingVectorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public int getEmbeddingVectorsCount() { + if (embeddingVectorsBuilder_ == null) { + return embeddingVectors_.size(); + } else { + return embeddingVectorsBuilder_.getCount(); + } + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + getEmbeddingVectors(int index) { + if (embeddingVectorsBuilder_ == null) { + return embeddingVectors_.get(index); + } else { + return embeddingVectorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder setEmbeddingVectors( + int index, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + value) { + if (embeddingVectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.set(index, value); + onChanged(); + } else { + embeddingVectorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder setEmbeddingVectors( + int index, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + builderForValue) { + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.set(index, builderForValue.build()); + onChanged(); + } else { + embeddingVectorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder addEmbeddingVectors( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + value) { + if (embeddingVectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.add(value); + onChanged(); + } else { + embeddingVectorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder addEmbeddingVectors( + int index, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + value) { + if (embeddingVectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.add(index, value); + onChanged(); + } else { + embeddingVectorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder addEmbeddingVectors( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + builderForValue) { + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.add(builderForValue.build()); + onChanged(); + } else { + embeddingVectorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder addEmbeddingVectors( + int index, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + builderForValue) { + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.add(index, builderForValue.build()); + onChanged(); + } else { + embeddingVectorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder addAllEmbeddingVectors( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector> + values) { + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, embeddingVectors_); + onChanged(); + } else { + embeddingVectorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder clearEmbeddingVectors() { + if (embeddingVectorsBuilder_ == null) { + embeddingVectors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + embeddingVectorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder removeEmbeddingVectors(int index) { + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.remove(index); + onChanged(); + } else { + embeddingVectorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + getEmbeddingVectorsBuilder(int index) { + return getEmbeddingVectorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder + getEmbeddingVectorsOrBuilder(int index) { + if (embeddingVectorsBuilder_ == null) { + return embeddingVectors_.get(index); + } else { + return embeddingVectorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder> + getEmbeddingVectorsOrBuilderList() { + if (embeddingVectorsBuilder_ != null) { + return embeddingVectorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(embeddingVectors_); + } + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + addEmbeddingVectorsBuilder() { + return getEmbeddingVectorsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .getDefaultInstance()); + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + addEmbeddingVectorsBuilder(int index) { + return getEmbeddingVectorsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .getDefaultInstance()); + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder> + getEmbeddingVectorsBuilderList() { + return getEmbeddingVectorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder> + getEmbeddingVectorsFieldBuilder() { + if (embeddingVectorsBuilder_ == null) { + embeddingVectorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVector.Builder, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder>( + embeddingVectors_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + embeddingVectors_ = null; + } + return embeddingVectorsBuilder_; + } + + @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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec) + private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec(); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EmbeddingSpec 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.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object servingConfig_ = ""; + /** + * + * + *
+   * Required. The resource name of the Search serving config, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+   * This field is used to identify the serving configuration name, set
+   * of models used to make the search.
+   * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The servingConfig. + */ + @java.lang.Override + public java.lang.String getServingConfig() { + java.lang.Object ref = servingConfig_; + 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(); + servingConfig_ = s; + return s; + } } /** * @@ -15184,20 +17957,182 @@ public boolean hasContentSearchSpec() { * * *
-   * A specification for configuring the behavior of content search.
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpecOrBuilder + getContentSearchSpecOrBuilder() { + return contentSearchSpec_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec + .getDefaultInstance() + : contentSearchSpec_; + } + + public static final int EMBEDDING_SPEC_FIELD_NUMBER = 23; + private com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embeddingSpec_; + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return Whether the embeddingSpec field is set. + */ + @java.lang.Override + public boolean hasEmbeddingSpec() { + return embeddingSpec_ != null; + } + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return The embeddingSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec getEmbeddingSpec() { + return embeddingSpec_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.getDefaultInstance() + : embeddingSpec_; + } + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpecOrBuilder + getEmbeddingSpecOrBuilder() { + return embeddingSpec_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.getDefaultInstance() + : embeddingSpec_; + } + + public static final int RANKING_EXPRESSION_FIELD_NUMBER = 26; + + @SuppressWarnings("serial") + private volatile java.lang.Object rankingExpression_ = ""; + /** + * + * + *
+   * The ranking expression controls the customized ranking on retrieval
+   * documents. This overrides [ServingConfig.ranking_expression][].
+   * The ranking expression is a single function or multiple functions that are
+   * joint by "+".
+   *   * ranking_expression = function, { " + ", function };
+   * Supported functions:
+   *   * double * relevance_score
+   *   * double * dotProduct(embedding_field_path)
+   * Function variables:
+   *   `relevance_score`: pre-defined keywords, used for measure relevance
+   *   between query and document.
+   *   `embedding_field_path`: the document embedding field
+   *   used with query embedding vector.
+   *   `dotProduct`: embedding function between embedding_field_path and query
+   *   embedding vector.
+   *
+   *  Example ranking expression:
+   *    If document has an embedding field doc_embedding, the ranking expression
+   *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+   * 
+ * + * string ranking_expression = 26; + * + * @return The rankingExpression. + */ + @java.lang.Override + public java.lang.String getRankingExpression() { + java.lang.Object ref = rankingExpression_; + 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(); + rankingExpression_ = s; + return s; + } + } + /** + * + * + *
+   * The ranking expression controls the customized ranking on retrieval
+   * documents. This overrides [ServingConfig.ranking_expression][].
+   * The ranking expression is a single function or multiple functions that are
+   * joint by "+".
+   *   * ranking_expression = function, { " + ", function };
+   * Supported functions:
+   *   * double * relevance_score
+   *   * double * dotProduct(embedding_field_path)
+   * Function variables:
+   *   `relevance_score`: pre-defined keywords, used for measure relevance
+   *   between query and document.
+   *   `embedding_field_path`: the document embedding field
+   *   used with query embedding vector.
+   *   `dotProduct`: embedding function between embedding_field_path and query
+   *   embedding vector.
+   *
+   *  Example ranking expression:
+   *    If document has an embedding field doc_embedding, the ranking expression
+   *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
    * 
* - * - * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24; - * + * string ranking_expression = 26; + * + * @return The bytes for rankingExpression. */ @java.lang.Override - public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpecOrBuilder - getContentSearchSpecOrBuilder() { - return contentSearchSpec_ == null - ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec - .getDefaultInstance() - : contentSearchSpec_; + public com.google.protobuf.ByteString getRankingExpressionBytes() { + java.lang.Object ref = rankingExpression_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rankingExpression_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } public static final int SAFE_SEARCH_FIELD_NUMBER = 20; @@ -15451,9 +18386,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 22); + if (embeddingSpec_ != null) { + output.writeMessage(23, getEmbeddingSpec()); + } if (contentSearchSpec_ != null) { output.writeMessage(24, getContentSearchSpec()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rankingExpression_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 26, rankingExpression_); + } getUnknownFields().writeTo(output); } @@ -15532,9 +18473,15 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, userLabels__); } + if (embeddingSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getEmbeddingSpec()); + } if (contentSearchSpec_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getContentSearchSpec()); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rankingExpression_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(26, rankingExpression_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -15586,6 +18533,11 @@ public boolean equals(final java.lang.Object obj) { if (hasContentSearchSpec()) { if (!getContentSearchSpec().equals(other.getContentSearchSpec())) return false; } + if (hasEmbeddingSpec() != other.hasEmbeddingSpec()) return false; + if (hasEmbeddingSpec()) { + if (!getEmbeddingSpec().equals(other.getEmbeddingSpec())) return false; + } + if (!getRankingExpression().equals(other.getRankingExpression())) return false; if (getSafeSearch() != other.getSafeSearch()) return false; if (!internalGetUserLabels().equals(other.internalGetUserLabels())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; @@ -15649,6 +18601,12 @@ public int hashCode() { hash = (37 * hash) + CONTENT_SEARCH_SPEC_FIELD_NUMBER; hash = (53 * hash) + getContentSearchSpec().hashCode(); } + if (hasEmbeddingSpec()) { + hash = (37 * hash) + EMBEDDING_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getEmbeddingSpec().hashCode(); + } + hash = (37 * hash) + RANKING_EXPRESSION_FIELD_NUMBER; + hash = (53 * hash) + getRankingExpression().hashCode(); hash = (37 * hash) + SAFE_SEARCH_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSafeSearch()); if (!internalGetUserLabels().getMap().isEmpty()) { @@ -15868,6 +18826,12 @@ public Builder clear() { contentSearchSpecBuilder_.dispose(); contentSearchSpecBuilder_ = null; } + embeddingSpec_ = null; + if (embeddingSpecBuilder_ != null) { + embeddingSpecBuilder_.dispose(); + embeddingSpecBuilder_ = null; + } + rankingExpression_ = ""; safeSearch_ = false; internalGetMutableUserLabels().clear(); return this; @@ -15979,9 +18943,16 @@ private void buildPartial0(com.google.cloud.discoveryengine.v1beta.SearchRequest : contentSearchSpecBuilder_.build(); } if (((from_bitField0_ & 0x00020000) != 0)) { - result.safeSearch_ = safeSearch_; + result.embeddingSpec_ = + embeddingSpecBuilder_ == null ? embeddingSpec_ : embeddingSpecBuilder_.build(); } if (((from_bitField0_ & 0x00040000) != 0)) { + result.rankingExpression_ = rankingExpression_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.safeSearch_ = safeSearch_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { result.userLabels_ = internalGetUserLabels(); result.userLabels_.makeImmutable(); } @@ -16121,11 +19092,19 @@ public Builder mergeFrom(com.google.cloud.discoveryengine.v1beta.SearchRequest o if (other.hasContentSearchSpec()) { mergeContentSearchSpec(other.getContentSearchSpec()); } + if (other.hasEmbeddingSpec()) { + mergeEmbeddingSpec(other.getEmbeddingSpec()); + } + if (!other.getRankingExpression().isEmpty()) { + rankingExpression_ = other.rankingExpression_; + bitField0_ |= 0x00040000; + onChanged(); + } if (other.getSafeSearch() != false) { setSafeSearch(other.getSafeSearch()); } internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); - bitField0_ |= 0x00040000; + bitField0_ |= 0x00100000; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -16261,7 +19240,7 @@ public Builder mergeFrom( case 160: { safeSearch_ = input.readBool(); - bitField0_ |= 0x00020000; + bitField0_ |= 0x00080000; break; } // case 160 case 170: @@ -16279,9 +19258,15 @@ public Builder mergeFrom( internalGetMutableUserLabels() .getMutableMap() .put(userLabels__.getKey(), userLabels__.getValue()); - bitField0_ |= 0x00040000; + bitField0_ |= 0x00100000; break; } // case 178 + case 186: + { + input.readMessage(getEmbeddingSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 186 case 194: { input.readMessage( @@ -16289,6 +19274,12 @@ public Builder mergeFrom( bitField0_ |= 0x00010000; break; } // case 194 + case 210: + { + rankingExpression_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00040000; + break; + } // case 210 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -19288,6 +22279,467 @@ public Builder clearContentSearchSpec() { return contentSearchSpecBuilder_; } + private com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embeddingSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.Builder, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpecOrBuilder> + embeddingSpecBuilder_; + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return Whether the embeddingSpec field is set. + */ + public boolean hasEmbeddingSpec() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return The embeddingSpec. + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec getEmbeddingSpec() { + if (embeddingSpecBuilder_ == null) { + return embeddingSpec_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .getDefaultInstance() + : embeddingSpec_; + } else { + return embeddingSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public Builder setEmbeddingSpec( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec value) { + if (embeddingSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + embeddingSpec_ = value; + } else { + embeddingSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public Builder setEmbeddingSpec( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.Builder + builderForValue) { + if (embeddingSpecBuilder_ == null) { + embeddingSpec_ = builderForValue.build(); + } else { + embeddingSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public Builder mergeEmbeddingSpec( + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec value) { + if (embeddingSpecBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && embeddingSpec_ != null + && embeddingSpec_ + != com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .getDefaultInstance()) { + getEmbeddingSpecBuilder().mergeFrom(value); + } else { + embeddingSpec_ = value; + } + } else { + embeddingSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public Builder clearEmbeddingSpec() { + bitField0_ = (bitField0_ & ~0x00020000); + embeddingSpec_ = null; + if (embeddingSpecBuilder_ != null) { + embeddingSpecBuilder_.dispose(); + embeddingSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.Builder + getEmbeddingSpecBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getEmbeddingSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpecOrBuilder + getEmbeddingSpecOrBuilder() { + if (embeddingSpecBuilder_ != null) { + return embeddingSpecBuilder_.getMessageOrBuilder(); + } else { + return embeddingSpec_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec + .getDefaultInstance() + : embeddingSpec_; + } + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.Builder, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpecOrBuilder> + getEmbeddingSpecFieldBuilder() { + if (embeddingSpecBuilder_ == null) { + embeddingSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.Builder, + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpecOrBuilder>( + getEmbeddingSpec(), getParentForChildren(), isClean()); + embeddingSpec_ = null; + } + return embeddingSpecBuilder_; + } + + private java.lang.Object rankingExpression_ = ""; + /** + * + * + *
+     * The ranking expression controls the customized ranking on retrieval
+     * documents. This overrides [ServingConfig.ranking_expression][].
+     * The ranking expression is a single function or multiple functions that are
+     * joint by "+".
+     *   * ranking_expression = function, { " + ", function };
+     * Supported functions:
+     *   * double * relevance_score
+     *   * double * dotProduct(embedding_field_path)
+     * Function variables:
+     *   `relevance_score`: pre-defined keywords, used for measure relevance
+     *   between query and document.
+     *   `embedding_field_path`: the document embedding field
+     *   used with query embedding vector.
+     *   `dotProduct`: embedding function between embedding_field_path and query
+     *   embedding vector.
+     *
+     *  Example ranking expression:
+     *    If document has an embedding field doc_embedding, the ranking expression
+     *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+     * 
+ * + * string ranking_expression = 26; + * + * @return The rankingExpression. + */ + public java.lang.String getRankingExpression() { + java.lang.Object ref = rankingExpression_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rankingExpression_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ranking expression controls the customized ranking on retrieval
+     * documents. This overrides [ServingConfig.ranking_expression][].
+     * The ranking expression is a single function or multiple functions that are
+     * joint by "+".
+     *   * ranking_expression = function, { " + ", function };
+     * Supported functions:
+     *   * double * relevance_score
+     *   * double * dotProduct(embedding_field_path)
+     * Function variables:
+     *   `relevance_score`: pre-defined keywords, used for measure relevance
+     *   between query and document.
+     *   `embedding_field_path`: the document embedding field
+     *   used with query embedding vector.
+     *   `dotProduct`: embedding function between embedding_field_path and query
+     *   embedding vector.
+     *
+     *  Example ranking expression:
+     *    If document has an embedding field doc_embedding, the ranking expression
+     *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+     * 
+ * + * string ranking_expression = 26; + * + * @return The bytes for rankingExpression. + */ + public com.google.protobuf.ByteString getRankingExpressionBytes() { + java.lang.Object ref = rankingExpression_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rankingExpression_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ranking expression controls the customized ranking on retrieval
+     * documents. This overrides [ServingConfig.ranking_expression][].
+     * The ranking expression is a single function or multiple functions that are
+     * joint by "+".
+     *   * ranking_expression = function, { " + ", function };
+     * Supported functions:
+     *   * double * relevance_score
+     *   * double * dotProduct(embedding_field_path)
+     * Function variables:
+     *   `relevance_score`: pre-defined keywords, used for measure relevance
+     *   between query and document.
+     *   `embedding_field_path`: the document embedding field
+     *   used with query embedding vector.
+     *   `dotProduct`: embedding function between embedding_field_path and query
+     *   embedding vector.
+     *
+     *  Example ranking expression:
+     *    If document has an embedding field doc_embedding, the ranking expression
+     *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+     * 
+ * + * string ranking_expression = 26; + * + * @param value The rankingExpression to set. + * @return This builder for chaining. + */ + public Builder setRankingExpression(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + rankingExpression_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * The ranking expression controls the customized ranking on retrieval
+     * documents. This overrides [ServingConfig.ranking_expression][].
+     * The ranking expression is a single function or multiple functions that are
+     * joint by "+".
+     *   * ranking_expression = function, { " + ", function };
+     * Supported functions:
+     *   * double * relevance_score
+     *   * double * dotProduct(embedding_field_path)
+     * Function variables:
+     *   `relevance_score`: pre-defined keywords, used for measure relevance
+     *   between query and document.
+     *   `embedding_field_path`: the document embedding field
+     *   used with query embedding vector.
+     *   `dotProduct`: embedding function between embedding_field_path and query
+     *   embedding vector.
+     *
+     *  Example ranking expression:
+     *    If document has an embedding field doc_embedding, the ranking expression
+     *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+     * 
+ * + * string ranking_expression = 26; + * + * @return This builder for chaining. + */ + public Builder clearRankingExpression() { + rankingExpression_ = getDefaultInstance().getRankingExpression(); + bitField0_ = (bitField0_ & ~0x00040000); + onChanged(); + return this; + } + /** + * + * + *
+     * The ranking expression controls the customized ranking on retrieval
+     * documents. This overrides [ServingConfig.ranking_expression][].
+     * The ranking expression is a single function or multiple functions that are
+     * joint by "+".
+     *   * ranking_expression = function, { " + ", function };
+     * Supported functions:
+     *   * double * relevance_score
+     *   * double * dotProduct(embedding_field_path)
+     * Function variables:
+     *   `relevance_score`: pre-defined keywords, used for measure relevance
+     *   between query and document.
+     *   `embedding_field_path`: the document embedding field
+     *   used with query embedding vector.
+     *   `dotProduct`: embedding function between embedding_field_path and query
+     *   embedding vector.
+     *
+     *  Example ranking expression:
+     *    If document has an embedding field doc_embedding, the ranking expression
+     *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+     * 
+ * + * string ranking_expression = 26; + * + * @param value The bytes for rankingExpression to set. + * @return This builder for chaining. + */ + public Builder setRankingExpressionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + rankingExpression_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + private boolean safeSearch_; /** * @@ -19321,7 +22773,7 @@ public boolean getSafeSearch() { public Builder setSafeSearch(boolean value) { safeSearch_ = value; - bitField0_ |= 0x00020000; + bitField0_ |= 0x00080000; onChanged(); return this; } @@ -19338,7 +22790,7 @@ public Builder setSafeSearch(boolean value) { * @return This builder for chaining. */ public Builder clearSafeSearch() { - bitField0_ = (bitField0_ & ~0x00020000); + bitField0_ = (bitField0_ & ~0x00080000); safeSearch_ = false; onChanged(); return this; @@ -19364,7 +22816,7 @@ public Builder clearSafeSearch() { if (!userLabels_.isMutable()) { userLabels_ = userLabels_.copy(); } - bitField0_ |= 0x00040000; + bitField0_ |= 0x00100000; onChanged(); return userLabels_; } @@ -19513,7 +22965,7 @@ public java.lang.String getUserLabelsOrThrow(java.lang.String key) { } public Builder clearUserLabels() { - bitField0_ = (bitField0_ & ~0x00040000); + bitField0_ = (bitField0_ & ~0x00100000); internalGetMutableUserLabels().getMutableMap().clear(); return this; } @@ -19552,7 +23004,7 @@ public Builder removeUserLabels(java.lang.String key) { /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableUserLabels() { - bitField0_ |= 0x00040000; + bitField0_ |= 0x00100000; return internalGetMutableUserLabels().getMutableMap(); } /** @@ -19588,7 +23040,7 @@ public Builder putUserLabels(java.lang.String key, java.lang.String value) { throw new NullPointerException("map value"); } internalGetMutableUserLabels().getMutableMap().put(key, value); - bitField0_ |= 0x00040000; + bitField0_ |= 0x00100000; return this; } /** @@ -19618,7 +23070,7 @@ public Builder putUserLabels(java.lang.String key, java.lang.String value) { */ public Builder putAllUserLabels(java.util.Map values) { internalGetMutableUserLabels().getMutableMap().putAll(values); - bitField0_ |= 0x00040000; + bitField0_ |= 0x00100000; return this; } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchRequestOrBuilder.java index f49589b50039..f046080cb796 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchRequestOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchRequestOrBuilder.java @@ -731,6 +731,127 @@ com.google.protobuf.Value getParamsOrDefault( com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpecOrBuilder getContentSearchSpecOrBuilder(); + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return Whether the embeddingSpec field is set. + */ + boolean hasEmbeddingSpec(); + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return The embeddingSpec. + */ + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec getEmbeddingSpec(); + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + com.google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpecOrBuilder + getEmbeddingSpecOrBuilder(); + + /** + * + * + *
+   * The ranking expression controls the customized ranking on retrieval
+   * documents. This overrides [ServingConfig.ranking_expression][].
+   * The ranking expression is a single function or multiple functions that are
+   * joint by "+".
+   *   * ranking_expression = function, { " + ", function };
+   * Supported functions:
+   *   * double * relevance_score
+   *   * double * dotProduct(embedding_field_path)
+   * Function variables:
+   *   `relevance_score`: pre-defined keywords, used for measure relevance
+   *   between query and document.
+   *   `embedding_field_path`: the document embedding field
+   *   used with query embedding vector.
+   *   `dotProduct`: embedding function between embedding_field_path and query
+   *   embedding vector.
+   *
+   *  Example ranking expression:
+   *    If document has an embedding field doc_embedding, the ranking expression
+   *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+   * 
+ * + * string ranking_expression = 26; + * + * @return The rankingExpression. + */ + java.lang.String getRankingExpression(); + /** + * + * + *
+   * The ranking expression controls the customized ranking on retrieval
+   * documents. This overrides [ServingConfig.ranking_expression][].
+   * The ranking expression is a single function or multiple functions that are
+   * joint by "+".
+   *   * ranking_expression = function, { " + ", function };
+   * Supported functions:
+   *   * double * relevance_score
+   *   * double * dotProduct(embedding_field_path)
+   * Function variables:
+   *   `relevance_score`: pre-defined keywords, used for measure relevance
+   *   between query and document.
+   *   `embedding_field_path`: the document embedding field
+   *   used with query embedding vector.
+   *   `dotProduct`: embedding function between embedding_field_path and query
+   *   embedding vector.
+   *
+   *  Example ranking expression:
+   *    If document has an embedding field doc_embedding, the ranking expression
+   *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+   * 
+ * + * string ranking_expression = 26; + * + * @return The bytes for rankingExpression. + */ + com.google.protobuf.ByteString getRankingExpressionBytes(); + /** * * diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchResponse.java index 90357c559cad..aea48c73aee3 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchResponse.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchResponse.java @@ -139,6 +139,71 @@ public interface SearchResultOrBuilder * .google.cloud.discoveryengine.v1beta.Document document = 2; */ com.google.cloud.discoveryengine.v1beta.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + int getModelScoresCount(); + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + boolean containsModelScores(java.lang.String key); + /** Use {@link #getModelScoresMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getModelScores(); + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + java.util.Map + getModelScoresMap(); + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + /* nullable */ + com.google.cloud.discoveryengine.v1beta.DoubleList getModelScoresOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.discoveryengine.v1beta.DoubleList defaultValue); + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + com.google.cloud.discoveryengine.v1beta.DoubleList getModelScoresOrThrow(java.lang.String key); } /** * @@ -174,6 +239,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetModelScores(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -290,6 +366,127 @@ public com.google.cloud.discoveryengine.v1beta.DocumentOrBuilder getDocumentOrBu : document_; } + public static final int MODEL_SCORES_FIELD_NUMBER = 4; + + private static final class ModelScoresDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.discoveryengine.v1beta.DoubleList> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_ModelScoresEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.discoveryengine.v1beta.DoubleList.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1beta.DoubleList> + modelScores_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1beta.DoubleList> + internalGetModelScores() { + if (modelScores_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ModelScoresDefaultEntryHolder.defaultEntry); + } + return modelScores_; + } + + public int getModelScoresCount() { + return internalGetModelScores().getMap().size(); + } + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public boolean containsModelScores(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetModelScores().getMap().containsKey(key); + } + /** Use {@link #getModelScoresMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getModelScores() { + return getModelScoresMap(); + } + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public java.util.Map + getModelScoresMap() { + return internalGetModelScores().getMap(); + } + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.discoveryengine.v1beta.DoubleList + getModelScoresOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.discoveryengine.v1beta.DoubleList defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetModelScores().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.DoubleList getModelScoresOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetModelScores().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -310,6 +507,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (document_ != null) { output.writeMessage(2, getDocument()); } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetModelScores(), ModelScoresDefaultEntryHolder.defaultEntry, 4); getUnknownFields().writeTo(output); } @@ -325,6 +524,18 @@ public int getSerializedSize() { if (document_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocument()); } + for (java.util.Map.Entry + entry : internalGetModelScores().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.discoveryengine.v1beta.DoubleList> + modelScores__ = + ModelScoresDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, modelScores__); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -346,6 +557,7 @@ public boolean equals(final java.lang.Object obj) { if (hasDocument()) { if (!getDocument().equals(other.getDocument())) return false; } + if (!internalGetModelScores().equals(other.internalGetModelScores())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -363,6 +575,10 @@ public int hashCode() { hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; hash = (53 * hash) + getDocument().hashCode(); } + if (!internalGetModelScores().getMap().isEmpty()) { + hash = (37 * hash) + MODEL_SCORES_FIELD_NUMBER; + hash = (53 * hash) + internalGetModelScores().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -485,6 +701,26 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetModelScores(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableModelScores(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -513,6 +749,7 @@ public Builder clear() { documentBuilder_.dispose(); documentBuilder_ = null; } + internalGetMutableModelScores().clear(); return this; } @@ -558,6 +795,10 @@ private void buildPartial0( if (((from_bitField0_ & 0x00000002) != 0)) { result.document_ = documentBuilder_ == null ? document_ : documentBuilder_.build(); } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.modelScores_ = internalGetModelScores(); + result.modelScores_.makeImmutable(); + } } @java.lang.Override @@ -619,6 +860,8 @@ public Builder mergeFrom( if (other.hasDocument()) { mergeDocument(other.getDocument()); } + internalGetMutableModelScores().mergeFrom(other.internalGetModelScores()); + bitField0_ |= 0x00000004; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -657,6 +900,20 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 18 + case 34: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.discoveryengine.v1beta.DoubleList> + modelScores__ = + input.readMessage( + ModelScoresDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableModelScores() + .getMutableMap() + .put(modelScores__.getKey(), modelScores__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -981,6 +1238,193 @@ public com.google.cloud.discoveryengine.v1beta.DocumentOrBuilder getDocumentOrBu return documentBuilder_; } + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1beta.DoubleList> + modelScores_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1beta.DoubleList> + internalGetModelScores() { + if (modelScores_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ModelScoresDefaultEntryHolder.defaultEntry); + } + return modelScores_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1beta.DoubleList> + internalGetMutableModelScores() { + if (modelScores_ == null) { + modelScores_ = + com.google.protobuf.MapField.newMapField(ModelScoresDefaultEntryHolder.defaultEntry); + } + if (!modelScores_.isMutable()) { + modelScores_ = modelScores_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return modelScores_; + } + + public int getModelScoresCount() { + return internalGetModelScores().getMap().size(); + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public boolean containsModelScores(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetModelScores().getMap().containsKey(key); + } + /** Use {@link #getModelScoresMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getModelScores() { + return getModelScoresMap(); + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public java.util.Map + getModelScoresMap() { + return internalGetModelScores().getMap(); + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.discoveryengine.v1beta.DoubleList + getModelScoresOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.discoveryengine.v1beta.DoubleList defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetModelScores().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.DoubleList getModelScoresOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetModelScores().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearModelScores() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableModelScores().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + public Builder removeModelScores(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableModelScores().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableModelScores() { + bitField0_ |= 0x00000004; + return internalGetMutableModelScores().getMutableMap(); + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + public Builder putModelScores( + java.lang.String key, com.google.cloud.discoveryengine.v1beta.DoubleList value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableModelScores().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1beta.DoubleList> model_scores = 4; + * + */ + public Builder putAllModelScores( + java.util.Map + values) { + internalGetMutableModelScores().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -6245,6 +6689,52 @@ public interface SummaryOrBuilder * @return The enum numeric value on the wire of summarySkippedReasons at the given index. */ int getSummarySkippedReasonsValue(int index); + + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return Whether the safetyAttributes field is set. + */ + boolean hasSafetyAttributes(); + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return The safetyAttributes. + */ + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + getSafetyAttributes(); + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributesOrBuilder + getSafetyAttributesOrBuilder(); } /** * @@ -6354,14 +6844,39 @@ public enum SummarySkippedReason implements com.google.protobuf.ProtocolMessageE * OUT_OF_DOMAIN_QUERY_IGNORED = 3; */ OUT_OF_DOMAIN_QUERY_IGNORED(3), - UNRECOGNIZED(-1), - ; - /** * * *
-       * Default value. The summary skipped reason is not specified.
+       * The potential policy violation case.
+       *
+       * Google skips the summary if there is a potential policy violation
+       * detected. This includes content that may be violent or toxic.
+       * 
+ * + * POTENTIAL_POLICY_VIOLATION = 4; + */ + POTENTIAL_POLICY_VIOLATION(4), + /** + * + * + *
+       * The LLM addon not enabled case.
+       *
+       * Google skips the summary if the LLM addon is not enabled.
+       * 
+ * + * LLM_ADDON_NOT_ENABLED = 5; + */ + LLM_ADDON_NOT_ENABLED(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value. The summary skipped reason is not specified.
        * 
* * SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0; @@ -6409,6 +6924,31 @@ public enum SummarySkippedReason implements com.google.protobuf.ProtocolMessageE * OUT_OF_DOMAIN_QUERY_IGNORED = 3; */ public static final int OUT_OF_DOMAIN_QUERY_IGNORED_VALUE = 3; + /** + * + * + *
+       * The potential policy violation case.
+       *
+       * Google skips the summary if there is a potential policy violation
+       * detected. This includes content that may be violent or toxic.
+       * 
+ * + * POTENTIAL_POLICY_VIOLATION = 4; + */ + public static final int POTENTIAL_POLICY_VIOLATION_VALUE = 4; + /** + * + * + *
+       * The LLM addon not enabled case.
+       *
+       * Google skips the summary if the LLM addon is not enabled.
+       * 
+ * + * LLM_ADDON_NOT_ENABLED = 5; + */ + public static final int LLM_ADDON_NOT_ENABLED_VALUE = 5; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -6442,6 +6982,10 @@ public static SummarySkippedReason forNumber(int value) { return NON_SUMMARY_SEEKING_QUERY_IGNORED; case 3: return OUT_OF_DOMAIN_QUERY_IGNORED; + case 4: + return POTENTIAL_POLICY_VIOLATION; + case 5: + return LLM_ADDON_NOT_ENABLED; default: return null; } @@ -6500,955 +7044,3083 @@ private SummarySkippedReason(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason) } - public static final int SUMMARY_TEXT_FIELD_NUMBER = 1; + public interface SafetyAttributesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes) + com.google.protobuf.MessageOrBuilder { - @SuppressWarnings("serial") - private volatile java.lang.Object summaryText_ = ""; - /** - * - * - *
-     * The summary content.
-     * 
- * - * string summary_text = 1; - * - * @return The summaryText. - */ - @java.lang.Override - public java.lang.String getSummaryText() { - java.lang.Object ref = summaryText_; - 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(); - summaryText_ = s; - return s; - } + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return A list containing the categories. + */ + java.util.List getCategoriesList(); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return The count of categories. + */ + int getCategoriesCount(); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + java.lang.String getCategories(int index); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + com.google.protobuf.ByteString getCategoriesBytes(int index); + + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return A list containing the scores. + */ + java.util.List getScoresList(); + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return The count of scores. + */ + int getScoresCount(); + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @param index The index of the element to return. + * @return The scores at the given index. + */ + float getScores(int index); } /** * * *
-     * The summary content.
+     * Safety Attribute categories and their associated confidence scores.
      * 
* - * string summary_text = 1; - * - * @return The bytes for summaryText. + * Protobuf type {@code + * google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes} */ - @java.lang.Override - public com.google.protobuf.ByteString getSummaryTextBytes() { - java.lang.Object ref = summaryText_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - summaryText_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + public static final class SafetyAttributes extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes) + SafetyAttributesOrBuilder { + private static final long serialVersionUID = 0L; + // Use SafetyAttributes.newBuilder() to construct. + private SafetyAttributes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); } - } - public static final int SUMMARY_SKIPPED_REASONS_FIELD_NUMBER = 2; + private SafetyAttributes() { + categories_ = com.google.protobuf.LazyStringArrayList.emptyList(); + scores_ = emptyFloatList(); + } - @SuppressWarnings("serial") - private java.util.List summarySkippedReasons_; + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SafetyAttributes(); + } - private static final com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason> - summarySkippedReasons_converter_ = - new com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary - .SummarySkippedReason>() { - public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary - .SummarySkippedReason - convert(java.lang.Integer from) { - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason - result = - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary - .SummarySkippedReason.forNumber(from); - return result == null - ? com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary - .SummarySkippedReason.UNRECOGNIZED - : result; - } - }; - /** - * - * - *
-     * Additional summary-skipped reasons. This provides the reason for ignored
-     * cases. If nothing is skipped, this field is not set.
-     * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @return A list containing the summarySkippedReasons. - */ - @java.lang.Override - public java.util.List< - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason> - getSummarySkippedReasonsList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason>( - summarySkippedReasons_, summarySkippedReasons_converter_); - } - /** - * - * - *
-     * Additional summary-skipped reasons. This provides the reason for ignored
-     * cases. If nothing is skipped, this field is not set.
-     * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @return The count of summarySkippedReasons. - */ - @java.lang.Override - public int getSummarySkippedReasonsCount() { - return summarySkippedReasons_.size(); - } - /** - * - * - *
-     * Additional summary-skipped reasons. This provides the reason for ignored
-     * cases. If nothing is skipped, this field is not set.
-     * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @param index The index of the element to return. - * @return The summarySkippedReasons at the given index. - */ - @java.lang.Override - public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason - getSummarySkippedReasons(int index) { - return summarySkippedReasons_converter_.convert(summarySkippedReasons_.get(index)); - } - /** - * - * - *
-     * Additional summary-skipped reasons. This provides the reason for ignored
-     * cases. If nothing is skipped, this field is not set.
-     * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @return A list containing the enum numeric values on the wire for summarySkippedReasons. - */ - @java.lang.Override - public java.util.List getSummarySkippedReasonsValueList() { - return summarySkippedReasons_; - } - /** - * - * - *
-     * Additional summary-skipped reasons. This provides the reason for ignored
-     * cases. If nothing is skipped, this field is not set.
-     * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @param index The index of the value to return. - * @return The enum numeric value on the wire of summarySkippedReasons at the given index. - */ - @java.lang.Override - public int getSummarySkippedReasonsValue(int index) { - return summarySkippedReasons_.get(index); - } + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_SafetyAttributes_descriptor; + } - private int summarySkippedReasonsMemoizedSerializedSize; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .class, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .Builder.class); + } - private byte memoizedIsInitialized = -1; + public static final int CATEGORIES_FIELD_NUMBER = 1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList categories_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + return categories_; + } + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } - memoizedIsInitialized = 1; - return true; - } + public static final int SCORES_FIELD_NUMBER = 2; - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(summaryText_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, summaryText_); + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList scores_; + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return A list containing the scores. + */ + @java.lang.Override + public java.util.List getScoresList() { + return scores_; } - if (getSummarySkippedReasonsList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(summarySkippedReasonsMemoizedSerializedSize); + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return The count of scores. + */ + public int getScoresCount() { + return scores_.size(); } - for (int i = 0; i < summarySkippedReasons_.size(); i++) { - output.writeEnumNoTag(summarySkippedReasons_.get(i)); + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @param index The index of the element to return. + * @return The scores at the given index. + */ + public float getScores(int index) { + return scores_.getFloat(index); } - getUnknownFields().writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + private int scoresMemoizedSerializedSize = -1; - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(summaryText_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, summaryText_); + 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; } - { - int dataSize = 0; - for (int i = 0; i < summarySkippedReasons_.size(); i++) { - dataSize += - com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( - summarySkippedReasons_.get(i)); + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < categories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, categories_.getRaw(i)); } - size += dataSize; - if (!getSummarySkippedReasonsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + if (getScoresList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(scoresMemoizedSerializedSize); } - summarySkippedReasonsMemoizedSerializedSize = dataSize; + for (int i = 0; i < scores_.size(); i++) { + output.writeFloatNoTag(scores_.getFloat(i)); + } + getUnknownFields().writeTo(output); } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < categories_.size(); i++) { + dataSize += computeStringSizeNoTag(categories_.getRaw(i)); + } + size += dataSize; + size += 1 * getCategoriesList().size(); + } + { + int dataSize = 0; + dataSize = 4 * getScoresList().size(); + size += dataSize; + if (!getScoresList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + scoresMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes other = + (com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes) obj; + + if (!getCategoriesList().equals(other.getCategoriesList())) return false; + if (!getScoresList().equals(other.getScoresList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } - if (!(obj instanceof com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary)) { - return super.equals(obj); + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCategoriesCount() > 0) { + hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getCategoriesList().hashCode(); + } + if (getScoresCount() > 0) { + hash = (37 * hash) + SCORES_FIELD_NUMBER; + hash = (53 * hash) + getScoresList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; } - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary other = - (com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary) obj; - if (!getSummaryText().equals(other.getSummaryText())) return false; - if (!summarySkippedReasons_.equals(other.summarySkippedReasons_)) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + SUMMARY_TEXT_FIELD_NUMBER; - hash = (53 * hash) + getSummaryText().hashCode(); - if (getSummarySkippedReasonsCount() > 0) { - hash = (37 * hash) + SUMMARY_SKIPPED_REASONS_FIELD_NUMBER; - hash = (53 * hash) + summarySkippedReasons_.hashCode(); + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + 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.discoveryengine.v1beta.SearchResponse.Summary 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.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary 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.discoveryengine.v1beta.SearchResponse.Summary parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary 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.discoveryengine.v1beta.SearchResponse.Summary parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary 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.discoveryengine.v1beta.SearchResponse.Summary parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary 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.discoveryengine.v1beta.SearchResponse.Summary 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; - } - /** - * - * - *
-     * Summary of the top N search result specified by the summary spec.
-     * 
- * - * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchResponse.Summary} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchResponse.Summary) - com.google.cloud.discoveryengine.v1beta.SearchResponse.SummaryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.discoveryengine.v1beta.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.discoveryengine.v1beta.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.class, - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.Builder.class); + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - // Construct using com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - summaryText_ = ""; - summarySkippedReasons_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.discoveryengine.v1beta.SearchServiceProto - .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_descriptor; + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); } - @java.lang.Override - public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary - getDefaultInstanceForType() { - return com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.getDefaultInstance(); + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - @java.lang.Override - public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary build() { - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + 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 com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary buildPartial() { - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary result = - new com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields( - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary result) { - if (((bitField0_ & 0x00000002) != 0)) { - summarySkippedReasons_ = java.util.Collections.unmodifiableList(summarySkippedReasons_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.summarySkippedReasons_ = summarySkippedReasons_; + public Builder newBuilderForType() { + return newBuilder(); } - private void buildPartial0( - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.summaryText_ = summaryText_; - } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); } - @java.lang.Override - public Builder clone() { - return super.clone(); + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; } + /** + * + * + *
+       * Safety Attribute categories and their associated confidence scores.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes) + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_SafetyAttributes_descriptor; + } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .class, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .Builder.class); + } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } + // Construct using + // com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes.newBuilder() + private Builder() {} - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary) { - return mergeFrom((com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary) other); - } else { - super.mergeFrom(other); + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + categories_ = com.google.protobuf.LazyStringArrayList.emptyList(); + scores_ = emptyFloatList(); return this; } - } - public Builder mergeFrom( - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary other) { - if (other - == com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.getDefaultInstance()) - return this; - if (!other.getSummaryText().isEmpty()) { - summaryText_ = other.summaryText_; - bitField0_ |= 0x00000001; - onChanged(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_SafetyAttributes_descriptor; } - if (!other.summarySkippedReasons_.isEmpty()) { - if (summarySkippedReasons_.isEmpty()) { - summarySkippedReasons_ = other.summarySkippedReasons_; + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + build() { + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + buildPartial() { + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes result = + new com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes( + this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + result) { + if (((bitField0_ & 0x00000002) != 0)) { + scores_.makeImmutable(); bitField0_ = (bitField0_ & ~0x00000002); + } + result.scores_ = scores_; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + categories_.makeImmutable(); + result.categories_ = categories_; + } + } + + @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.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes) + other); } else { - ensureSummarySkippedReasonsIsMutable(); - summarySkippedReasons_.addAll(other.summarySkippedReasons_); + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes other) { + if (other + == com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance()) return this; + if (!other.categories_.isEmpty()) { + if (categories_.isEmpty()) { + categories_ = other.categories_; + bitField0_ |= 0x00000001; + } else { + ensureCategoriesIsMutable(); + categories_.addAll(other.categories_); + } + onChanged(); + } + if (!other.scores_.isEmpty()) { + if (scores_.isEmpty()) { + scores_ = other.scores_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureScoresIsMutable(); + scores_.addAll(other.scores_); + } + onChanged(); } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); + return this; } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCategoriesIsMutable(); + categories_.add(s); + break; + } // case 10 + case 21: + { + float v = input.readFloat(); + ensureScoresIsMutable(); + scores_.addFloat(v); + break; + } // case 21 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureScoresIsMutable(); + while (input.getBytesUntilLimit() > 0) { + scores_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList categories_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCategoriesIsMutable() { + if (!categories_.isModifiable()) { + categories_ = new com.google.protobuf.LazyStringArrayList(categories_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + categories_.makeImmutable(); + return categories_; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + public java.lang.String getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param index The index of the value to return. + * @return The bytes of the categories at the given index. + */ + public com.google.protobuf.ByteString getCategoriesBytes(int index) { + return categories_.getByteString(index); + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param index The index to set the value at. + * @param value The categories to set. + * @return This builder for chaining. + */ + public Builder setCategories(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param value The categories to add. + * @return This builder for chaining. + */ + public Builder addCategories(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param values The categories to add. + * @return This builder for chaining. + */ + public Builder addAllCategories(java.lang.Iterable values) { + ensureCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @return This builder for chaining. + */ + public Builder clearCategories() { + categories_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @param value The bytes of the categories to add. + * @return This builder for chaining. + */ + public Builder addCategoriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCategoriesIsMutable(); + categories_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.FloatList scores_ = emptyFloatList(); + + private void ensureScoresIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + scores_ = mutableCopy(scores_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @return A list containing the scores. + */ + public java.util.List getScoresList() { + return ((bitField0_ & 0x00000002) != 0) + ? java.util.Collections.unmodifiableList(scores_) + : scores_; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @return The count of scores. + */ + public int getScoresCount() { + return scores_.size(); + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param index The index of the element to return. + * @return The scores at the given index. + */ + public float getScores(int index) { + return scores_.getFloat(index); + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param index The index to set the value at. + * @param value The scores to set. + * @return This builder for chaining. + */ + public Builder setScores(int index, float value) { + + ensureScoresIsMutable(); + scores_.setFloat(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param value The scores to add. + * @return This builder for chaining. + */ + public Builder addScores(float value) { + + ensureScoresIsMutable(); + scores_.addFloat(value); + onChanged(); + return this; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param values The scores to add. + * @return This builder for chaining. + */ + public Builder addAllScores(java.lang.Iterable values) { + ensureScoresIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scores_); + onChanged(); + return this; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @return This builder for chaining. + */ + public Builder clearScores() { + scores_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes) + private static final com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .SafetyAttributes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes(); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SafetyAttributes 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.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SUMMARY_TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object summaryText_ = ""; + /** + * + * + *
+     * The summary content.
+     * 
+ * + * string summary_text = 1; + * + * @return The summaryText. + */ + @java.lang.Override + public java.lang.String getSummaryText() { + java.lang.Object ref = summaryText_; + 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(); + summaryText_ = s; + return s; + } + } + /** + * + * + *
+     * The summary content.
+     * 
+ * + * string summary_text = 1; + * + * @return The bytes for summaryText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSummaryTextBytes() { + java.lang.Object ref = summaryText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + summaryText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUMMARY_SKIPPED_REASONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List summarySkippedReasons_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason> + summarySkippedReasons_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .SummarySkippedReason>() { + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .SummarySkippedReason + convert(java.lang.Integer from) { + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason + result = + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .SummarySkippedReason.forNumber(from); + return result == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .SummarySkippedReason.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the summarySkippedReasons. + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason> + getSummarySkippedReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason>( + summarySkippedReasons_, summarySkippedReasons_converter_); + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return The count of summarySkippedReasons. + */ + @java.lang.Override + public int getSummarySkippedReasonsCount() { + return summarySkippedReasons_.size(); + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the element to return. + * @return The summarySkippedReasons at the given index. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason + getSummarySkippedReasons(int index) { + return summarySkippedReasons_converter_.convert(summarySkippedReasons_.get(index)); + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the enum numeric values on the wire for summarySkippedReasons. + */ + @java.lang.Override + public java.util.List getSummarySkippedReasonsValueList() { + return summarySkippedReasons_; + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of summarySkippedReasons at the given index. + */ + @java.lang.Override + public int getSummarySkippedReasonsValue(int index) { + return summarySkippedReasons_.get(index); + } + + private int summarySkippedReasonsMemoizedSerializedSize; + + public static final int SAFETY_ATTRIBUTES_FIELD_NUMBER = 3; + private com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + safetyAttributes_; + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return Whether the safetyAttributes field is set. + */ + @java.lang.Override + public boolean hasSafetyAttributes() { + return safetyAttributes_ != null; + } + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return The safetyAttributes. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + getSafetyAttributes() { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributesOrBuilder + getSafetyAttributesOrBuilder() { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(summaryText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, summaryText_); + } + if (getSummarySkippedReasonsList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(summarySkippedReasonsMemoizedSerializedSize); + } + for (int i = 0; i < summarySkippedReasons_.size(); i++) { + output.writeEnumNoTag(summarySkippedReasons_.get(i)); + } + if (safetyAttributes_ != null) { + output.writeMessage(3, getSafetyAttributes()); + } + 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(summaryText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, summaryText_); + } + { + int dataSize = 0; + for (int i = 0; i < summarySkippedReasons_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + summarySkippedReasons_.get(i)); + } + size += dataSize; + if (!getSummarySkippedReasonsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + summarySkippedReasonsMemoizedSerializedSize = dataSize; + } + if (safetyAttributes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSafetyAttributes()); + } + 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.discoveryengine.v1beta.SearchResponse.Summary)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary other = + (com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary) obj; + + if (!getSummaryText().equals(other.getSummaryText())) return false; + if (!summarySkippedReasons_.equals(other.summarySkippedReasons_)) return false; + if (hasSafetyAttributes() != other.hasSafetyAttributes()) return false; + if (hasSafetyAttributes()) { + if (!getSafetyAttributes().equals(other.getSafetyAttributes())) 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) + SUMMARY_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getSummaryText().hashCode(); + if (getSummarySkippedReasonsCount() > 0) { + hash = (37 * hash) + SUMMARY_SKIPPED_REASONS_FIELD_NUMBER; + hash = (53 * hash) + summarySkippedReasons_.hashCode(); + } + if (hasSafetyAttributes()) { + hash = (37 * hash) + SAFETY_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getSafetyAttributes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary 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.discoveryengine.v1beta.SearchResponse.Summary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary 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.discoveryengine.v1beta.SearchResponse.Summary parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary 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.discoveryengine.v1beta.SearchResponse.Summary parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary 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.discoveryengine.v1beta.SearchResponse.Summary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary 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.discoveryengine.v1beta.SearchResponse.Summary 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; + } + /** + * + * + *
+     * Summary of the top N search result specified by the summary spec.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchResponse.Summary} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchResponse.Summary) + com.google.cloud.discoveryengine.v1beta.SearchResponse.SummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.class, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + summaryText_ = ""; + summarySkippedReasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + safetyAttributes_ = null; + if (safetyAttributesBuilder_ != null) { + safetyAttributesBuilder_.dispose(); + safetyAttributesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary build() { + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary buildPartial() { + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary result = + new com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary result) { + if (((bitField0_ & 0x00000002) != 0)) { + summarySkippedReasons_ = java.util.Collections.unmodifiableList(summarySkippedReasons_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.summarySkippedReasons_ = summarySkippedReasons_; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.summaryText_ = summaryText_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.safetyAttributes_ = + safetyAttributesBuilder_ == null + ? safetyAttributes_ + : safetyAttributesBuilder_.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.discoveryengine.v1beta.SearchResponse.Summary) { + return mergeFrom((com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary other) { + if (other + == com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.getDefaultInstance()) + return this; + if (!other.getSummaryText().isEmpty()) { + summaryText_ = other.summaryText_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.summarySkippedReasons_.isEmpty()) { + if (summarySkippedReasons_.isEmpty()) { + summarySkippedReasons_ = other.summarySkippedReasons_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.addAll(other.summarySkippedReasons_); + } + onChanged(); + } + if (other.hasSafetyAttributes()) { + mergeSafetyAttributes(other.getSafetyAttributes()); + } + 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: + { + summaryText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + int tmpRaw = input.readEnum(); + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 18 + case 26: + { + input.readMessage( + getSafetyAttributesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object summaryText_ = ""; + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @return The summaryText. + */ + public java.lang.String getSummaryText() { + java.lang.Object ref = summaryText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + summaryText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @return The bytes for summaryText. + */ + public com.google.protobuf.ByteString getSummaryTextBytes() { + java.lang.Object ref = summaryText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + summaryText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @param value The summaryText to set. + * @return This builder for chaining. + */ + public Builder setSummaryText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + summaryText_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @return This builder for chaining. + */ + public Builder clearSummaryText() { + summaryText_ = getDefaultInstance().getSummaryText(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @param value The bytes for summaryText to set. + * @return This builder for chaining. + */ + public Builder setSummaryTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + summaryText_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List summarySkippedReasons_ = + java.util.Collections.emptyList(); + + private void ensureSummarySkippedReasonsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + summarySkippedReasons_ = + new java.util.ArrayList(summarySkippedReasons_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the summarySkippedReasons. + */ + public java.util.List< + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason> + getSummarySkippedReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason>( + summarySkippedReasons_, summarySkippedReasons_converter_); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return The count of summarySkippedReasons. + */ + public int getSummarySkippedReasonsCount() { + return summarySkippedReasons_.size(); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the element to return. + * @return The summarySkippedReasons at the given index. + */ + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason + getSummarySkippedReasons(int index) { + return summarySkippedReasons_converter_.convert(summarySkippedReasons_.get(index)); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index to set the value at. + * @param value The summarySkippedReasons to set. + * @return This builder for chaining. + */ + public Builder setSummarySkippedReasons( + int index, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason + value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param value The summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addSummarySkippedReasons( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason + value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param values The summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addAllSummarySkippedReasons( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .SummarySkippedReason> + values) { + ensureSummarySkippedReasonsIsMutable(); + for (com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason + value : values) { + summarySkippedReasons_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearSummarySkippedReasons() { + summarySkippedReasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the enum numeric values on the wire for summarySkippedReasons. + */ + public java.util.List getSummarySkippedReasonsValueList() { + return java.util.Collections.unmodifiableList(summarySkippedReasons_); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of summarySkippedReasons at the given index. + */ + public int getSummarySkippedReasonsValue(int index) { + return summarySkippedReasons_.get(index); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for summarySkippedReasons to set. + * @return This builder for chaining. + */ + public Builder setSummarySkippedReasonsValue(int index, int value) { + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param value The enum numeric value on the wire for summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addSummarySkippedReasonsValue(int value) { + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param values The enum numeric values on the wire for summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addAllSummarySkippedReasonsValue( + java.lang.Iterable values) { + ensureSummarySkippedReasonsIsMutable(); + for (int value : values) { + summarySkippedReasons_.add(value); + } + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + safetyAttributes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .Builder, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .SafetyAttributesOrBuilder> + safetyAttributesBuilder_; + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return Whether the safetyAttributes field is set. + */ + public boolean hasSafetyAttributes() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return The safetyAttributes. + */ + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + getSafetyAttributes() { + if (safetyAttributesBuilder_ == null) { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } else { + return safetyAttributesBuilder_.getMessage(); + } + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder setSafetyAttributes( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes value) { + if (safetyAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + safetyAttributes_ = value; + } else { + safetyAttributesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder setSafetyAttributes( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes.Builder + builderForValue) { + if (safetyAttributesBuilder_ == null) { + safetyAttributes_ = builderForValue.build(); + } else { + safetyAttributesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder mergeSafetyAttributes( + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes value) { + if (safetyAttributesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && safetyAttributes_ != null + && safetyAttributes_ + != com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance()) { + getSafetyAttributesBuilder().mergeFrom(value); + } else { + safetyAttributes_ = value; + } + } else { + safetyAttributesBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder clearSafetyAttributes() { + bitField0_ = (bitField0_ & ~0x00000004); + safetyAttributes_ = null; + if (safetyAttributesBuilder_ != null) { + safetyAttributesBuilder_.dispose(); + safetyAttributesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes.Builder + getSafetyAttributesBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSafetyAttributesFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .SafetyAttributesOrBuilder + getSafetyAttributesOrBuilder() { + if (safetyAttributesBuilder_ != null) { + return safetyAttributesBuilder_.getMessageOrBuilder(); + } else { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .Builder, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .SafetyAttributesOrBuilder> + getSafetyAttributesFieldBuilder() { + if (safetyAttributesBuilder_ == null) { + safetyAttributesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SafetyAttributes + .Builder, + com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + .SafetyAttributesOrBuilder>( + getSafetyAttributes(), getParentForChildren(), isClean()); + safetyAttributes_ = null; + } + return safetyAttributesBuilder_; + } + + @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.discoveryengine.v1beta.SearchResponse.Summary) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchResponse.Summary) + private static final com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary(); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Summary 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.discoveryengine.v1beta.SearchResponse.Summary + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Bool describing whether query expansion has occurred.
+     * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + boolean getExpandedQuery(); + + /** + * + * + *
+     * Number of pinned results. This field will only be set when expansion
+     * happens and
+     * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+     * is set to true.
+     * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + long getPinnedResultCount(); + } + /** + * + * + *
+   * Information describing query expansion including whether expansion has
+   * occurred.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo} + */ + public static final class QueryExpansionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo) + QueryExpansionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryExpansionInfo.newBuilder() to construct. + private QueryExpansionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryExpansionInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryExpansionInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo.Builder + .class); + } + + public static final int EXPANDED_QUERY_FIELD_NUMBER = 1; + private boolean expandedQuery_ = false; + /** + * + * + *
+     * Bool describing whether query expansion has occurred.
+     * 
+ * + * bool expanded_query = 1; + * + * @return The expandedQuery. + */ + @java.lang.Override + public boolean getExpandedQuery() { + return expandedQuery_; + } + + public static final int PINNED_RESULT_COUNT_FIELD_NUMBER = 2; + private long pinnedResultCount_ = 0L; + /** + * + * + *
+     * Number of pinned results. This field will only be set when expansion
+     * happens and
+     * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+     * is set to true.
+     * 
+ * + * int64 pinned_result_count = 2; + * + * @return The pinnedResultCount. + */ + @java.lang.Override + public long getPinnedResultCount() { + return pinnedResultCount_; + } + + 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 (expandedQuery_ != false) { + output.writeBool(1, expandedQuery_); + } + if (pinnedResultCount_ != 0L) { + output.writeInt64(2, pinnedResultCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (expandedQuery_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, expandedQuery_); + } + if (pinnedResultCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, pinnedResultCount_); + } + 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.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo other = + (com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo) obj; + + if (getExpandedQuery() != other.getExpandedQuery()) return false; + if (getPinnedResultCount() != other.getPinnedResultCount()) 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) + EXPANDED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExpandedQuery()); + hash = (37 * hash) + PINNED_RESULT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPinnedResultCount()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + 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.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + 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.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + 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.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + 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.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + 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.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo 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; + } + /** + * + * + *
+     * Information describing query expansion including whether expansion has
+     * occurred.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo) + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_QueryExpansionInfo_descriptor; } @java.lang.Override - public final boolean isInitialized() { - return true; + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); } @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: - { - summaryText_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - int tmpRaw = input.readEnum(); - ensureSummarySkippedReasonsIsMutable(); - summarySkippedReasons_.add(tmpRaw); - break; - } // case 16 - case 18: - { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while (input.getBytesUntilLimit() > 0) { - int tmpRaw = input.readEnum(); - ensureSummarySkippedReasonsIsMutable(); - summarySkippedReasons_.add(tmpRaw); - } - input.popLimit(oldLimit); - 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 + public Builder clear() { + super.clear(); + bitField0_ = 0; + expandedQuery_ = false; + pinnedResultCount_ = 0L; return this; } - private int bitField0_; - - private java.lang.Object summaryText_ = ""; - /** - * - * - *
-       * The summary content.
-       * 
- * - * string summary_text = 1; - * - * @return The summaryText. - */ - public java.lang.String getSummaryText() { - java.lang.Object ref = summaryText_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - summaryText_ = s; - return s; - } else { - return (java.lang.String) ref; - } + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1beta.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_QueryExpansionInfo_descriptor; } - /** - * - * - *
-       * The summary content.
-       * 
- * - * string summary_text = 1; - * - * @return The bytes for summaryText. - */ - public com.google.protobuf.ByteString getSummaryTextBytes() { - java.lang.Object ref = summaryText_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - summaryText_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + .getDefaultInstance(); } - /** - * - * - *
-       * The summary content.
-       * 
- * - * string summary_text = 1; - * - * @param value The summaryText to set. - * @return This builder for chaining. - */ - public Builder setSummaryText(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo build() { + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } - summaryText_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * The summary content.
-       * 
- * - * string summary_text = 1; - * - * @return This builder for chaining. - */ - public Builder clearSummaryText() { - summaryText_ = getDefaultInstance().getSummaryText(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; + return result; } - /** - * - * - *
-       * The summary content.
-       * 
- * - * string summary_text = 1; - * - * @param value The bytes for summaryText to set. - * @return This builder for chaining. - */ - public Builder setSummaryTextBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - summaryText_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; + + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + buildPartial() { + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo result = + new com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; } - private java.util.List summarySkippedReasons_ = - java.util.Collections.emptyList(); - - private void ensureSummarySkippedReasonsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - summarySkippedReasons_ = - new java.util.ArrayList(summarySkippedReasons_); - bitField0_ |= 0x00000002; + private void buildPartial0( + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.expandedQuery_ = expandedQuery_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pinnedResultCount_ = pinnedResultCount_; } } - /** - * - * - *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
-       * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @return A list containing the summarySkippedReasons. - */ - public java.util.List< - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason> - getSummarySkippedReasonsList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason>( - summarySkippedReasons_, summarySkippedReasons_converter_); + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - * - * - *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
-       * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @return The count of summarySkippedReasons. - */ - public int getSummarySkippedReasonsCount() { - return summarySkippedReasons_.size(); + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); } - /** - * - * - *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
-       * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @param index The index of the element to return. - * @return The summarySkippedReasons at the given index. - */ - public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason - getSummarySkippedReasons(int index) { - return summarySkippedReasons_converter_.convert(summarySkippedReasons_.get(index)); + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - /** - * - * - *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
-       * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @param index The index to set the value at. - * @param value The summarySkippedReasons to set. - * @return This builder for chaining. - */ - public Builder setSummarySkippedReasons( + + @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, - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason - value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSummarySkippedReasonsIsMutable(); - summarySkippedReasons_.set(index, value.getNumber()); - onChanged(); - return this; + java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - /** - * - * - *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
-       * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @param value The summarySkippedReasons to add. - * @return This builder for chaining. - */ - public Builder addSummarySkippedReasons( - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason - value) { - if (value == null) { - throw new NullPointerException(); + + @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.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo) other); + } else { + super.mergeFrom(other); + return this; } - ensureSummarySkippedReasonsIsMutable(); - summarySkippedReasons_.add(value.getNumber()); - onChanged(); - return this; } - /** - * - * - *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
-       * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @param values The summarySkippedReasons to add. - * @return This builder for chaining. - */ - public Builder addAllSummarySkippedReasons( - java.lang.Iterable< - ? extends - com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary - .SummarySkippedReason> - values) { - ensureSummarySkippedReasonsIsMutable(); - for (com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason - value : values) { - summarySkippedReasons_.add(value.getNumber()); + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo other) { + if (other + == com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + .getDefaultInstance()) return this; + if (other.getExpandedQuery() != false) { + setExpandedQuery(other.getExpandedQuery()); } + if (other.getPinnedResultCount() != 0L) { + setPinnedResultCount(other.getPinnedResultCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } - /** - * - * - *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
-       * 
- * - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * - * - * @return This builder for chaining. - */ - public Builder clearSummarySkippedReasons() { - summarySkippedReasons_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); + + @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: + { + expandedQuery_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + pinnedResultCount_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally return this; } + + private int bitField0_; + + private boolean expandedQuery_; /** * * *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
+       * Bool describing whether query expansion has occurred.
        * 
* - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * + * bool expanded_query = 1; * - * @return A list containing the enum numeric values on the wire for summarySkippedReasons. + * @return The expandedQuery. */ - public java.util.List getSummarySkippedReasonsValueList() { - return java.util.Collections.unmodifiableList(summarySkippedReasons_); + @java.lang.Override + public boolean getExpandedQuery() { + return expandedQuery_; } /** * * *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
+       * Bool describing whether query expansion has occurred.
        * 
* - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * + * bool expanded_query = 1; * - * @param index The index of the value to return. - * @return The enum numeric value on the wire of summarySkippedReasons at the given index. + * @param value The expandedQuery to set. + * @return This builder for chaining. */ - public int getSummarySkippedReasonsValue(int index) { - return summarySkippedReasons_.get(index); + public Builder setExpandedQuery(boolean value) { + + expandedQuery_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; } /** * * *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
+       * Bool describing whether query expansion has occurred.
        * 
* - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * + * bool expanded_query = 1; * - * @param index The index to set the value at. - * @param value The enum numeric value on the wire for summarySkippedReasons to set. * @return This builder for chaining. */ - public Builder setSummarySkippedReasonsValue(int index, int value) { - ensureSummarySkippedReasonsIsMutable(); - summarySkippedReasons_.set(index, value); + public Builder clearExpandedQuery() { + bitField0_ = (bitField0_ & ~0x00000001); + expandedQuery_ = false; onChanged(); return this; } + + private long pinnedResultCount_; /** * * *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
        * 
* - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * + * int64 pinned_result_count = 2; * - * @param value The enum numeric value on the wire for summarySkippedReasons to add. + * @return The pinnedResultCount. + */ + @java.lang.Override + public long getPinnedResultCount() { + return pinnedResultCount_; + } + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @param value The pinnedResultCount to set. * @return This builder for chaining. */ - public Builder addSummarySkippedReasonsValue(int value) { - ensureSummarySkippedReasonsIsMutable(); - summarySkippedReasons_.add(value); + public Builder setPinnedResultCount(long value) { + + pinnedResultCount_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -7456,23 +10128,19 @@ public Builder addSummarySkippedReasonsValue(int value) { * * *
-       * Additional summary-skipped reasons. This provides the reason for ignored
-       * cases. If nothing is skipped, this field is not set.
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
        * 
* - * - * repeated .google.cloud.discoveryengine.v1beta.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; - * + * int64 pinned_result_count = 2; * - * @param values The enum numeric values on the wire for summarySkippedReasons to add. * @return This builder for chaining. */ - public Builder addAllSummarySkippedReasonsValue( - java.lang.Iterable values) { - ensureSummarySkippedReasonsIsMutable(); - for (int value : values) { - summarySkippedReasons_.add(value); - } + public Builder clearPinnedResultCount() { + bitField0_ = (bitField0_ & ~0x00000002); + pinnedResultCount_ = 0L; onChanged(); return this; } @@ -7489,26 +10157,27 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1beta.SearchResponse.Summary) + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo) } - // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchResponse.Summary) - private static final com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo) + private static final com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary(); + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo(); } - public static com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + public static com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public Summary parsePartialFrom( + public QueryExpansionInfo parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7528,17 +10197,17 @@ public Summary parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.discoveryengine.v1beta.SearchResponse.Summary + public com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -8136,6 +10805,67 @@ public com.google.protobuf.ByteString getAppliedControlsBytes(int index) { return appliedControls_.getByteString(index); } + public static final int QUERY_EXPANSION_INFO_FIELD_NUMBER = 14; + private com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + queryExpansionInfo_; + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + @java.lang.Override + public boolean hasQueryExpansionInfo() { + return queryExpansionInfo_ != null; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return The queryExpansionInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + getQueryExpansionInfo() { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + .getDefaultInstance() + : queryExpansionInfo_; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + .getDefaultInstance() + : queryExpansionInfo_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -8180,6 +10910,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 12, redirectUri_); } + if (queryExpansionInfo_ != null) { + output.writeMessage(14, getQueryExpansionInfo()); + } getUnknownFields().writeTo(output); } @@ -8224,6 +10957,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, redirectUri_); } + if (queryExpansionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getQueryExpansionInfo()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -8256,6 +10992,10 @@ public boolean equals(final java.lang.Object obj) { if (!getSummary().equals(other.getSummary())) return false; } if (!getAppliedControlsList().equals(other.getAppliedControlsList())) return false; + if (hasQueryExpansionInfo() != other.hasQueryExpansionInfo()) return false; + if (hasQueryExpansionInfo()) { + if (!getQueryExpansionInfo().equals(other.getQueryExpansionInfo())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -8297,6 +11037,10 @@ public int hashCode() { hash = (37 * hash) + APPLIED_CONTROLS_FIELD_NUMBER; hash = (53 * hash) + getAppliedControlsList().hashCode(); } + if (hasQueryExpansionInfo()) { + hash = (37 * hash) + QUERY_EXPANSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionInfo().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -8469,6 +11213,11 @@ public Builder clear() { summaryBuilder_ = null; } appliedControls_ = com.google.protobuf.LazyStringArrayList.emptyList(); + queryExpansionInfo_ = null; + if (queryExpansionInfoBuilder_ != null) { + queryExpansionInfoBuilder_.dispose(); + queryExpansionInfoBuilder_ = null; + } return this; } @@ -8556,6 +11305,12 @@ private void buildPartial0(com.google.cloud.discoveryengine.v1beta.SearchRespons appliedControls_.makeImmutable(); result.appliedControls_ = appliedControls_; } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.queryExpansionInfo_ = + queryExpansionInfoBuilder_ == null + ? queryExpansionInfo_ + : queryExpansionInfoBuilder_.build(); + } } @java.lang.Override @@ -8697,6 +11452,9 @@ public Builder mergeFrom(com.google.cloud.discoveryengine.v1beta.SearchResponse } onChanged(); } + if (other.hasQueryExpansionInfo()) { + mergeQueryExpansionInfo(other.getQueryExpansionInfo()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -8802,6 +11560,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000020; break; } // case 98 + case 114: + { + input.readMessage( + getQueryExpansionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 114 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -10740,6 +13505,219 @@ public Builder addAppliedControlsBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + queryExpansionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo, + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfoOrBuilder> + queryExpansionInfoBuilder_; + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + public boolean hasQueryExpansionInfo() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return The queryExpansionInfo. + */ + public com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + getQueryExpansionInfo() { + if (queryExpansionInfoBuilder_ == null) { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + .getDefaultInstance() + : queryExpansionInfo_; + } else { + return queryExpansionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryExpansionInfo_ = value; + } else { + queryExpansionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo.Builder + builderForValue) { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = builderForValue.build(); + } else { + queryExpansionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder mergeQueryExpansionInfo( + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && queryExpansionInfo_ != null + && queryExpansionInfo_ + != com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + .getDefaultInstance()) { + getQueryExpansionInfoBuilder().mergeFrom(value); + } else { + queryExpansionInfo_ = value; + } + } else { + queryExpansionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder clearQueryExpansionInfo() { + bitField0_ = (bitField0_ & ~0x00000400); + queryExpansionInfo_ = null; + if (queryExpansionInfoBuilder_ != null) { + queryExpansionInfoBuilder_.dispose(); + queryExpansionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo.Builder + getQueryExpansionInfoBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getQueryExpansionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + if (queryExpansionInfoBuilder_ != null) { + return queryExpansionInfoBuilder_.getMessageOrBuilder(); + } else { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo + .getDefaultInstance() + : queryExpansionInfo_; + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo, + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfoOrBuilder> + getQueryExpansionInfoFieldBuilder() { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo, + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfoOrBuilder>( + getQueryExpansionInfo(), getParentForChildren(), isClean()); + queryExpansionInfo_ = null; + } + return queryExpansionInfoBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchResponseOrBuilder.java index e432d6498be5..b71dafbc16b6 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchResponseOrBuilder.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchResponseOrBuilder.java @@ -416,4 +416,46 @@ com.google.cloud.discoveryengine.v1beta.SearchResponse.FacetOrBuilder getFacetsO * @return The bytes of the appliedControls at the given index. */ com.google.protobuf.ByteString getAppliedControlsBytes(int index); + + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + boolean hasQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return The queryExpansionInfo. + */ + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo getQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + com.google.cloud.discoveryengine.v1beta.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder(); } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchServiceProto.java index 9f67ec3244da..59d292b75509 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchServiceProto.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/SearchServiceProto.java @@ -75,6 +75,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_EmbeddingVector_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ParamsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -91,6 +99,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_ModelScoresEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_ModelScoresEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Facet_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -111,6 +123,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_SafetyAttributes_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_QueryExpansionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_QueryExpansionInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -128,7 +148,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "urce.proto\0320google/cloud/discoveryengine" + "/v1beta/common.proto\0322google/cloud/disco" + "veryengine/v1beta/document.proto\032\034google" - + "/protobuf/struct.proto\"\322\026\n\rSearchRequest" + + "/protobuf/struct.proto\"\231\032\n\rSearchRequest" + "\022M\n\016serving_config\030\001 \001(\tB5\342A\001\002\372A.\n,disco" + "veryengine.googleapis.com/ServingConfig\022" + ":\n\006branch\030\002 \001(\tB*\372A\'\n%discoveryengine.go" @@ -153,108 +173,134 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ec\022\026\n\016user_pseudo_id\030\017 \001(\t\022a\n\023content_se" + "arch_spec\030\030 \001(\0132D.google.cloud.discovery" + "engine.v1beta.SearchRequest.ContentSearc" - + "hSpec\022\023\n\013safe_search\030\024 \001(\010\022W\n\013user_label" - + "s\030\026 \003(\0132B.google.cloud.discoveryengine.v" - + "1beta.SearchRequest.UserLabelsEntry\032,\n\nI" - + "mageQuery\022\025\n\013image_bytes\030\001 \001(\tH\000B\007\n\005imag" - + "e\032\206\003\n\tFacetSpec\022^\n\tfacet_key\030\001 \001(\0132E.goo" - + "gle.cloud.discoveryengine.v1beta.SearchR" - + "equest.FacetSpec.FacetKeyB\004\342A\001\002\022\r\n\005limit" - + "\030\002 \001(\005\022\034\n\024excluded_filter_keys\030\003 \003(\t\022\037\n\027" - + "enable_dynamic_position\030\004 \001(\010\032\312\001\n\010FacetK" - + "ey\022\021\n\003key\030\001 \001(\tB\004\342A\001\002\022@\n\tintervals\030\002 \003(\013" - + "2-.google.cloud.discoveryengine.v1beta.I" - + "nterval\022\031\n\021restricted_values\030\003 \003(\t\022\020\n\010pr" - + "efixes\030\004 \003(\t\022\020\n\010contains\030\005 \003(\t\022\030\n\020case_i" - + "nsensitive\030\006 \001(\010\022\020\n\010order_by\030\007 \001(\t\032\263\001\n\tB" - + "oostSpec\022n\n\025condition_boost_specs\030\001 \003(\0132" - + "O.google.cloud.discoveryengine.v1beta.Se" - + "archRequest.BoostSpec.ConditionBoostSpec" - + "\0326\n\022ConditionBoostSpec\022\021\n\tcondition\030\001 \001(" - + "\t\022\r\n\005boost\030\002 \001(\002\032\270\001\n\022QueryExpansionSpec\022" - + "b\n\tcondition\030\001 \001(\0162O.google.cloud.discov" - + "eryengine.v1beta.SearchRequest.QueryExpa" - + "nsionSpec.Condition\">\n\tCondition\022\031\n\025COND" - + "ITION_UNSPECIFIED\020\000\022\014\n\010DISABLED\020\001\022\010\n\004AUT" - + "O\020\002\032\255\001\n\023SpellCorrectionSpec\022Y\n\004mode\030\001 \001(" - + "\0162K.google.cloud.discoveryengine.v1beta." - + "SearchRequest.SpellCorrectionSpec.Mode\";" - + "\n\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\023\n\017SUGGESTI" - + "ON_ONLY\020\001\022\010\n\004AUTO\020\002\032\273\005\n\021ContentSearchSpe" - + "c\022f\n\014snippet_spec\030\001 \001(\0132P.google.cloud.d" - + "iscoveryengine.v1beta.SearchRequest.Cont" - + "entSearchSpec.SnippetSpec\022f\n\014summary_spe" - + "c\030\002 \001(\0132P.google.cloud.discoveryengine.v" - + "1beta.SearchRequest.ContentSearchSpec.Su" - + "mmarySpec\022{\n\027extractive_content_spec\030\003 \001" - + "(\0132Z.google.cloud.discoveryengine.v1beta" - + ".SearchRequest.ContentSearchSpec.Extract" - + "iveContentSpec\032`\n\013SnippetSpec\022\035\n\021max_sni" - + "ppet_count\030\001 \001(\005B\002\030\001\022\032\n\016reference_only\030\002" - + " \001(\010B\002\030\001\022\026\n\016return_snippet\030\003 \001(\010\032\222\001\n\013Sum" - + "marySpec\022\034\n\024summary_result_count\030\001 \001(\005\022\031" - + "\n\021include_citations\030\002 \001(\010\022 \n\030ignore_adve" - + "rsarial_query\030\003 \001(\010\022(\n ignore_non_summar" - + "y_seeking_query\030\004 \001(\010\032b\n\025ExtractiveConte" - + "ntSpec\022#\n\033max_extractive_answer_count\030\001 " - + "\001(\005\022$\n\034max_extractive_segment_count\030\002 \001(" - + "\005\032E\n\013ParamsEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002" - + " \001(\0132\026.google.protobuf.Value:\0028\001\0321\n\017User" - + "LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" - + "\0028\001\"\207\013\n\016SearchResponse\022Q\n\007results\030\001 \003(\0132" - + "@.google.cloud.discoveryengine.v1beta.Se" - + "archResponse.SearchResult\022I\n\006facets\030\002 \003(" - + "\01329.google.cloud.discoveryengine.v1beta." - + "SearchResponse.Facet\022d\n\024guided_search_re" - + "sult\030\010 \001(\0132F.google.cloud.discoveryengin" - + "e.v1beta.SearchResponse.GuidedSearchResu" - + "lt\022\022\n\ntotal_size\030\003 \001(\005\022\031\n\021attribution_to" - + "ken\030\004 \001(\t\022\024\n\014redirect_uri\030\014 \001(\t\022\027\n\017next_" - + "page_token\030\005 \001(\t\022\027\n\017corrected_query\030\007 \001(" - + "\t\022L\n\007summary\030\t \001(\0132;.google.cloud.discov" - + "eryengine.v1beta.SearchResponse.Summary\022" - + "\030\n\020applied_controls\030\n \003(\t\032[\n\014SearchResul" - + "t\022\n\n\002id\030\001 \001(\t\022?\n\010document\030\002 \001(\0132-.google" - + ".cloud.discoveryengine.v1beta.Document\032\201" - + "\002\n\005Facet\022\013\n\003key\030\001 \001(\t\022T\n\006values\030\002 \003(\0132D." + + "hSpec\022X\n\016embedding_spec\030\027 \001(\0132@.google.c" + + "loud.discoveryengine.v1beta.SearchReques" + + "t.EmbeddingSpec\022\032\n\022ranking_expression\030\032 " + + "\001(\t\022\023\n\013safe_search\030\024 \001(\010\022W\n\013user_labels\030" + + "\026 \003(\0132B.google.cloud.discoveryengine.v1b" + + "eta.SearchRequest.UserLabelsEntry\032,\n\nIma" + + "geQuery\022\025\n\013image_bytes\030\001 \001(\tH\000B\007\n\005image\032" + + "\206\003\n\tFacetSpec\022^\n\tfacet_key\030\001 \001(\0132E.googl" + + "e.cloud.discoveryengine.v1beta.SearchReq" + + "uest.FacetSpec.FacetKeyB\004\342A\001\002\022\r\n\005limit\030\002" + + " \001(\005\022\034\n\024excluded_filter_keys\030\003 \003(\t\022\037\n\027en" + + "able_dynamic_position\030\004 \001(\010\032\312\001\n\010FacetKey" + + "\022\021\n\003key\030\001 \001(\tB\004\342A\001\002\022@\n\tintervals\030\002 \003(\0132-" + + ".google.cloud.discoveryengine.v1beta.Int" + + "erval\022\031\n\021restricted_values\030\003 \003(\t\022\020\n\010pref" + + "ixes\030\004 \003(\t\022\020\n\010contains\030\005 \003(\t\022\030\n\020case_ins" + + "ensitive\030\006 \001(\010\022\020\n\010order_by\030\007 \001(\t\032\263\001\n\tBoo" + + "stSpec\022n\n\025condition_boost_specs\030\001 \003(\0132O." + + "google.cloud.discoveryengine.v1beta.Sear" + + "chRequest.BoostSpec.ConditionBoostSpec\0326" + + "\n\022ConditionBoostSpec\022\021\n\tcondition\030\001 \001(\t\022" + + "\r\n\005boost\030\002 \001(\002\032\330\001\n\022QueryExpansionSpec\022b\n" + + "\tcondition\030\001 \001(\0162O.google.cloud.discover" + + "yengine.v1beta.SearchRequest.QueryExpans" + + "ionSpec.Condition\022\036\n\026pin_unexpanded_resu" + + "lts\030\002 \001(\010\">\n\tCondition\022\031\n\025CONDITION_UNSP" + + "ECIFIED\020\000\022\014\n\010DISABLED\020\001\022\010\n\004AUTO\020\002\032\255\001\n\023Sp" + + "ellCorrectionSpec\022Y\n\004mode\030\001 \001(\0162K.google" + + ".cloud.discoveryengine.v1beta.SearchRequ" + + "est.SpellCorrectionSpec.Mode\";\n\004Mode\022\024\n\020" + + "MODE_UNSPECIFIED\020\000\022\023\n\017SUGGESTION_ONLY\020\001\022" + + "\010\n\004AUTO\020\002\032\266\006\n\021ContentSearchSpec\022f\n\014snipp" + + "et_spec\030\001 \001(\0132P.google.cloud.discoveryen" + + "gine.v1beta.SearchRequest.ContentSearchS" + + "pec.SnippetSpec\022f\n\014summary_spec\030\002 \001(\0132P." + "google.cloud.discoveryengine.v1beta.Sear" - + "chResponse.Facet.FacetValue\022\025\n\rdynamic_f" - + "acet\030\003 \001(\010\032~\n\nFacetValue\022\017\n\005value\030\001 \001(\tH" - + "\000\022A\n\010interval\030\002 \001(\0132-.google.cloud.disco" - + "veryengine.v1beta.IntervalH\000\022\r\n\005count\030\003 " - + "\001(\003B\r\n\013facet_value\032\363\001\n\022GuidedSearchResul" - + "t\022y\n\025refinement_attributes\030\001 \003(\0132Z.googl" - + "e.cloud.discoveryengine.v1beta.SearchRes" - + "ponse.GuidedSearchResult.RefinementAttri" - + "bute\022\033\n\023follow_up_questions\030\002 \003(\t\032E\n\023Ref" - + "inementAttribute\022\025\n\rattribute_key\030\001 \001(\t\022" - + "\027\n\017attribute_value\030\002 \001(\t\032\272\002\n\007Summary\022\024\n\014" - + "summary_text\030\001 \001(\t\022q\n\027summary_skipped_re" - + "asons\030\002 \003(\0162P.google.cloud.discoveryengi" - + "ne.v1beta.SearchResponse.Summary.Summary" - + "SkippedReason\"\245\001\n\024SummarySkippedReason\022&" - + "\n\"SUMMARY_SKIPPED_REASON_UNSPECIFIED\020\000\022\035" - + "\n\031ADVERSARIAL_QUERY_IGNORED\020\001\022%\n!NON_SUM" - + "MARY_SEEKING_QUERY_IGNORED\020\002\022\037\n\033OUT_OF_D" - + "OMAIN_QUERY_IGNORED\020\0032\243\003\n\rSearchService\022" - + "\275\002\n\006Search\0222.google.cloud.discoveryengin" - + "e.v1beta.SearchRequest\0323.google.cloud.di" - + "scoveryengine.v1beta.SearchResponse\"\311\001\202\323" - + "\344\223\002\302\001\"T/v1beta/{serving_config=projects/" - + "*/locations/*/dataStores/*/servingConfig" - + "s/*}:search:\001*Zg\"b/v1beta/{serving_confi" - + "g=projects/*/locations/*/collections/*/d" - + "ataStores/*/servingConfigs/*}:search:\001*\032" - + "R\312A\036discoveryengine.googleapis.com\322A.htt" - + "ps://www.googleapis.com/auth/cloud-platf" - + "ormB\231\002\n\'com.google.cloud.discoveryengine" - + ".v1betaB\022SearchServiceProtoP\001ZQcloud.goo" - + "gle.com/go/discoveryengine/apiv1beta/dis" - + "coveryenginepb;discoveryenginepb\242\002\017DISCO" - + "VERYENGINE\252\002#Google.Cloud.DiscoveryEngin" - + "e.V1Beta\312\002#Google\\Cloud\\DiscoveryEngine\\" - + "V1beta\352\002&Google::Cloud::DiscoveryEngine:" - + ":V1betab\006proto3" + + "chRequest.ContentSearchSpec.SummarySpec\022" + + "{\n\027extractive_content_spec\030\003 \001(\0132Z.googl" + + "e.cloud.discoveryengine.v1beta.SearchReq" + + "uest.ContentSearchSpec.ExtractiveContent" + + "Spec\032`\n\013SnippetSpec\022\035\n\021max_snippet_count" + + "\030\001 \001(\005B\002\030\001\022\032\n\016reference_only\030\002 \001(\010B\002\030\001\022\026" + + "\n\016return_snippet\030\003 \001(\010\032\251\001\n\013SummarySpec\022\034" + + "\n\024summary_result_count\030\001 \001(\005\022\031\n\021include_" + + "citations\030\002 \001(\010\022 \n\030ignore_adversarial_qu" + + "ery\030\003 \001(\010\022(\n ignore_non_summary_seeking_" + + "query\030\004 \001(\010\022\025\n\rlanguage_code\030\006 \001(\t\032\305\001\n\025E" + + "xtractiveContentSpec\022#\n\033max_extractive_a" + + "nswer_count\030\001 \001(\005\022$\n\034max_extractive_segm" + + "ent_count\030\002 \001(\005\022\'\n\037return_extractive_seg" + + "ment_score\030\003 \001(\010\022\035\n\025num_previous_segment" + + "s\030\004 \001(\005\022\031\n\021num_next_segments\030\005 \001(\005\032\263\001\n\rE" + + "mbeddingSpec\022k\n\021embedding_vectors\030\001 \003(\0132" + + "P.google.cloud.discoveryengine.v1beta.Se" + + "archRequest.EmbeddingSpec.EmbeddingVecto" + + "r\0325\n\017EmbeddingVector\022\022\n\nfield_path\030\001 \001(\t" + + "\022\016\n\006vector\030\002 \003(\002\032E\n\013ParamsEntry\022\013\n\003key\030\001" + + " \001(\t\022%\n\005value\030\002 \001(\0132\026.google.protobuf.Va" + + "lue:\0028\001\0321\n\017UserLabelsEntry\022\013\n\003key\030\001 \001(\t\022" + + "\r\n\005value\030\002 \001(\t:\0028\001\"\343\017\n\016SearchResponse\022Q\n" + + "\007results\030\001 \003(\0132@.google.cloud.discoverye" + + "ngine.v1beta.SearchResponse.SearchResult" + + "\022I\n\006facets\030\002 \003(\01329.google.cloud.discover" + + "yengine.v1beta.SearchResponse.Facet\022d\n\024g" + + "uided_search_result\030\010 \001(\0132F.google.cloud" + + ".discoveryengine.v1beta.SearchResponse.G" + + "uidedSearchResult\022\022\n\ntotal_size\030\003 \001(\005\022\031\n" + + "\021attribution_token\030\004 \001(\t\022\024\n\014redirect_uri" + + "\030\014 \001(\t\022\027\n\017next_page_token\030\005 \001(\t\022\027\n\017corre" + + "cted_query\030\007 \001(\t\022L\n\007summary\030\t \001(\0132;.goog" + + "le.cloud.discoveryengine.v1beta.SearchRe" + + "sponse.Summary\022\030\n\020applied_controls\030\n \003(\t" + + "\022d\n\024query_expansion_info\030\016 \001(\0132F.google." + + "cloud.discoveryengine.v1beta.SearchRespo" + + "nse.QueryExpansionInfo\032\251\002\n\014SearchResult\022" + + "\n\n\002id\030\001 \001(\t\022?\n\010document\030\002 \001(\0132-.google.c" + + "loud.discoveryengine.v1beta.Document\022g\n\014" + + "model_scores\030\004 \003(\0132Q.google.cloud.discov" + + "eryengine.v1beta.SearchResponse.SearchRe" + + "sult.ModelScoresEntry\032c\n\020ModelScoresEntr" + + "y\022\013\n\003key\030\001 \001(\t\022>\n\005value\030\002 \001(\0132/.google.c" + + "loud.discoveryengine.v1beta.DoubleList:\002" + + "8\001\032\201\002\n\005Facet\022\013\n\003key\030\001 \001(\t\022T\n\006values\030\002 \003(" + + "\0132D.google.cloud.discoveryengine.v1beta." + + "SearchResponse.Facet.FacetValue\022\025\n\rdynam" + + "ic_facet\030\003 \001(\010\032~\n\nFacetValue\022\017\n\005value\030\001 " + + "\001(\tH\000\022A\n\010interval\030\002 \001(\0132-.google.cloud.d" + + "iscoveryengine.v1beta.IntervalH\000\022\r\n\005coun" + + "t\030\003 \001(\003B\r\n\013facet_value\032\363\001\n\022GuidedSearchR" + + "esult\022y\n\025refinement_attributes\030\001 \003(\0132Z.g" + + "oogle.cloud.discoveryengine.v1beta.Searc" + + "hResponse.GuidedSearchResult.RefinementA" + + "ttribute\022\033\n\023follow_up_questions\030\002 \003(\t\032E\n" + + "\023RefinementAttribute\022\025\n\rattribute_key\030\001 " + + "\001(\t\022\027\n\017attribute_value\030\002 \001(\t\032\226\004\n\007Summary" + + "\022\024\n\014summary_text\030\001 \001(\t\022q\n\027summary_skippe" + + "d_reasons\030\002 \003(\0162P.google.cloud.discovery" + + "engine.v1beta.SearchResponse.Summary.Sum" + + "marySkippedReason\022g\n\021safety_attributes\030\003" + + " \001(\0132L.google.cloud.discoveryengine.v1be" + + "ta.SearchResponse.Summary.SafetyAttribut" + + "es\0326\n\020SafetyAttributes\022\022\n\ncategories\030\001 \003" + + "(\t\022\016\n\006scores\030\002 \003(\002\"\340\001\n\024SummarySkippedRea" + + "son\022&\n\"SUMMARY_SKIPPED_REASON_UNSPECIFIE" + + "D\020\000\022\035\n\031ADVERSARIAL_QUERY_IGNORED\020\001\022%\n!NO" + + "N_SUMMARY_SEEKING_QUERY_IGNORED\020\002\022\037\n\033OUT" + + "_OF_DOMAIN_QUERY_IGNORED\020\003\022\036\n\032POTENTIAL_" + + "POLICY_VIOLATION\020\004\022\031\n\025LLM_ADDON_NOT_ENAB" + + "LED\020\005\032I\n\022QueryExpansionInfo\022\026\n\016expanded_" + + "query\030\001 \001(\010\022\033\n\023pinned_result_count\030\002 \001(\003" + + "2\243\003\n\rSearchService\022\275\002\n\006Search\0222.google.c" + + "loud.discoveryengine.v1beta.SearchReques" + + "t\0323.google.cloud.discoveryengine.v1beta." + + "SearchResponse\"\311\001\202\323\344\223\002\302\001\"T/v1beta/{servi" + + "ng_config=projects/*/locations/*/dataSto" + + "res/*/servingConfigs/*}:search:\001*Zg\"b/v1" + + "beta/{serving_config=projects/*/location" + + "s/*/collections/*/dataStores/*/servingCo" + + "nfigs/*}:search:\001*\032R\312A\036discoveryengine.g" + + "oogleapis.com\322A.https://www.googleapis.c" + + "om/auth/cloud-platformB\231\002\n\'com.google.cl" + + "oud.discoveryengine.v1betaB\022SearchServic" + + "eProtoP\001ZQcloud.google.com/go/discoverye" + + "ngine/apiv1beta/discoveryenginepb;discov" + + "eryenginepb\242\002\017DISCOVERYENGINE\252\002#Google.C" + + "loud.DiscoveryEngine.V1Beta\312\002#Google\\Clo" + + "ud\\DiscoveryEngine\\V1beta\352\002&Google::Clou" + + "d::DiscoveryEngine::V1betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -291,6 +337,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SpellCorrectionSpec", "UserPseudoId", "ContentSearchSpec", + "EmbeddingSpec", + "RankingExpression", "SafeSearch", "UserLabels", }); @@ -358,7 +406,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_QueryExpansionSpec_descriptor, new java.lang.String[] { - "Condition", + "Condition", "PinUnexpandedResults", }); internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_SpellCorrectionSpec_descriptor = internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_descriptor @@ -402,6 +450,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "IncludeCitations", "IgnoreAdversarialQuery", "IgnoreNonSummarySeekingQuery", + "LanguageCode", }); internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_descriptor = internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_descriptor @@ -411,12 +460,36 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_descriptor, new java.lang.String[] { - "MaxExtractiveAnswerCount", "MaxExtractiveSegmentCount", + "MaxExtractiveAnswerCount", + "MaxExtractiveSegmentCount", + "ReturnExtractiveSegmentScore", + "NumPreviousSegments", + "NumNextSegments", }); - internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ParamsEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_descriptor = internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_descriptor .getNestedTypes() .get(6); + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_descriptor, + new java.lang.String[] { + "EmbeddingVectors", + }); + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor = + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_EmbeddingVector_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor, + new java.lang.String[] { + "FieldPath", "Vector", + }); + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ParamsEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_descriptor + .getNestedTypes() + .get(7); internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ParamsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ParamsEntry_descriptor, @@ -426,7 +499,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_UserLabelsEntry_descriptor = internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_descriptor .getNestedTypes() - .get(7); + .get(8); internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_UserLabelsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_UserLabelsEntry_descriptor, @@ -449,6 +522,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CorrectedQuery", "Summary", "AppliedControls", + "QueryExpansionInfo", }); internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_descriptor = internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_descriptor @@ -458,7 +532,17 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_descriptor, new java.lang.String[] { - "Id", "Document", + "Id", "Document", "ModelScores", + }); + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_ModelScoresEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_ModelScoresEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_SearchResult_ModelScoresEntry_descriptor, + new java.lang.String[] { + "Key", "Value", }); internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Facet_descriptor = internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_descriptor @@ -508,7 +592,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_descriptor, new java.lang.String[] { - "SummaryText", "SummarySkippedReasons", + "SummaryText", "SummarySkippedReasons", "SafetyAttributes", + }); + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_SafetyAttributes_descriptor = + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_Summary_SafetyAttributes_descriptor, + new java.lang.String[] { + "Categories", "Scores", + }); + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_QueryExpansionInfo_descriptor = + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_descriptor + .getNestedTypes() + .get(4); + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_QueryExpansionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1beta_SearchResponse_QueryExpansionInfo_descriptor, + new java.lang.String[] { + "ExpandedQuery", "PinnedResultCount", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/UserEventProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/UserEventProto.java index 85deef72dab0..ef92750aa9ac 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/UserEventProto.java +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/java/com/google/cloud/discoveryengine/v1beta/UserEventProto.java @@ -115,26 +115,26 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "on_id\030\003 \001(\t\022\020\n\003tax\030\004 \001(\002H\001\210\001\001\022\021\n\004cost\030\005 " + "\001(\002H\002\210\001\001\022\033\n\016discount_value\030\006 \001(\002H\003\210\001\001B\010\n" + "\006_valueB\006\n\004_taxB\007\n\005_costB\021\n\017_discount_va" - + "lue\"\254\001\n\014DocumentInfo\022\014\n\002id\030\001 \001(\tH\000\022<\n\004na" + + "lue\"\273\001\n\014DocumentInfo\022\014\n\002id\030\001 \001(\tH\000\022<\n\004na" + "me\030\002 \001(\tB,\372A)\n\'discoveryengine.googleapi" - + "s.com/DocumentH\000\022\025\n\010quantity\030\003 \001(\005H\001\210\001\001\022" - + "\025\n\rpromotion_ids\030\004 \003(\tB\025\n\023document_descr" - + "iptorB\013\n\t_quantity\"\225\001\n\tPanelInfo\022\026\n\010pane" - + "l_id\030\002 \001(\tB\004\342A\001\002\022\024\n\014display_name\030\003 \001(\t\022\033" - + "\n\016panel_position\030\004 \001(\005H\000\210\001\001\022\031\n\014total_pan" - + "els\030\005 \001(\005H\001\210\001\001B\021\n\017_panel_positionB\017\n\r_to" - + "tal_panels\"\215\001\n\tMediaInfo\022:\n\027media_progre" - + "ss_duration\030\001 \001(\0132\031.google.protobuf.Dura" - + "tion\022&\n\031media_progress_percentage\030\002 \001(\002H" - + "\000\210\001\001B\034\n\032_media_progress_percentageB\225\002\n\'c" - + "om.google.cloud.discoveryengine.v1betaB\016" - + "UserEventProtoP\001ZQcloud.google.com/go/di" - + "scoveryengine/apiv1beta/discoveryenginep" - + "b;discoveryenginepb\242\002\017DISCOVERYENGINE\252\002#" - + "Google.Cloud.DiscoveryEngine.V1Beta\312\002#Go" - + "ogle\\Cloud\\DiscoveryEngine\\V1beta\352\002&Goog" - + "le::Cloud::DiscoveryEngine::V1betab\006prot" - + "o3" + + "s.com/DocumentH\000\022\r\n\003uri\030\006 \001(\tH\000\022\025\n\010quant" + + "ity\030\003 \001(\005H\001\210\001\001\022\025\n\rpromotion_ids\030\004 \003(\tB\025\n" + + "\023document_descriptorB\013\n\t_quantity\"\225\001\n\tPa" + + "nelInfo\022\026\n\010panel_id\030\002 \001(\tB\004\342A\001\002\022\024\n\014displ" + + "ay_name\030\003 \001(\t\022\033\n\016panel_position\030\004 \001(\005H\000\210" + + "\001\001\022\031\n\014total_panels\030\005 \001(\005H\001\210\001\001B\021\n\017_panel_" + + "positionB\017\n\r_total_panels\"\215\001\n\tMediaInfo\022" + + ":\n\027media_progress_duration\030\001 \001(\0132\031.googl" + + "e.protobuf.Duration\022&\n\031media_progress_pe" + + "rcentage\030\002 \001(\002H\000\210\001\001B\034\n\032_media_progress_p" + + "ercentageB\225\002\n\'com.google.cloud.discovery" + + "engine.v1betaB\016UserEventProtoP\001ZQcloud.g" + + "oogle.com/go/discoveryengine/apiv1beta/d" + + "iscoveryenginepb;discoveryenginepb\242\002\017DIS" + + "COVERYENGINE\252\002#Google.Cloud.DiscoveryEng" + + "ine.V1Beta\312\002#Google\\Cloud\\DiscoveryEngin" + + "e\\V1beta\352\002&Google::Cloud::DiscoveryEngin" + + "e::V1betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -228,7 +228,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_discoveryengine_v1beta_DocumentInfo_descriptor, new java.lang.String[] { - "Id", "Name", "Quantity", "PromotionIds", "DocumentDescriptor", "Quantity", + "Id", "Name", "Uri", "Quantity", "PromotionIds", "DocumentDescriptor", "Quantity", }); internal_static_google_cloud_discoveryengine_v1beta_PanelInfo_descriptor = getDescriptor().getMessageTypes().get(6); diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/common.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/common.proto index 08e7ce7451c8..e8e266706e51 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/common.proto +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/common.proto @@ -126,3 +126,9 @@ message UserInfo { // is set. string user_agent = 2; } + +// Double list. +message DoubleList { + // Double values. + repeated double values = 1; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/conversation.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/conversation.proto index bd15a6aedc73..a2cf04f65f32 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/conversation.proto +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/conversation.proto @@ -18,6 +18,7 @@ package google.cloud.discoveryengine.v1beta; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1beta/search_service.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta"; @@ -75,6 +76,8 @@ message Conversation { message Reply { // Defines reference in reply. message Reference { + option deprecated = true; + // URI link reference. string uri = 1; @@ -88,11 +91,15 @@ message Reply { int32 end = 4; } + // DEPRECATED: use `summary` instead. // Text reply. - string reply = 1; + string reply = 1 [deprecated = true]; // References in the reply. - repeated Reference references = 2; + repeated Reference references = 2 [deprecated = true]; + + // Summary based on search results. + SearchResponse.Summary summary = 3; } // Defines context of the conversation diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/conversational_search_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/conversational_search_service.proto index 5b7b2e0b8797..3273acd54298 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/conversational_search_service.proto @@ -162,6 +162,28 @@ message ConverseConversationRequest { // Whether to turn on safe search. bool safe_search = 6; + + // The user labels applied to a resource must meet the following requirements: + // + // * Each resource can have multiple labels, up to a maximum of 64. + // * Each label must be a key-value pair. + // * Keys have a minimum length of 1 character and a maximum length of 63 + // characters and cannot be empty. Values can be empty and have a maximum + // length of 63 characters. + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. All characters must use UTF-8 encoding, and + // international characters are allowed. + // * The key portion of a label must be unique. However, you can use the same + // key with multiple resources. + // * Keys must start with a lowercase letter or international character. + // + // See [Google Cloud + // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + map user_labels = 7; + + // A specification for configuring the summary returned in the response. + SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; } // Response message for @@ -174,6 +196,9 @@ message ConverseConversationResponse { // Updated conversation including the answer. Conversation conversation = 2; + // Suggested related questions. + repeated string related_questions = 6; + // Search Results. repeated SearchResponse.SearchResult search_results = 3; } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/search_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/search_service.proto index 84d5c968597f..cf051f70123f 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/search_service.proto +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/search_service.proto @@ -262,6 +262,11 @@ message SearchRequest { // The condition under which query expansion should occur. Default to // [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. Condition condition = 1; + + // Whether to pin unexpanded results. If this field is set to true, + // unexpanded products are always at the top of the search results, followed + // by the expanded results. + bool pin_unexpanded_results = 2; } // The specification for query spell correction. @@ -362,6 +367,10 @@ message SearchRequest { // generating summaries for non-summary seeking queries and return // fallback messages instead. bool ignore_non_summary_seeking_query = 4; + + // Language code for Summary. Use language tags defined by + // [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt]. + string language_code = 6; } // A specification for configuring the extractive content in a search @@ -399,10 +408,21 @@ message SearchRequest { // If the number of matching segments is less than // `max_extractive_segment_count`, return all of the segments. Otherwise, // return the `max_extractive_segment_count`. - // - // Currently one segment is returned for each - // [SearchResult][google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult]. int32 max_extractive_segment_count = 2; + + // Specifies whether to return the confidence score from the extractive + // segments in each search result. The default value is `false`. + bool return_extractive_segment_score = 3; + + // Specifies whether to also include the adjacent from each selected + // segments. + // Return at most `num_previous_segments` segments before each selected + // segments. + int32 num_previous_segments = 4; + + // Return at most `num_next_segments` segments after each selected + // segments. + int32 num_next_segments = 5; } // If `snippetSpec` is not specified, snippets are not included in the @@ -418,6 +438,22 @@ message SearchRequest { ExtractiveContentSpec extractive_content_spec = 3; } + // The specification that uses customized query embedding vector to do + // semantic document retrieval. + message EmbeddingSpec { + // Embedding vector. + message EmbeddingVector { + // Embedding field path in schema. + string field_path = 1; + + // Query embedding vector. + repeated float vector = 2; + } + + // The embedding vector used for retrieval. Limit to 1. + repeated EmbeddingVector embedding_vectors = 1; + } + // Required. The resource name of the Search serving config, such as // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. // This field is used to identify the serving configuration name, set @@ -539,6 +575,37 @@ message SearchRequest { // A specification for configuring the behavior of content search. ContentSearchSpec content_search_spec = 24; + // Uses the provided embedding to do additional semantic document retrieval. + // The retrieval is based on the dot product of + // [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document + // embedding that is provided in + // [SearchRequest.embedding_spec.embedding_vectors.field_path][]. + // + // If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not + // provided, it will use [ServingConfig.embedding_config.field_paths][]. + EmbeddingSpec embedding_spec = 23; + + // The ranking expression controls the customized ranking on retrieval + // documents. This overrides [ServingConfig.ranking_expression][]. + // The ranking expression is a single function or multiple functions that are + // joint by "+". + // * ranking_expression = function, { " + ", function }; + // Supported functions: + // * double * relevance_score + // * double * dotProduct(embedding_field_path) + // Function variables: + // `relevance_score`: pre-defined keywords, used for measure relevance + // between query and document. + // `embedding_field_path`: the document embedding field + // used with query embedding vector. + // `dotProduct`: embedding function between embedding_field_path and query + // embedding vector. + // + // Example ranking expression: + // If document has an embedding field doc_embedding, the ranking expression + // could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`. + string ranking_expression = 26; + // Whether to turn on safe search. This is only supported for // website search. bool safe_search = 20; @@ -576,6 +643,9 @@ message SearchResponse { // The document data snippet in the search response. Only fields that are // marked as retrievable are populated. Document document = 2; + + // Google provided available scores. + map model_scores = 4; } // A facet result. @@ -629,6 +699,17 @@ message SearchResponse { // Summary of the top N search result specified by the summary spec. message Summary { + // Safety Attribute categories and their associated confidence scores. + message SafetyAttributes { + // The display names of Safety Attribute categories associated with the + // generated content. Order matches the Scores. + repeated string categories = 1; + + // The confidence scores of the each category, higher + // value means higher confidence. Order matches the Categories. + repeated float scores = 2; + } + // An Enum for summary-skipped reasons. enum SummarySkippedReason { // Default value. The summary skipped reason is not specified. @@ -654,6 +735,17 @@ message SearchResponse { // For example, the data store contains facts about company A but the // user query is asking questions about company B. OUT_OF_DOMAIN_QUERY_IGNORED = 3; + + // The potential policy violation case. + // + // Google skips the summary if there is a potential policy violation + // detected. This includes content that may be violent or toxic. + POTENTIAL_POLICY_VIOLATION = 4; + + // The LLM addon not enabled case. + // + // Google skips the summary if the LLM addon is not enabled. + LLM_ADDON_NOT_ENABLED = 5; } // The summary content. @@ -662,6 +754,23 @@ message SearchResponse { // Additional summary-skipped reasons. This provides the reason for ignored // cases. If nothing is skipped, this field is not set. repeated SummarySkippedReason summary_skipped_reasons = 2; + + // A collection of Safety Attribute categories and their associated + // confidence scores. + SafetyAttributes safety_attributes = 3; + } + + // Information describing query expansion including whether expansion has + // occurred. + message QueryExpansionInfo { + // Bool describing whether query expansion has occurred. + bool expanded_query = 1; + + // Number of pinned results. This field will only be set when expansion + // happens and + // [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] + // is set to true. + int64 pinned_result_count = 2; } // A list of matched documents. The order represents the ranking. @@ -714,4 +823,7 @@ message SearchResponse { // Controls applied as part of the Control service. repeated string applied_controls = 10; + + // Query expansion information for the returned results. + QueryExpansionInfo query_expansion_info = 14; } diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/user_event.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/user_event.proto index 460ff5f2987f..afbdfa60771a 100644 --- a/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/user_event.proto +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1beta/src/main/proto/google/cloud/discoveryengine/v1beta/user_event.proto @@ -410,6 +410,10 @@ message DocumentInfo { string name = 2 [(google.api.resource_reference) = { type: "discoveryengine.googleapis.com/Document" }]; + + // The [Document][google.cloud.discoveryengine.v1beta.Document] URI - only + // allowed for website data stores. + string uri = 6; } // Quantity of the Document associated with the user event. Defaults to 1. diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/completionservice/completequery/AsyncCompleteQuery.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/completionservice/completequery/AsyncCompleteQuery.java index 81d5dc6452bb..ad3c25da5553 100644 --- a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/completionservice/completequery/AsyncCompleteQuery.java +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/completionservice/completequery/AsyncCompleteQuery.java @@ -45,6 +45,7 @@ public static void asyncCompleteQuery() throws Exception { .setQuery("query107944136") .setQueryModel("queryModel-184930495") .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) .build(); ApiFuture future = completionServiceClient.completeQueryCallable().futureCall(request); diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/completionservice/completequery/SyncCompleteQuery.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/completionservice/completequery/SyncCompleteQuery.java index 100b7165658c..c69dbf3a1270 100644 --- a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/completionservice/completequery/SyncCompleteQuery.java +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/completionservice/completequery/SyncCompleteQuery.java @@ -44,6 +44,7 @@ public static void syncCompleteQuery() throws Exception { .setQuery("query107944136") .setQueryModel("queryModel-184930495") .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) .build(); CompleteQueryResponse response = completionServiceClient.completeQuery(request); } diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/AsyncConverseConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/AsyncConverseConversation.java new file mode 100644 index 000000000000..b14da5f5a27e --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/AsyncConverseConversation.java @@ -0,0 +1,68 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1.SearchRequest; +import com.google.cloud.discoveryengine.v1.ServingConfigName; +import com.google.cloud.discoveryengine.v1.TextInput; +import java.util.HashMap; + +public class AsyncConverseConversation { + + public static void main(String[] args) throws Exception { + asyncConverseConversation(); + } + + public static void asyncConverseConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ConverseConversationRequest request = + ConverseConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setQuery(TextInput.newBuilder().build()) + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setConversation(Conversation.newBuilder().build()) + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build()) + .build(); + ApiFuture future = + conversationalSearchServiceClient.converseConversationCallable().futureCall(request); + // Do something. + ConverseConversationResponse response = future.get(); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/SyncConverseConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/SyncConverseConversation.java new file mode 100644 index 000000000000..a249f7e8014b --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/SyncConverseConversation.java @@ -0,0 +1,65 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1.SearchRequest; +import com.google.cloud.discoveryengine.v1.ServingConfigName; +import com.google.cloud.discoveryengine.v1.TextInput; +import java.util.HashMap; + +public class SyncConverseConversation { + + public static void main(String[] args) throws Exception { + syncConverseConversation(); + } + + public static void syncConverseConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ConverseConversationRequest request = + ConverseConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setQuery(TextInput.newBuilder().build()) + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setConversation(Conversation.newBuilder().build()) + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build()) + .build(); + ConverseConversationResponse response = + conversationalSearchServiceClient.converseConversation(request); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/SyncConverseConversationConversationnameTextinput.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/SyncConverseConversationConversationnameTextinput.java new file mode 100644 index 000000000000..15e36f85c6d3 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/SyncConverseConversationConversationnameTextinput.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_ConversationnameTextinput_sync] +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1.TextInput; + +public class SyncConverseConversationConversationnameTextinput { + + public static void main(String[] args) throws Exception { + syncConverseConversationConversationnameTextinput(); + } + + public static void syncConverseConversationConversationnameTextinput() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + TextInput query = TextInput.newBuilder().build(); + ConverseConversationResponse response = + conversationalSearchServiceClient.converseConversation(name, query); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_ConversationnameTextinput_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/SyncConverseConversationStringTextinput.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/SyncConverseConversationStringTextinput.java new file mode 100644 index 000000000000..d608e503ea4b --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/converseconversation/SyncConverseConversationStringTextinput.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_StringTextinput_sync] +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1.TextInput; + +public class SyncConverseConversationStringTextinput { + + public static void main(String[] args) throws Exception { + syncConverseConversationStringTextinput(); + } + + public static void syncConverseConversationStringTextinput() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + String name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString(); + TextInput query = TextInput.newBuilder().build(); + ConverseConversationResponse response = + conversationalSearchServiceClient.converseConversation(name, query); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_StringTextinput_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/create/SyncCreateSetCredentialsProvider.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..82db8a3b68b8 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceSettings; +import com.google.cloud.discoveryengine.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConversationalSearchServiceSettings conversationalSearchServiceSettings = + ConversationalSearchServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create(conversationalSearchServiceSettings); + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_Create_SetCredentialsProvider_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/create/SyncCreateSetCredentialsProvider1.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..83a7966cb5b6 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConversationalSearchServiceSettings conversationalSearchServiceSettings = + ConversationalSearchServiceSettings.newHttpJsonBuilder().build(); + ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create(conversationalSearchServiceSettings); + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_Create_SetCredentialsProvider1_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/create/SyncCreateSetEndpoint.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..4dcc5d5306e4 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_Create_SetEndpoint_sync] +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceSettings; +import com.google.cloud.discoveryengine.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConversationalSearchServiceSettings conversationalSearchServiceSettings = + ConversationalSearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create(conversationalSearchServiceSettings); + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_Create_SetEndpoint_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/AsyncCreateConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/AsyncCreateConversation.java new file mode 100644 index 000000000000..e68d81ac6e01 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/AsyncCreateConversation.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1.DataStoreName; + +public class AsyncCreateConversation { + + public static void main(String[] args) throws Exception { + asyncCreateConversation(); + } + + public static void asyncCreateConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + CreateConversationRequest request = + CreateConversationRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setConversation(Conversation.newBuilder().build()) + .build(); + ApiFuture future = + conversationalSearchServiceClient.createConversationCallable().futureCall(request); + // Do something. + Conversation response = future.get(); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/SyncCreateConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/SyncCreateConversation.java new file mode 100644 index 000000000000..2883356caf2b --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/SyncCreateConversation.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1.DataStoreName; + +public class SyncCreateConversation { + + public static void main(String[] args) throws Exception { + syncCreateConversation(); + } + + public static void syncCreateConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + CreateConversationRequest request = + CreateConversationRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setConversation(Conversation.newBuilder().build()) + .build(); + Conversation response = conversationalSearchServiceClient.createConversation(request); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/SyncCreateConversationDatastorenameConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/SyncCreateConversationDatastorenameConversation.java new file mode 100644 index 000000000000..ee887653422d --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/SyncCreateConversationDatastorenameConversation.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_DatastorenameConversation_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.DataStoreName; + +public class SyncCreateConversationDatastorenameConversation { + + public static void main(String[] args) throws Exception { + syncCreateConversationDatastorenameConversation(); + } + + public static void syncCreateConversationDatastorenameConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Conversation conversation = Conversation.newBuilder().build(); + Conversation response = + conversationalSearchServiceClient.createConversation(parent, conversation); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_DatastorenameConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/SyncCreateConversationStringConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/SyncCreateConversationStringConversation.java new file mode 100644 index 000000000000..250ad1a39255 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/createconversation/SyncCreateConversationStringConversation.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_StringConversation_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.DataStoreName; + +public class SyncCreateConversationStringConversation { + + public static void main(String[] args) throws Exception { + syncCreateConversationStringConversation(); + } + + public static void syncCreateConversationStringConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + String parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString(); + Conversation conversation = Conversation.newBuilder().build(); + Conversation response = + conversationalSearchServiceClient.createConversation(parent, conversation); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_StringConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/AsyncDeleteConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/AsyncDeleteConversation.java new file mode 100644 index 000000000000..2060b6ffcd69 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/AsyncDeleteConversation.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.DeleteConversationRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteConversation { + + public static void main(String[] args) throws Exception { + asyncDeleteConversation(); + } + + public static void asyncDeleteConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + DeleteConversationRequest request = + DeleteConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .build(); + ApiFuture future = + conversationalSearchServiceClient.deleteConversationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/SyncDeleteConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/SyncDeleteConversation.java new file mode 100644 index 000000000000..bf0d1f90d0ca --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/SyncDeleteConversation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_sync] +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.DeleteConversationRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteConversation { + + public static void main(String[] args) throws Exception { + syncDeleteConversation(); + } + + public static void syncDeleteConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + DeleteConversationRequest request = + DeleteConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .build(); + conversationalSearchServiceClient.deleteConversation(request); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/SyncDeleteConversationConversationname.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/SyncDeleteConversationConversationname.java new file mode 100644 index 000000000000..14601838f79e --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/SyncDeleteConversationConversationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_Conversationname_sync] +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteConversationConversationname { + + public static void main(String[] args) throws Exception { + syncDeleteConversationConversationname(); + } + + public static void syncDeleteConversationConversationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + conversationalSearchServiceClient.deleteConversation(name); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_Conversationname_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/SyncDeleteConversationString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/SyncDeleteConversationString.java new file mode 100644 index 000000000000..2d208457a922 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/deleteconversation/SyncDeleteConversationString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_String_sync] +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteConversationString { + + public static void main(String[] args) throws Exception { + syncDeleteConversationString(); + } + + public static void syncDeleteConversationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + String name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString(); + conversationalSearchServiceClient.deleteConversation(name); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/AsyncGetConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/AsyncGetConversation.java new file mode 100644 index 000000000000..332cdf6d2ac8 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/AsyncGetConversation.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_GetConversation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.GetConversationRequest; + +public class AsyncGetConversation { + + public static void main(String[] args) throws Exception { + asyncGetConversation(); + } + + public static void asyncGetConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + GetConversationRequest request = + GetConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .build(); + ApiFuture future = + conversationalSearchServiceClient.getConversationCallable().futureCall(request); + // Do something. + Conversation response = future.get(); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_GetConversation_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/SyncGetConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/SyncGetConversation.java new file mode 100644 index 000000000000..cc26caa358e8 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/SyncGetConversation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_GetConversation_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.GetConversationRequest; + +public class SyncGetConversation { + + public static void main(String[] args) throws Exception { + syncGetConversation(); + } + + public static void syncGetConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + GetConversationRequest request = + GetConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .build(); + Conversation response = conversationalSearchServiceClient.getConversation(request); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_GetConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/SyncGetConversationConversationname.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/SyncGetConversationConversationname.java new file mode 100644 index 000000000000..29c7db15e726 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/SyncGetConversationConversationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_GetConversation_Conversationname_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; + +public class SyncGetConversationConversationname { + + public static void main(String[] args) throws Exception { + syncGetConversationConversationname(); + } + + public static void syncGetConversationConversationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + Conversation response = conversationalSearchServiceClient.getConversation(name); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_GetConversation_Conversationname_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/SyncGetConversationString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/SyncGetConversationString.java new file mode 100644 index 000000000000..76921d846856 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/getconversation/SyncGetConversationString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_GetConversation_String_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationName; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; + +public class SyncGetConversationString { + + public static void main(String[] args) throws Exception { + syncGetConversationString(); + } + + public static void syncGetConversationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + String name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString(); + Conversation response = conversationalSearchServiceClient.getConversation(name); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_GetConversation_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/AsyncListConversations.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/AsyncListConversations.java new file mode 100644 index 000000000000..dd6ff62de2c4 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/AsyncListConversations.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_ListConversations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.DataStoreName; +import com.google.cloud.discoveryengine.v1.ListConversationsRequest; + +public class AsyncListConversations { + + public static void main(String[] args) throws Exception { + asyncListConversations(); + } + + public static void asyncListConversations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ListConversationsRequest request = + ListConversationsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + conversationalSearchServiceClient.listConversationsPagedCallable().futureCall(request); + // Do something. + for (Conversation element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_ListConversations_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/AsyncListConversationsPaged.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/AsyncListConversationsPaged.java new file mode 100644 index 000000000000..983fb265d433 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/AsyncListConversationsPaged.java @@ -0,0 +1,68 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_ListConversations_Paged_async] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.DataStoreName; +import com.google.cloud.discoveryengine.v1.ListConversationsRequest; +import com.google.cloud.discoveryengine.v1.ListConversationsResponse; +import com.google.common.base.Strings; + +public class AsyncListConversationsPaged { + + public static void main(String[] args) throws Exception { + asyncListConversationsPaged(); + } + + public static void asyncListConversationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ListConversationsRequest request = + ListConversationsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListConversationsResponse response = + conversationalSearchServiceClient.listConversationsCallable().call(request); + for (Conversation element : response.getConversationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_ListConversations_Paged_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/SyncListConversations.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/SyncListConversations.java new file mode 100644 index 000000000000..1621d210247e --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/SyncListConversations.java @@ -0,0 +1,57 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_ListConversations_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.DataStoreName; +import com.google.cloud.discoveryengine.v1.ListConversationsRequest; + +public class SyncListConversations { + + public static void main(String[] args) throws Exception { + syncListConversations(); + } + + public static void syncListConversations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ListConversationsRequest request = + ListConversationsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Conversation element : + conversationalSearchServiceClient.listConversations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_ListConversations_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/SyncListConversationsDatastorename.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/SyncListConversationsDatastorename.java new file mode 100644 index 000000000000..2ef41e3c9cae --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/SyncListConversationsDatastorename.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_ListConversations_Datastorename_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.DataStoreName; + +public class SyncListConversationsDatastorename { + + public static void main(String[] args) throws Exception { + syncListConversationsDatastorename(); + } + + public static void syncListConversationsDatastorename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + for (Conversation element : + conversationalSearchServiceClient.listConversations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_ListConversations_Datastorename_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/SyncListConversationsString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/SyncListConversationsString.java new file mode 100644 index 000000000000..0d1080d7e840 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/listconversations/SyncListConversationsString.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_ListConversations_String_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.DataStoreName; + +public class SyncListConversationsString { + + public static void main(String[] args) throws Exception { + syncListConversationsString(); + } + + public static void syncListConversationsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + String parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString(); + for (Conversation element : + conversationalSearchServiceClient.listConversations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_ListConversations_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/updateconversation/AsyncUpdateConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/updateconversation/AsyncUpdateConversation.java new file mode 100644 index 000000000000..e816febebda6 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/updateconversation/AsyncUpdateConversation.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.UpdateConversationRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateConversation { + + public static void main(String[] args) throws Exception { + asyncUpdateConversation(); + } + + public static void asyncUpdateConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + UpdateConversationRequest request = + UpdateConversationRequest.newBuilder() + .setConversation(Conversation.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + conversationalSearchServiceClient.updateConversationCallable().futureCall(request); + // Do something. + Conversation response = future.get(); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/updateconversation/SyncUpdateConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/updateconversation/SyncUpdateConversation.java new file mode 100644 index 000000000000..dc6f4387632f --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/updateconversation/SyncUpdateConversation.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1.UpdateConversationRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateConversation { + + public static void main(String[] args) throws Exception { + syncUpdateConversation(); + } + + public static void syncUpdateConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + UpdateConversationRequest request = + UpdateConversationRequest.newBuilder() + .setConversation(Conversation.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Conversation response = conversationalSearchServiceClient.updateConversation(request); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/updateconversation/SyncUpdateConversationConversationFieldmask.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/updateconversation/SyncUpdateConversationConversationFieldmask.java new file mode 100644 index 000000000000..65a162ef0151 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservice/updateconversation/SyncUpdateConversationConversationFieldmask.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_ConversationFieldmask_sync] +import com.google.cloud.discoveryengine.v1.Conversation; +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateConversationConversationFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateConversationConversationFieldmask(); + } + + public static void syncUpdateConversationConversationFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + Conversation conversation = Conversation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Conversation response = + conversationalSearchServiceClient.updateConversation(conversation, updateMask); + } + } +} +// [END discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_ConversationFieldmask_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservicesettings/converseconversation/SyncConverseConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservicesettings/converseconversation/SyncConverseConversation.java new file mode 100644 index 000000000000..f3ea79575fb1 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/conversationalsearchservicesettings/converseconversation/SyncConverseConversation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchServiceSettings_ConverseConversation_sync] +import com.google.cloud.discoveryengine.v1.ConversationalSearchServiceSettings; +import java.time.Duration; + +public class SyncConverseConversation { + + public static void main(String[] args) throws Exception { + syncConverseConversation(); + } + + public static void syncConverseConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConversationalSearchServiceSettings.Builder conversationalSearchServiceSettingsBuilder = + ConversationalSearchServiceSettings.newBuilder(); + conversationalSearchServiceSettingsBuilder + .converseConversationSettings() + .setRetrySettings( + conversationalSearchServiceSettingsBuilder + .converseConversationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ConversationalSearchServiceSettings conversationalSearchServiceSettings = + conversationalSearchServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1_generated_ConversationalSearchServiceSettings_ConverseConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/AsyncSearch.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/AsyncSearch.java index bb6119f199ef..111c2beeacbf 100644 --- a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/AsyncSearch.java +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/AsyncSearch.java @@ -25,6 +25,7 @@ import com.google.cloud.discoveryengine.v1.ServingConfigName; import com.google.cloud.discoveryengine.v1.UserInfo; import com.google.protobuf.Value; +import java.util.ArrayList; import java.util.HashMap; public class AsyncSearch { @@ -51,10 +52,15 @@ public static void asyncSearch() throws Exception { "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") .toString()) .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) .putAllParams(new HashMap()) .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/AsyncSearchPaged.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/AsyncSearchPaged.java index 9373515536a6..d850d05c1f2e 100644 --- a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/AsyncSearchPaged.java +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/AsyncSearchPaged.java @@ -25,6 +25,7 @@ import com.google.cloud.discoveryengine.v1.UserInfo; import com.google.common.base.Strings; import com.google.protobuf.Value; +import java.util.ArrayList; import java.util.HashMap; public class AsyncSearchPaged { @@ -51,10 +52,15 @@ public static void asyncSearchPaged() throws Exception { "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") .toString()) .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) .putAllParams(new HashMap()) .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/SyncSearch.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/SyncSearch.java index 4d91ae7dbf9e..0efc9db03bc3 100644 --- a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/SyncSearch.java +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/searchservice/search/SyncSearch.java @@ -24,6 +24,7 @@ import com.google.cloud.discoveryengine.v1.ServingConfigName; import com.google.cloud.discoveryengine.v1.UserInfo; import com.google.protobuf.Value; +import java.util.ArrayList; import java.util.HashMap; public class SyncSearch { @@ -50,10 +51,15 @@ public static void syncSearch() throws Exception { "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") .toString()) .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) .putAllParams(new HashMap()) .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/stub/conversationalsearchservicestubsettings/converseconversation/SyncConverseConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/stub/conversationalsearchservicestubsettings/converseconversation/SyncConverseConversation.java new file mode 100644 index 000000000000..5557afbca176 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1/stub/conversationalsearchservicestubsettings/converseconversation/SyncConverseConversation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1.stub.samples; + +// [START discoveryengine_v1_generated_ConversationalSearchServiceStubSettings_ConverseConversation_sync] +import com.google.cloud.discoveryengine.v1.stub.ConversationalSearchServiceStubSettings; +import java.time.Duration; + +public class SyncConverseConversation { + + public static void main(String[] args) throws Exception { + syncConverseConversation(); + } + + public static void syncConverseConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConversationalSearchServiceStubSettings.Builder conversationalSearchServiceSettingsBuilder = + ConversationalSearchServiceStubSettings.newBuilder(); + conversationalSearchServiceSettingsBuilder + .converseConversationSettings() + .setRetrySettings( + conversationalSearchServiceSettingsBuilder + .converseConversationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ConversationalSearchServiceStubSettings conversationalSearchServiceSettings = + conversationalSearchServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1_generated_ConversationalSearchServiceStubSettings_ConverseConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/conversationalsearchservice/converseconversation/AsyncConverseConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/conversationalsearchservice/converseconversation/AsyncConverseConversation.java index e807d52859ec..3fa47170d50f 100644 --- a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/conversationalsearchservice/converseconversation/AsyncConverseConversation.java +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/conversationalsearchservice/converseconversation/AsyncConverseConversation.java @@ -23,8 +23,10 @@ import com.google.cloud.discoveryengine.v1beta.ConversationalSearchServiceClient; import com.google.cloud.discoveryengine.v1beta.ConverseConversationRequest; import com.google.cloud.discoveryengine.v1beta.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1beta.SearchRequest; import com.google.cloud.discoveryengine.v1beta.ServingConfigName; import com.google.cloud.discoveryengine.v1beta.TextInput; +import java.util.HashMap; public class AsyncConverseConversation { @@ -53,6 +55,8 @@ public static void asyncConverseConversation() throws Exception { .toString()) .setConversation(Conversation.newBuilder().build()) .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build()) .build(); ApiFuture future = conversationalSearchServiceClient.converseConversationCallable().futureCall(request); diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/conversationalsearchservice/converseconversation/SyncConverseConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/conversationalsearchservice/converseconversation/SyncConverseConversation.java index 438d586ab37f..82a3f2002ae1 100644 --- a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/conversationalsearchservice/converseconversation/SyncConverseConversation.java +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/conversationalsearchservice/converseconversation/SyncConverseConversation.java @@ -22,8 +22,10 @@ import com.google.cloud.discoveryengine.v1beta.ConversationalSearchServiceClient; import com.google.cloud.discoveryengine.v1beta.ConverseConversationRequest; import com.google.cloud.discoveryengine.v1beta.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1beta.SearchRequest; import com.google.cloud.discoveryengine.v1beta.ServingConfigName; import com.google.cloud.discoveryengine.v1beta.TextInput; +import java.util.HashMap; public class SyncConverseConversation { @@ -52,6 +54,8 @@ public static void syncConverseConversation() throws Exception { .toString()) .setConversation(Conversation.newBuilder().build()) .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build()) .build(); ConverseConversationResponse response = conversationalSearchServiceClient.converseConversation(request); diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/AsyncSearch.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/AsyncSearch.java index 2a1dc032bfe5..cb460b51d35c 100644 --- a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/AsyncSearch.java +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/AsyncSearch.java @@ -66,6 +66,8 @@ public static void asyncSearch() throws Exception { .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) .setUserPseudoId("userPseudoId-1155274652") .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") .setSafeSearch(true) .putAllUserLabels(new HashMap()) .build(); diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/AsyncSearchPaged.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/AsyncSearchPaged.java index 13054347440f..ba6a6d7dd13b 100644 --- a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/AsyncSearchPaged.java +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/AsyncSearchPaged.java @@ -66,6 +66,8 @@ public static void asyncSearchPaged() throws Exception { .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) .setUserPseudoId("userPseudoId-1155274652") .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") .setSafeSearch(true) .putAllUserLabels(new HashMap()) .build(); diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/SyncSearch.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/SyncSearch.java index c88b460a4c3d..df041d1b2e30 100644 --- a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/SyncSearch.java +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1beta/searchservice/search/SyncSearch.java @@ -65,6 +65,8 @@ public static void syncSearch() throws Exception { .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) .setUserPseudoId("userPseudoId-1155274652") .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") .setSafeSearch(true) .putAllUserLabels(new HashMap()) .build();