/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/discoveryengine/v1beta/search_service.proto

package com.google.cloud.discoveryengine.v1beta;

/**
 *
 *
 * <pre>
 * Request message for
 * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
 * method.
 * </pre>
 *
 * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest}
 */
public final class SearchRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.SearchRequest)
    SearchRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SearchRequest.newBuilder() to construct.
  private SearchRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SearchRequest() {
    servingConfig_ = "";
    branch_ = "";
    query_ = "";
    pageToken_ = "";
    filter_ = "";
    orderBy_ = "";
    facetSpecs_ = java.util.Collections.emptyList();
    userPseudoId_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new SearchRequest();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
        .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(int number) {
    switch (number) {
      case 11:
        return internalGetParams();
      default:
        throw new RuntimeException("Invalid map field number: " + number);
    }
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
        .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.discoveryengine.v1beta.SearchRequest.class,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.Builder.class);
  }

  public interface FacetSpecOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Required. The facet key specification.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the facetKey field is set.
     */
    boolean hasFacetKey();
    /**
     *
     *
     * <pre>
     * Required. The facet key specification.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The facetKey.
     */
    com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey getFacetKey();
    /**
     *
     *
     * <pre>
     * Required. The facet key specification.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKeyOrBuilder
        getFacetKeyOrBuilder();

    /**
     *
     *
     * <pre>
     * 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 will be coerced to 300.
     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>int32 limit = 2;</code>
     *
     * @return The limit.
     */
    int getLimit();

    /**
     *
     *
     * <pre>
     * List of keys to exclude when faceting.
     * By default,
     * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
     * </pre>
     *
     * <code>repeated string excluded_filter_keys = 3;</code>
     *
     * @return A list containing the excludedFilterKeys.
     */
    java.util.List<java.lang.String> getExcludedFilterKeysList();
    /**
     *
     *
     * <pre>
     * List of keys to exclude when faceting.
     * By default,
     * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
     * </pre>
     *
     * <code>repeated string excluded_filter_keys = 3;</code>
     *
     * @return The count of excludedFilterKeys.
     */
    int getExcludedFilterKeysCount();
    /**
     *
     *
     * <pre>
     * List of keys to exclude when faceting.
     * By default,
     * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
     * </pre>
     *
     * <code>repeated string excluded_filter_keys = 3;</code>
     *
     * @param index The index of the element to return.
     * @return The excludedFilterKeys at the given index.
     */
    java.lang.String getExcludedFilterKeys(int index);
    /**
     *
     *
     * <pre>
     * List of keys to exclude when faceting.
     * By default,
     * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
     * </pre>
     *
     * <code>repeated string excluded_filter_keys = 3;</code>
     *
     * @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);

    /**
     *
     *
     * <pre>
     * Enables dynamic position for this facet. If set to true, the position of
     * this facet among all facets in the response is determined automatically.
     * It will be ordered together with dynamic facets if dynamic
     * facets is enabled. If set to false, the position of this facet in the
     * response will be the same as in the request, and it will be 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 will be 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 enable, which will generate 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" will always be
     * ranked at 1st and 2nd position since their enable_dynamic_position are
     * false.
     * </pre>
     *
     * <code>bool enable_dynamic_position = 4;</code>
     *
     * @return The enableDynamicPosition.
     */
    boolean getEnableDynamicPosition();
  }
  /**
   *
   *
   * <pre>
   * A facet specification to perform faceted search.
   * </pre>
   *
   * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec}
   */
  public static final class FacetSpec extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.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.EMPTY;
    }

    @java.lang.Override
    @SuppressWarnings({"unused"})
    protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
      return new FacetSpec();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
          .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_FacetSpec_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_FacetSpec_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.class,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder.class);
    }

    public interface FacetKeyOrBuilder
        extends
        // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey)
        com.google.protobuf.MessageOrBuilder {

      /**
       *
       *
       * <pre>
       * Required. Supported textual and numerical facet keys in
       * [Document][google.cloud.discoveryengine.v1beta.Document] object, over
       * which the facet values are computed. Facet key is case-sensitive.
       * </pre>
       *
       * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
       *
       * @return The key.
       */
      java.lang.String getKey();
      /**
       *
       *
       * <pre>
       * Required. Supported textual and numerical facet keys in
       * [Document][google.cloud.discoveryengine.v1beta.Document] object, over
       * which the facet values are computed. Facet key is case-sensitive.
       * </pre>
       *
       * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
       *
       * @return The bytes for key.
       */
      com.google.protobuf.ByteString getKeyBytes();

      /**
       *
       *
       * <pre>
       * Set only if values should be bucketized 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.
       * </pre>
       *
       * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
       */
      java.util.List<com.google.cloud.discoveryengine.v1beta.Interval> getIntervalsList();
      /**
       *
       *
       * <pre>
       * Set only if values should be bucketized 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.
       * </pre>
       *
       * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
       */
      com.google.cloud.discoveryengine.v1beta.Interval getIntervals(int index);
      /**
       *
       *
       * <pre>
       * Set only if values should be bucketized 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.
       * </pre>
       *
       * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
       */
      int getIntervalsCount();
      /**
       *
       *
       * <pre>
       * Set only if values should be bucketized 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.
       * </pre>
       *
       * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
       */
      java.util.List<? extends com.google.cloud.discoveryengine.v1beta.IntervalOrBuilder>
          getIntervalsOrBuilderList();
      /**
       *
       *
       * <pre>
       * Set only if values should be bucketized 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.
       * </pre>
       *
       * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
       */
      com.google.cloud.discoveryengine.v1beta.IntervalOrBuilder getIntervalsOrBuilder(int index);

      /**
       *
       *
       * <pre>
       * Only get facet for the given restricted values. Only supported on
       * textual fields. For example, suppose "category" has three values
       * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
       * "restricted_values" to "Action &gt; 2022", the "category" facet will only
       * contain "Action &gt; 2022". Only supported on textual fields. Maximum
       * is 10.
       * </pre>
       *
       * <code>repeated string restricted_values = 3;</code>
       *
       * @return A list containing the restrictedValues.
       */
      java.util.List<java.lang.String> getRestrictedValuesList();
      /**
       *
       *
       * <pre>
       * Only get facet for the given restricted values. Only supported on
       * textual fields. For example, suppose "category" has three values
       * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
       * "restricted_values" to "Action &gt; 2022", the "category" facet will only
       * contain "Action &gt; 2022". Only supported on textual fields. Maximum
       * is 10.
       * </pre>
       *
       * <code>repeated string restricted_values = 3;</code>
       *
       * @return The count of restrictedValues.
       */
      int getRestrictedValuesCount();
      /**
       *
       *
       * <pre>
       * Only get facet for the given restricted values. Only supported on
       * textual fields. For example, suppose "category" has three values
       * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
       * "restricted_values" to "Action &gt; 2022", the "category" facet will only
       * contain "Action &gt; 2022". Only supported on textual fields. Maximum
       * is 10.
       * </pre>
       *
       * <code>repeated string restricted_values = 3;</code>
       *
       * @param index The index of the element to return.
       * @return The restrictedValues at the given index.
       */
      java.lang.String getRestrictedValues(int index);
      /**
       *
       *
       * <pre>
       * Only get facet for the given restricted values. Only supported on
       * textual fields. For example, suppose "category" has three values
       * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
       * "restricted_values" to "Action &gt; 2022", the "category" facet will only
       * contain "Action &gt; 2022". Only supported on textual fields. Maximum
       * is 10.
       * </pre>
       *
       * <code>repeated string restricted_values = 3;</code>
       *
       * @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);

      /**
       *
       *
       * <pre>
       * Only get facet values that start with the given string prefix. For
       * example, suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
       * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string prefixes = 4;</code>
       *
       * @return A list containing the prefixes.
       */
      java.util.List<java.lang.String> getPrefixesList();
      /**
       *
       *
       * <pre>
       * Only get facet values that start with the given string prefix. For
       * example, suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
       * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string prefixes = 4;</code>
       *
       * @return The count of prefixes.
       */
      int getPrefixesCount();
      /**
       *
       *
       * <pre>
       * Only get facet values that start with the given string prefix. For
       * example, suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
       * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string prefixes = 4;</code>
       *
       * @param index The index of the element to return.
       * @return The prefixes at the given index.
       */
      java.lang.String getPrefixes(int index);
      /**
       *
       *
       * <pre>
       * Only get facet values that start with the given string prefix. For
       * example, suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
       * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string prefixes = 4;</code>
       *
       * @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);

      /**
       *
       *
       * <pre>
       * Only get facet values that contains the given strings. For example,
       * suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
       * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string contains = 5;</code>
       *
       * @return A list containing the contains.
       */
      java.util.List<java.lang.String> getContainsList();
      /**
       *
       *
       * <pre>
       * Only get facet values that contains the given strings. For example,
       * suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
       * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string contains = 5;</code>
       *
       * @return The count of contains.
       */
      int getContainsCount();
      /**
       *
       *
       * <pre>
       * Only get facet values that contains the given strings. For example,
       * suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
       * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string contains = 5;</code>
       *
       * @param index The index of the element to return.
       * @return The contains at the given index.
       */
      java.lang.String getContains(int index);
      /**
       *
       *
       * <pre>
       * Only get facet values that contains the given strings. For example,
       * suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
       * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string contains = 5;</code>
       *
       * @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);

      /**
       *
       *
       * <pre>
       * True to make facet keys case insensitive when getting faceting
       * values with prefixes or contains; false otherwise.
       * </pre>
       *
       * <code>bool case_insensitive = 6;</code>
       *
       * @return The caseInsensitive.
       */
      boolean getCaseInsensitive();

      /**
       *
       *
       * <pre>
       * The order in which documents are returned.
       * Allowed values are:
       * * "count desc", which means order by
       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count]
       * descending.
       * * "value desc", which means order by
       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
       * </pre>
       *
       * <code>string order_by = 7;</code>
       *
       * @return The orderBy.
       */
      java.lang.String getOrderBy();
      /**
       *
       *
       * <pre>
       * The order in which documents are returned.
       * Allowed values are:
       * * "count desc", which means order by
       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count]
       * descending.
       * * "value desc", which means order by
       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
       * </pre>
       *
       * <code>string order_by = 7;</code>
       *
       * @return The bytes for orderBy.
       */
      com.google.protobuf.ByteString getOrderByBytes();
    }
    /**
     *
     *
     * <pre>
     * Specifies how a facet is computed.
     * </pre>
     *
     * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey}
     */
    public static final class FacetKey extends com.google.protobuf.GeneratedMessageV3
        implements
        // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.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);
      }

      private FacetKey() {
        key_ = "";
        intervals_ = java.util.Collections.emptyList();
        restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        contains_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        orderBy_ = "";
      }

      @java.lang.Override
      @SuppressWarnings({"unused"})
      protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        return new FacetKey();
      }

      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        return this.unknownFields;
      }

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_FacetSpec_FacetKey_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_FacetSpec_FacetKey_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.class,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.Builder
                    .class);
      }

      public static final int KEY_FIELD_NUMBER = 1;

      @SuppressWarnings("serial")
      private volatile java.lang.Object key_ = "";
      /**
       *
       *
       * <pre>
       * Required. Supported textual and numerical facet keys in
       * [Document][google.cloud.discoveryengine.v1beta.Document] object, over
       * which the facet values are computed. Facet key is case-sensitive.
       * </pre>
       *
       * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
       *
       * @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;
        }
      }
      /**
       *
       *
       * <pre>
       * Required. Supported textual and numerical facet keys in
       * [Document][google.cloud.discoveryengine.v1beta.Document] object, over
       * which the facet values are computed. Facet key is case-sensitive.
       * </pre>
       *
       * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
       *
       * @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 INTERVALS_FIELD_NUMBER = 2;

      @SuppressWarnings("serial")
      private java.util.List<com.google.cloud.discoveryengine.v1beta.Interval> intervals_;
      /**
       *
       *
       * <pre>
       * Set only if values should be bucketized 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.
       * </pre>
       *
       * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
       */
      @java.lang.Override
      public java.util.List<com.google.cloud.discoveryengine.v1beta.Interval> getIntervalsList() {
        return intervals_;
      }
      /**
       *
       *
       * <pre>
       * Set only if values should be bucketized 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.
       * </pre>
       *
       * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
       */
      @java.lang.Override
      public java.util.List<? extends com.google.cloud.discoveryengine.v1beta.IntervalOrBuilder>
          getIntervalsOrBuilderList() {
        return intervals_;
      }
      /**
       *
       *
       * <pre>
       * Set only if values should be bucketized 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.
       * </pre>
       *
       * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
       */
      @java.lang.Override
      public int getIntervalsCount() {
        return intervals_.size();
      }
      /**
       *
       *
       * <pre>
       * Set only if values should be bucketized 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.
       * </pre>
       *
       * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
       */
      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.Interval getIntervals(int index) {
        return intervals_.get(index);
      }
      /**
       *
       *
       * <pre>
       * Set only if values should be bucketized 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.
       * </pre>
       *
       * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
       */
      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.IntervalOrBuilder getIntervalsOrBuilder(
          int index) {
        return intervals_.get(index);
      }

      public static final int RESTRICTED_VALUES_FIELD_NUMBER = 3;

      @SuppressWarnings("serial")
      private com.google.protobuf.LazyStringList restrictedValues_;
      /**
       *
       *
       * <pre>
       * Only get facet for the given restricted values. Only supported on
       * textual fields. For example, suppose "category" has three values
       * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
       * "restricted_values" to "Action &gt; 2022", the "category" facet will only
       * contain "Action &gt; 2022". Only supported on textual fields. Maximum
       * is 10.
       * </pre>
       *
       * <code>repeated string restricted_values = 3;</code>
       *
       * @return A list containing the restrictedValues.
       */
      public com.google.protobuf.ProtocolStringList getRestrictedValuesList() {
        return restrictedValues_;
      }
      /**
       *
       *
       * <pre>
       * Only get facet for the given restricted values. Only supported on
       * textual fields. For example, suppose "category" has three values
       * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
       * "restricted_values" to "Action &gt; 2022", the "category" facet will only
       * contain "Action &gt; 2022". Only supported on textual fields. Maximum
       * is 10.
       * </pre>
       *
       * <code>repeated string restricted_values = 3;</code>
       *
       * @return The count of restrictedValues.
       */
      public int getRestrictedValuesCount() {
        return restrictedValues_.size();
      }
      /**
       *
       *
       * <pre>
       * Only get facet for the given restricted values. Only supported on
       * textual fields. For example, suppose "category" has three values
       * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
       * "restricted_values" to "Action &gt; 2022", the "category" facet will only
       * contain "Action &gt; 2022". Only supported on textual fields. Maximum
       * is 10.
       * </pre>
       *
       * <code>repeated string restricted_values = 3;</code>
       *
       * @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);
      }
      /**
       *
       *
       * <pre>
       * Only get facet for the given restricted values. Only supported on
       * textual fields. For example, suppose "category" has three values
       * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
       * "restricted_values" to "Action &gt; 2022", the "category" facet will only
       * contain "Action &gt; 2022". Only supported on textual fields. Maximum
       * is 10.
       * </pre>
       *
       * <code>repeated string restricted_values = 3;</code>
       *
       * @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);
      }

      public static final int PREFIXES_FIELD_NUMBER = 4;

      @SuppressWarnings("serial")
      private com.google.protobuf.LazyStringList prefixes_;
      /**
       *
       *
       * <pre>
       * Only get facet values that start with the given string prefix. For
       * example, suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
       * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string prefixes = 4;</code>
       *
       * @return A list containing the prefixes.
       */
      public com.google.protobuf.ProtocolStringList getPrefixesList() {
        return prefixes_;
      }
      /**
       *
       *
       * <pre>
       * Only get facet values that start with the given string prefix. For
       * example, suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
       * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string prefixes = 4;</code>
       *
       * @return The count of prefixes.
       */
      public int getPrefixesCount() {
        return prefixes_.size();
      }
      /**
       *
       *
       * <pre>
       * Only get facet values that start with the given string prefix. For
       * example, suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
       * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string prefixes = 4;</code>
       *
       * @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);
      }
      /**
       *
       *
       * <pre>
       * Only get facet values that start with the given string prefix. For
       * example, suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
       * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string prefixes = 4;</code>
       *
       * @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);
      }

      public static final int CONTAINS_FIELD_NUMBER = 5;

      @SuppressWarnings("serial")
      private com.google.protobuf.LazyStringList contains_;
      /**
       *
       *
       * <pre>
       * Only get facet values that contains the given strings. For example,
       * suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
       * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string contains = 5;</code>
       *
       * @return A list containing the contains.
       */
      public com.google.protobuf.ProtocolStringList getContainsList() {
        return contains_;
      }
      /**
       *
       *
       * <pre>
       * Only get facet values that contains the given strings. For example,
       * suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
       * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string contains = 5;</code>
       *
       * @return The count of contains.
       */
      public int getContainsCount() {
        return contains_.size();
      }
      /**
       *
       *
       * <pre>
       * Only get facet values that contains the given strings. For example,
       * suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
       * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string contains = 5;</code>
       *
       * @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);
      }
      /**
       *
       *
       * <pre>
       * Only get facet values that contains the given strings. For example,
       * suppose "category" has three values "Action &gt; 2022",
       * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
       * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
       * Only supported on textual fields. Maximum is 10.
       * </pre>
       *
       * <code>repeated string contains = 5;</code>
       *
       * @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;
      /**
       *
       *
       * <pre>
       * True to make facet keys case insensitive when getting faceting
       * values with prefixes or contains; false otherwise.
       * </pre>
       *
       * <code>bool case_insensitive = 6;</code>
       *
       * @return The caseInsensitive.
       */
      @java.lang.Override
      public boolean getCaseInsensitive() {
        return caseInsensitive_;
      }

      public static final int ORDER_BY_FIELD_NUMBER = 7;

      @SuppressWarnings("serial")
      private volatile java.lang.Object orderBy_ = "";
      /**
       *
       *
       * <pre>
       * The order in which documents are returned.
       * Allowed values are:
       * * "count desc", which means order by
       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count]
       * descending.
       * * "value desc", which means order by
       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
       * </pre>
       *
       * <code>string order_by = 7;</code>
       *
       * @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;
        }
      }
      /**
       *
       *
       * <pre>
       * The order in which documents are returned.
       * Allowed values are:
       * * "count desc", which means order by
       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count]
       * descending.
       * * "value desc", which means order by
       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
       * </pre>
       *
       * <code>string order_by = 7;</code>
       *
       * @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(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 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 boolean equals(final java.lang.Object obj) {
        if (obj == this) {
          return true;
        }
        if (!(obj
            instanceof com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey)) {
          return super.equals(obj);
        }
        com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey other =
            (com.google.cloud.discoveryengine.v1beta.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 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;
      }

      public static com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
          parseFrom(java.nio.ByteBuffer data)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
          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.FacetSpec.FacetKey
          parseFrom(com.google.protobuf.ByteString data)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
          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.FacetSpec.FacetKey
          parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.SearchRequest.FacetSpec.FacetKey
          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.FacetSpec.FacetKey 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;
      }
      /**
       *
       *
       * <pre>
       * Specifies how a facet is computed.
       * </pre>
       *
       * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey}
       */
      public static final class Builder
          extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
          implements
          // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey)
          com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKeyOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
          return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
              .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_FacetSpec_FacetKey_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_FacetSpec_FacetKey_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.class,
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.Builder
                      .class);
        }

        // Construct using
        // com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.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 (intervalsBuilder_ == null) {
            intervals_ = java.util.Collections.emptyList();
          } else {
            intervals_ = null;
            intervalsBuilder_.clear();
          }
          bitField0_ = (bitField0_ & ~0x00000002);
          restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
          bitField0_ = (bitField0_ & ~0x00000004);
          prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
          bitField0_ = (bitField0_ & ~0x00000008);
          contains_ = com.google.protobuf.LazyStringArrayList.EMPTY;
          bitField0_ = (bitField0_ & ~0x00000010);
          caseInsensitive_ = false;
          orderBy_ = "";
          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_FacetSpec_FacetKey_descriptor;
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
            getDefaultInstanceForType() {
          return com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
              .getDefaultInstance();
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey build() {
          com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey result =
              buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
            buildPartial() {
          com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey result =
              new com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey(this);
          buildPartialRepeatedFields(result);
          if (bitField0_ != 0) {
            buildPartial0(result);
          }
          onBuilt();
          return result;
        }

        private void buildPartialRepeatedFields(
            com.google.cloud.discoveryengine.v1beta.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();
          }
          if (((bitField0_ & 0x00000004) != 0)) {
            restrictedValues_ = restrictedValues_.getUnmodifiableView();
            bitField0_ = (bitField0_ & ~0x00000004);
          }
          result.restrictedValues_ = restrictedValues_;
          if (((bitField0_ & 0x00000008) != 0)) {
            prefixes_ = prefixes_.getUnmodifiableView();
            bitField0_ = (bitField0_ & ~0x00000008);
          }
          result.prefixes_ = prefixes_;
          if (((bitField0_ & 0x00000010) != 0)) {
            contains_ = contains_.getUnmodifiableView();
            bitField0_ = (bitField0_ & ~0x00000010);
          }
          result.contains_ = contains_;
        }

        private void buildPartial0(
            com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey result) {
          int from_bitField0_ = bitField0_;
          if (((from_bitField0_ & 0x00000001) != 0)) {
            result.key_ = key_;
          }
          if (((from_bitField0_ & 0x00000020) != 0)) {
            result.caseInsensitive_ = caseInsensitive_;
          }
          if (((from_bitField0_ & 0x00000040) != 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.v1beta.SearchRequest.FacetSpec.FacetKey) {
            return mergeFrom(
                (com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey) other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }

        public Builder mergeFrom(
            com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey other) {
          if (other
              == com.google.cloud.discoveryengine.v1beta.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_ = (bitField0_ & ~0x00000004);
            } else {
              ensureRestrictedValuesIsMutable();
              restrictedValues_.addAll(other.restrictedValues_);
            }
            onChanged();
          }
          if (!other.prefixes_.isEmpty()) {
            if (prefixes_.isEmpty()) {
              prefixes_ = other.prefixes_;
              bitField0_ = (bitField0_ & ~0x00000008);
            } else {
              ensurePrefixesIsMutable();
              prefixes_.addAll(other.prefixes_);
            }
            onChanged();
          }
          if (!other.contains_.isEmpty()) {
            if (contains_.isEmpty()) {
              contains_ = other.contains_;
              bitField0_ = (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;
        }

        @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.v1beta.Interval m =
                        input.readMessage(
                            com.google.cloud.discoveryengine.v1beta.Interval.parser(),
                            extensionRegistry);
                    if (intervalsBuilder_ == null) {
                      ensureIntervalsIsMutable();
                      intervals_.add(m);
                    } else {
                      intervalsBuilder_.addMessage(m);
                    }
                    break;
                  } // 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)) {
                      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_ = "";
        /**
         *
         *
         * <pre>
         * Required. Supported textual and numerical facet keys in
         * [Document][google.cloud.discoveryengine.v1beta.Document] object, over
         * which the facet values are computed. Facet key is case-sensitive.
         * </pre>
         *
         * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
         *
         * @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;
          }
        }
        /**
         *
         *
         * <pre>
         * Required. Supported textual and numerical facet keys in
         * [Document][google.cloud.discoveryengine.v1beta.Document] object, over
         * which the facet values are computed. Facet key is case-sensitive.
         * </pre>
         *
         * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
         *
         * @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;
          }
        }
        /**
         *
         *
         * <pre>
         * Required. Supported textual and numerical facet keys in
         * [Document][google.cloud.discoveryengine.v1beta.Document] object, over
         * which the facet values are computed. Facet key is case-sensitive.
         * </pre>
         *
         * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
         *
         * @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;
        }
        /**
         *
         *
         * <pre>
         * Required. Supported textual and numerical facet keys in
         * [Document][google.cloud.discoveryengine.v1beta.Document] object, over
         * which the facet values are computed. Facet key is case-sensitive.
         * </pre>
         *
         * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearKey() {
          key_ = getDefaultInstance().getKey();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Required. Supported textual and numerical facet keys in
         * [Document][google.cloud.discoveryengine.v1beta.Document] object, over
         * which the facet values are computed. Facet key is case-sensitive.
         * </pre>
         *
         * <code>string key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
         *
         * @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<com.google.cloud.discoveryengine.v1beta.Interval> intervals_ =
            java.util.Collections.emptyList();

        private void ensureIntervalsIsMutable() {
          if (!((bitField0_ & 0x00000002) != 0)) {
            intervals_ =
                new java.util.ArrayList<com.google.cloud.discoveryengine.v1beta.Interval>(
                    intervals_);
            bitField0_ |= 0x00000002;
          }
        }

        private com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.discoveryengine.v1beta.Interval,
                com.google.cloud.discoveryengine.v1beta.Interval.Builder,
                com.google.cloud.discoveryengine.v1beta.IntervalOrBuilder>
            intervalsBuilder_;

        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public java.util.List<com.google.cloud.discoveryengine.v1beta.Interval> getIntervalsList() {
          if (intervalsBuilder_ == null) {
            return java.util.Collections.unmodifiableList(intervals_);
          } else {
            return intervalsBuilder_.getMessageList();
          }
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public int getIntervalsCount() {
          if (intervalsBuilder_ == null) {
            return intervals_.size();
          } else {
            return intervalsBuilder_.getCount();
          }
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public com.google.cloud.discoveryengine.v1beta.Interval getIntervals(int index) {
          if (intervalsBuilder_ == null) {
            return intervals_.get(index);
          } else {
            return intervalsBuilder_.getMessage(index);
          }
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public Builder setIntervals(
            int index, com.google.cloud.discoveryengine.v1beta.Interval value) {
          if (intervalsBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureIntervalsIsMutable();
            intervals_.set(index, value);
            onChanged();
          } else {
            intervalsBuilder_.setMessage(index, value);
          }
          return this;
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public Builder setIntervals(
            int index, com.google.cloud.discoveryengine.v1beta.Interval.Builder builderForValue) {
          if (intervalsBuilder_ == null) {
            ensureIntervalsIsMutable();
            intervals_.set(index, builderForValue.build());
            onChanged();
          } else {
            intervalsBuilder_.setMessage(index, builderForValue.build());
          }
          return this;
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public Builder addIntervals(com.google.cloud.discoveryengine.v1beta.Interval value) {
          if (intervalsBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureIntervalsIsMutable();
            intervals_.add(value);
            onChanged();
          } else {
            intervalsBuilder_.addMessage(value);
          }
          return this;
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public Builder addIntervals(
            int index, com.google.cloud.discoveryengine.v1beta.Interval value) {
          if (intervalsBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureIntervalsIsMutable();
            intervals_.add(index, value);
            onChanged();
          } else {
            intervalsBuilder_.addMessage(index, value);
          }
          return this;
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public Builder addIntervals(
            com.google.cloud.discoveryengine.v1beta.Interval.Builder builderForValue) {
          if (intervalsBuilder_ == null) {
            ensureIntervalsIsMutable();
            intervals_.add(builderForValue.build());
            onChanged();
          } else {
            intervalsBuilder_.addMessage(builderForValue.build());
          }
          return this;
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public Builder addIntervals(
            int index, com.google.cloud.discoveryengine.v1beta.Interval.Builder builderForValue) {
          if (intervalsBuilder_ == null) {
            ensureIntervalsIsMutable();
            intervals_.add(index, builderForValue.build());
            onChanged();
          } else {
            intervalsBuilder_.addMessage(index, builderForValue.build());
          }
          return this;
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public Builder addAllIntervals(
            java.lang.Iterable<? extends com.google.cloud.discoveryengine.v1beta.Interval> values) {
          if (intervalsBuilder_ == null) {
            ensureIntervalsIsMutable();
            com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intervals_);
            onChanged();
          } else {
            intervalsBuilder_.addAllMessages(values);
          }
          return this;
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public Builder clearIntervals() {
          if (intervalsBuilder_ == null) {
            intervals_ = java.util.Collections.emptyList();
            bitField0_ = (bitField0_ & ~0x00000002);
            onChanged();
          } else {
            intervalsBuilder_.clear();
          }
          return this;
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public Builder removeIntervals(int index) {
          if (intervalsBuilder_ == null) {
            ensureIntervalsIsMutable();
            intervals_.remove(index);
            onChanged();
          } else {
            intervalsBuilder_.remove(index);
          }
          return this;
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public com.google.cloud.discoveryengine.v1beta.Interval.Builder getIntervalsBuilder(
            int index) {
          return getIntervalsFieldBuilder().getBuilder(index);
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public com.google.cloud.discoveryengine.v1beta.IntervalOrBuilder getIntervalsOrBuilder(
            int index) {
          if (intervalsBuilder_ == null) {
            return intervals_.get(index);
          } else {
            return intervalsBuilder_.getMessageOrBuilder(index);
          }
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public java.util.List<? extends com.google.cloud.discoveryengine.v1beta.IntervalOrBuilder>
            getIntervalsOrBuilderList() {
          if (intervalsBuilder_ != null) {
            return intervalsBuilder_.getMessageOrBuilderList();
          } else {
            return java.util.Collections.unmodifiableList(intervals_);
          }
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public com.google.cloud.discoveryengine.v1beta.Interval.Builder addIntervalsBuilder() {
          return getIntervalsFieldBuilder()
              .addBuilder(com.google.cloud.discoveryengine.v1beta.Interval.getDefaultInstance());
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public com.google.cloud.discoveryengine.v1beta.Interval.Builder addIntervalsBuilder(
            int index) {
          return getIntervalsFieldBuilder()
              .addBuilder(
                  index, com.google.cloud.discoveryengine.v1beta.Interval.getDefaultInstance());
        }
        /**
         *
         *
         * <pre>
         * Set only if values should be bucketized 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.
         * </pre>
         *
         * <code>repeated .google.cloud.discoveryengine.v1beta.Interval intervals = 2;</code>
         */
        public java.util.List<com.google.cloud.discoveryengine.v1beta.Interval.Builder>
            getIntervalsBuilderList() {
          return getIntervalsFieldBuilder().getBuilderList();
        }

        private com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.discoveryengine.v1beta.Interval,
                com.google.cloud.discoveryengine.v1beta.Interval.Builder,
                com.google.cloud.discoveryengine.v1beta.IntervalOrBuilder>
            getIntervalsFieldBuilder() {
          if (intervalsBuilder_ == null) {
            intervalsBuilder_ =
                new com.google.protobuf.RepeatedFieldBuilderV3<
                    com.google.cloud.discoveryengine.v1beta.Interval,
                    com.google.cloud.discoveryengine.v1beta.Interval.Builder,
                    com.google.cloud.discoveryengine.v1beta.IntervalOrBuilder>(
                    intervals_,
                    ((bitField0_ & 0x00000002) != 0),
                    getParentForChildren(),
                    isClean());
            intervals_ = null;
          }
          return intervalsBuilder_;
        }

        private com.google.protobuf.LazyStringList restrictedValues_ =
            com.google.protobuf.LazyStringArrayList.EMPTY;

        private void ensureRestrictedValuesIsMutable() {
          if (!((bitField0_ & 0x00000004) != 0)) {
            restrictedValues_ = new com.google.protobuf.LazyStringArrayList(restrictedValues_);
            bitField0_ |= 0x00000004;
          }
        }
        /**
         *
         *
         * <pre>
         * Only get facet for the given restricted values. Only supported on
         * textual fields. For example, suppose "category" has three values
         * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
         * "restricted_values" to "Action &gt; 2022", the "category" facet will only
         * contain "Action &gt; 2022". Only supported on textual fields. Maximum
         * is 10.
         * </pre>
         *
         * <code>repeated string restricted_values = 3;</code>
         *
         * @return A list containing the restrictedValues.
         */
        public com.google.protobuf.ProtocolStringList getRestrictedValuesList() {
          return restrictedValues_.getUnmodifiableView();
        }
        /**
         *
         *
         * <pre>
         * Only get facet for the given restricted values. Only supported on
         * textual fields. For example, suppose "category" has three values
         * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
         * "restricted_values" to "Action &gt; 2022", the "category" facet will only
         * contain "Action &gt; 2022". Only supported on textual fields. Maximum
         * is 10.
         * </pre>
         *
         * <code>repeated string restricted_values = 3;</code>
         *
         * @return The count of restrictedValues.
         */
        public int getRestrictedValuesCount() {
          return restrictedValues_.size();
        }
        /**
         *
         *
         * <pre>
         * Only get facet for the given restricted values. Only supported on
         * textual fields. For example, suppose "category" has three values
         * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
         * "restricted_values" to "Action &gt; 2022", the "category" facet will only
         * contain "Action &gt; 2022". Only supported on textual fields. Maximum
         * is 10.
         * </pre>
         *
         * <code>repeated string restricted_values = 3;</code>
         *
         * @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);
        }
        /**
         *
         *
         * <pre>
         * Only get facet for the given restricted values. Only supported on
         * textual fields. For example, suppose "category" has three values
         * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
         * "restricted_values" to "Action &gt; 2022", the "category" facet will only
         * contain "Action &gt; 2022". Only supported on textual fields. Maximum
         * is 10.
         * </pre>
         *
         * <code>repeated string restricted_values = 3;</code>
         *
         * @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);
        }
        /**
         *
         *
         * <pre>
         * Only get facet for the given restricted values. Only supported on
         * textual fields. For example, suppose "category" has three values
         * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
         * "restricted_values" to "Action &gt; 2022", the "category" facet will only
         * contain "Action &gt; 2022". Only supported on textual fields. Maximum
         * is 10.
         * </pre>
         *
         * <code>repeated string restricted_values = 3;</code>
         *
         * @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);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet for the given restricted values. Only supported on
         * textual fields. For example, suppose "category" has three values
         * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
         * "restricted_values" to "Action &gt; 2022", the "category" facet will only
         * contain "Action &gt; 2022". Only supported on textual fields. Maximum
         * is 10.
         * </pre>
         *
         * <code>repeated string restricted_values = 3;</code>
         *
         * @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);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet for the given restricted values. Only supported on
         * textual fields. For example, suppose "category" has three values
         * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
         * "restricted_values" to "Action &gt; 2022", the "category" facet will only
         * contain "Action &gt; 2022". Only supported on textual fields. Maximum
         * is 10.
         * </pre>
         *
         * <code>repeated string restricted_values = 3;</code>
         *
         * @param values The restrictedValues to add.
         * @return This builder for chaining.
         */
        public Builder addAllRestrictedValues(java.lang.Iterable<java.lang.String> values) {
          ensureRestrictedValuesIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(values, restrictedValues_);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet for the given restricted values. Only supported on
         * textual fields. For example, suppose "category" has three values
         * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
         * "restricted_values" to "Action &gt; 2022", the "category" facet will only
         * contain "Action &gt; 2022". Only supported on textual fields. Maximum
         * is 10.
         * </pre>
         *
         * <code>repeated string restricted_values = 3;</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearRestrictedValues() {
          restrictedValues_ = com.google.protobuf.LazyStringArrayList.EMPTY;
          bitField0_ = (bitField0_ & ~0x00000004);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet for the given restricted values. Only supported on
         * textual fields. For example, suppose "category" has three values
         * "Action &gt; 2022", "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set
         * "restricted_values" to "Action &gt; 2022", the "category" facet will only
         * contain "Action &gt; 2022". Only supported on textual fields. Maximum
         * is 10.
         * </pre>
         *
         * <code>repeated string restricted_values = 3;</code>
         *
         * @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);
          onChanged();
          return this;
        }

        private com.google.protobuf.LazyStringList prefixes_ =
            com.google.protobuf.LazyStringArrayList.EMPTY;

        private void ensurePrefixesIsMutable() {
          if (!((bitField0_ & 0x00000008) != 0)) {
            prefixes_ = new com.google.protobuf.LazyStringArrayList(prefixes_);
            bitField0_ |= 0x00000008;
          }
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that start with the given string prefix. For
         * example, suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
         * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string prefixes = 4;</code>
         *
         * @return A list containing the prefixes.
         */
        public com.google.protobuf.ProtocolStringList getPrefixesList() {
          return prefixes_.getUnmodifiableView();
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that start with the given string prefix. For
         * example, suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
         * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string prefixes = 4;</code>
         *
         * @return The count of prefixes.
         */
        public int getPrefixesCount() {
          return prefixes_.size();
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that start with the given string prefix. For
         * example, suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
         * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string prefixes = 4;</code>
         *
         * @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);
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that start with the given string prefix. For
         * example, suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
         * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string prefixes = 4;</code>
         *
         * @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);
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that start with the given string prefix. For
         * example, suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
         * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string prefixes = 4;</code>
         *
         * @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);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that start with the given string prefix. For
         * example, suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
         * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string prefixes = 4;</code>
         *
         * @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);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that start with the given string prefix. For
         * example, suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
         * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string prefixes = 4;</code>
         *
         * @param values The prefixes to add.
         * @return This builder for chaining.
         */
        public Builder addAllPrefixes(java.lang.Iterable<java.lang.String> values) {
          ensurePrefixesIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(values, prefixes_);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that start with the given string prefix. For
         * example, suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
         * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string prefixes = 4;</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearPrefixes() {
          prefixes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
          bitField0_ = (bitField0_ & ~0x00000008);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that start with the given string prefix. For
         * example, suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "prefixes" to "Action", the
         * "category" facet will only contain "Action &gt; 2022" and "Action &gt; 2021".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string prefixes = 4;</code>
         *
         * @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);
          onChanged();
          return this;
        }

        private com.google.protobuf.LazyStringList contains_ =
            com.google.protobuf.LazyStringArrayList.EMPTY;

        private void ensureContainsIsMutable() {
          if (!((bitField0_ & 0x00000010) != 0)) {
            contains_ = new com.google.protobuf.LazyStringArrayList(contains_);
            bitField0_ |= 0x00000010;
          }
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that contains the given strings. For example,
         * suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
         * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string contains = 5;</code>
         *
         * @return A list containing the contains.
         */
        public com.google.protobuf.ProtocolStringList getContainsList() {
          return contains_.getUnmodifiableView();
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that contains the given strings. For example,
         * suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
         * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string contains = 5;</code>
         *
         * @return The count of contains.
         */
        public int getContainsCount() {
          return contains_.size();
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that contains the given strings. For example,
         * suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
         * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string contains = 5;</code>
         *
         * @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);
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that contains the given strings. For example,
         * suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
         * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string contains = 5;</code>
         *
         * @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);
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that contains the given strings. For example,
         * suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
         * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string contains = 5;</code>
         *
         * @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);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that contains the given strings. For example,
         * suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
         * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string contains = 5;</code>
         *
         * @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);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that contains the given strings. For example,
         * suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
         * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string contains = 5;</code>
         *
         * @param values The contains to add.
         * @return This builder for chaining.
         */
        public Builder addAllContains(java.lang.Iterable<java.lang.String> values) {
          ensureContainsIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contains_);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that contains the given strings. For example,
         * suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
         * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string contains = 5;</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearContains() {
          contains_ = com.google.protobuf.LazyStringArrayList.EMPTY;
          bitField0_ = (bitField0_ & ~0x00000010);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Only get facet values that contains the given strings. For example,
         * suppose "category" has three values "Action &gt; 2022",
         * "Action &gt; 2021" and "Sci-Fi &gt; 2022". If set "contains" to "2022", the
         * "category" facet will only contain "Action &gt; 2022" and "Sci-Fi &gt; 2022".
         * Only supported on textual fields. Maximum is 10.
         * </pre>
         *
         * <code>repeated string contains = 5;</code>
         *
         * @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);
          onChanged();
          return this;
        }

        private boolean caseInsensitive_;
        /**
         *
         *
         * <pre>
         * True to make facet keys case insensitive when getting faceting
         * values with prefixes or contains; false otherwise.
         * </pre>
         *
         * <code>bool case_insensitive = 6;</code>
         *
         * @return The caseInsensitive.
         */
        @java.lang.Override
        public boolean getCaseInsensitive() {
          return caseInsensitive_;
        }
        /**
         *
         *
         * <pre>
         * True to make facet keys case insensitive when getting faceting
         * values with prefixes or contains; false otherwise.
         * </pre>
         *
         * <code>bool case_insensitive = 6;</code>
         *
         * @param value The caseInsensitive to set.
         * @return This builder for chaining.
         */
        public Builder setCaseInsensitive(boolean value) {

          caseInsensitive_ = value;
          bitField0_ |= 0x00000020;
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * True to make facet keys case insensitive when getting faceting
         * values with prefixes or contains; false otherwise.
         * </pre>
         *
         * <code>bool case_insensitive = 6;</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearCaseInsensitive() {
          bitField0_ = (bitField0_ & ~0x00000020);
          caseInsensitive_ = false;
          onChanged();
          return this;
        }

        private java.lang.Object orderBy_ = "";
        /**
         *
         *
         * <pre>
         * The order in which documents are returned.
         * Allowed values are:
         * * "count desc", which means order by
         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count]
         * descending.
         * * "value desc", which means order by
         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
         * </pre>
         *
         * <code>string order_by = 7;</code>
         *
         * @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;
          }
        }
        /**
         *
         *
         * <pre>
         * The order in which documents are returned.
         * Allowed values are:
         * * "count desc", which means order by
         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count]
         * descending.
         * * "value desc", which means order by
         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
         * </pre>
         *
         * <code>string order_by = 7;</code>
         *
         * @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;
          }
        }
        /**
         *
         *
         * <pre>
         * The order in which documents are returned.
         * Allowed values are:
         * * "count desc", which means order by
         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count]
         * descending.
         * * "value desc", which means order by
         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
         * </pre>
         *
         * <code>string order_by = 7;</code>
         *
         * @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;
        }
        /**
         *
         *
         * <pre>
         * The order in which documents are returned.
         * Allowed values are:
         * * "count desc", which means order by
         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count]
         * descending.
         * * "value desc", which means order by
         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
         * </pre>
         *
         * <code>string order_by = 7;</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearOrderBy() {
          orderBy_ = getDefaultInstance().getOrderBy();
          bitField0_ = (bitField0_ & ~0x00000040);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * The order in which documents are returned.
         * Allowed values are:
         * * "count desc", which means order by
         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1beta.SearchResponse.Facet.FacetValue.count]
         * descending.
         * * "value desc", which means order by
         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec.FacetKey.intervals].
         * </pre>
         *
         * <code>string order_by = 7;</code>
         *
         * @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.v1beta.SearchRequest.FacetSpec.FacetKey)
      }

      // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey)
      private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
          DEFAULT_INSTANCE;

      static {
        DEFAULT_INSTANCE =
            new com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey();
      }

      public static com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
          getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }

      private static final com.google.protobuf.Parser<FacetKey> PARSER =
          new com.google.protobuf.AbstractParser<FacetKey>() {
            @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<FacetKey> parser() {
        return PARSER;
      }

      @java.lang.Override
      public com.google.protobuf.Parser<FacetKey> getParserForType() {
        return PARSER;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
          getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
    }

    public static final int FACET_KEY_FIELD_NUMBER = 1;
    private com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facetKey_;
    /**
     *
     *
     * <pre>
     * Required. The facet key specification.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the facetKey field is set.
     */
    @java.lang.Override
    public boolean hasFacetKey() {
      return facetKey_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required. The facet key specification.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The facetKey.
     */
    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey getFacetKey() {
      return facetKey_ == null
          ? com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
              .getDefaultInstance()
          : facetKey_;
    }
    /**
     *
     *
     * <pre>
     * Required. The facet key specification.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKeyOrBuilder
        getFacetKeyOrBuilder() {
      return facetKey_ == null
          ? com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
              .getDefaultInstance()
          : facetKey_;
    }

    public static final int LIMIT_FIELD_NUMBER = 2;
    private int limit_ = 0;
    /**
     *
     *
     * <pre>
     * 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 will be coerced to 300.
     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>int32 limit = 2;</code>
     *
     * @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.LazyStringList excludedFilterKeys_;
    /**
     *
     *
     * <pre>
     * List of keys to exclude when faceting.
     * By default,
     * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
     * </pre>
     *
     * <code>repeated string excluded_filter_keys = 3;</code>
     *
     * @return A list containing the excludedFilterKeys.
     */
    public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() {
      return excludedFilterKeys_;
    }
    /**
     *
     *
     * <pre>
     * List of keys to exclude when faceting.
     * By default,
     * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
     * </pre>
     *
     * <code>repeated string excluded_filter_keys = 3;</code>
     *
     * @return The count of excludedFilterKeys.
     */
    public int getExcludedFilterKeysCount() {
      return excludedFilterKeys_.size();
    }
    /**
     *
     *
     * <pre>
     * List of keys to exclude when faceting.
     * By default,
     * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
     * </pre>
     *
     * <code>repeated string excluded_filter_keys = 3;</code>
     *
     * @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);
    }
    /**
     *
     *
     * <pre>
     * List of keys to exclude when faceting.
     * By default,
     * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
     * </pre>
     *
     * <code>repeated string excluded_filter_keys = 3;</code>
     *
     * @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;
    /**
     *
     *
     * <pre>
     * Enables dynamic position for this facet. If set to true, the position of
     * this facet among all facets in the response is determined automatically.
     * It will be ordered together with dynamic facets if dynamic
     * facets is enabled. If set to false, the position of this facet in the
     * response will be the same as in the request, and it will be 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 will be 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 enable, which will generate 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" will always be
     * ranked at 1st and 2nd position since their enable_dynamic_position are
     * false.
     * </pre>
     *
     * <code>bool enable_dynamic_position = 4;</code>
     *
     * @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.v1beta.SearchRequest.FacetSpec)) {
        return super.equals(obj);
      }
      com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec other =
          (com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.FacetSpec parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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;
    }
    /**
     *
     *
     * <pre>
     * A facet specification to perform faceted search.
     * </pre>
     *
     * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec)
        com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpecOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_FacetSpec_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_FacetSpec_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.class,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder.class);
      }

      // Construct using
      // com.google.cloud.discoveryengine.v1beta.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.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000004);
        enableDynamicPosition_ = false;
        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_FacetSpec_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec
          getDefaultInstanceForType() {
        return com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec build() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec buildPartial() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec result =
            new com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec(this);
        buildPartialRepeatedFields(result);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartialRepeatedFields(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec result) {
        if (((bitField0_ & 0x00000004) != 0)) {
          excludedFilterKeys_ = excludedFilterKeys_.getUnmodifiableView();
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.excludedFilterKeys_ = excludedFilterKeys_;
      }

      private void buildPartial0(
          com.google.cloud.discoveryengine.v1beta.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_ & 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.v1beta.SearchRequest.FacetSpec) {
          return mergeFrom((com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec other) {
        if (other
            == com.google.cloud.discoveryengine.v1beta.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_ = (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.v1beta.SearchRequest.FacetSpec.FacetKey facetKey_;
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.Builder,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKeyOrBuilder>
          facetKeyBuilder_;
      /**
       *
       *
       * <pre>
       * Required. The facet key specification.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
       * </code>
       *
       * @return Whether the facetKey field is set.
       */
      public boolean hasFacetKey() {
        return ((bitField0_ & 0x00000001) != 0);
      }
      /**
       *
       *
       * <pre>
       * Required. The facet key specification.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
       * </code>
       *
       * @return The facetKey.
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
          getFacetKey() {
        if (facetKeyBuilder_ == null) {
          return facetKey_ == null
              ? com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
                  .getDefaultInstance()
              : facetKey_;
        } else {
          return facetKeyBuilder_.getMessage();
        }
      }
      /**
       *
       *
       * <pre>
       * Required. The facet key specification.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
       * </code>
       */
      public Builder setFacetKey(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey value) {
        if (facetKeyBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          facetKey_ = value;
        } else {
          facetKeyBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Required. The facet key specification.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
       * </code>
       */
      public Builder setFacetKey(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.Builder
              builderForValue) {
        if (facetKeyBuilder_ == null) {
          facetKey_ = builderForValue.build();
        } else {
          facetKeyBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Required. The facet key specification.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
       * </code>
       */
      public Builder mergeFacetKey(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey value) {
        if (facetKeyBuilder_ == null) {
          if (((bitField0_ & 0x00000001) != 0)
              && facetKey_ != null
              && facetKey_
                  != com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
                      .getDefaultInstance()) {
            getFacetKeyBuilder().mergeFrom(value);
          } else {
            facetKey_ = value;
          }
        } else {
          facetKeyBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Required. The facet key specification.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
       * </code>
       */
      public Builder clearFacetKey() {
        bitField0_ = (bitField0_ & ~0x00000001);
        facetKey_ = null;
        if (facetKeyBuilder_ != null) {
          facetKeyBuilder_.dispose();
          facetKeyBuilder_ = null;
        }
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Required. The facet key specification.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
       * </code>
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.Builder
          getFacetKeyBuilder() {
        bitField0_ |= 0x00000001;
        onChanged();
        return getFacetKeyFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * Required. The facet key specification.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
       * </code>
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKeyOrBuilder
          getFacetKeyOrBuilder() {
        if (facetKeyBuilder_ != null) {
          return facetKeyBuilder_.getMessageOrBuilder();
        } else {
          return facetKey_ == null
              ? com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey
                  .getDefaultInstance()
              : facetKey_;
        }
      }
      /**
       *
       *
       * <pre>
       * Required. The facet key specification.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.Builder,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKeyOrBuilder>
          getFacetKeyFieldBuilder() {
        if (facetKeyBuilder_ == null) {
          facetKeyBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey,
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.FacetKey.Builder,
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec
                      .FacetKeyOrBuilder>(getFacetKey(), getParentForChildren(), isClean());
          facetKey_ = null;
        }
        return facetKeyBuilder_;
      }

      private int limit_;
      /**
       *
       *
       * <pre>
       * 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 will be coerced to 300.
       * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
       * </pre>
       *
       * <code>int32 limit = 2;</code>
       *
       * @return The limit.
       */
      @java.lang.Override
      public int getLimit() {
        return limit_;
      }
      /**
       *
       *
       * <pre>
       * 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 will be coerced to 300.
       * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
       * </pre>
       *
       * <code>int32 limit = 2;</code>
       *
       * @param value The limit to set.
       * @return This builder for chaining.
       */
      public Builder setLimit(int value) {

        limit_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * 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 will be coerced to 300.
       * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
       * </pre>
       *
       * <code>int32 limit = 2;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearLimit() {
        bitField0_ = (bitField0_ & ~0x00000002);
        limit_ = 0;
        onChanged();
        return this;
      }

      private com.google.protobuf.LazyStringList excludedFilterKeys_ =
          com.google.protobuf.LazyStringArrayList.EMPTY;

      private void ensureExcludedFilterKeysIsMutable() {
        if (!((bitField0_ & 0x00000004) != 0)) {
          excludedFilterKeys_ = new com.google.protobuf.LazyStringArrayList(excludedFilterKeys_);
          bitField0_ |= 0x00000004;
        }
      }
      /**
       *
       *
       * <pre>
       * List of keys to exclude when faceting.
       * By default,
       * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
       * </pre>
       *
       * <code>repeated string excluded_filter_keys = 3;</code>
       *
       * @return A list containing the excludedFilterKeys.
       */
      public com.google.protobuf.ProtocolStringList getExcludedFilterKeysList() {
        return excludedFilterKeys_.getUnmodifiableView();
      }
      /**
       *
       *
       * <pre>
       * List of keys to exclude when faceting.
       * By default,
       * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
       * </pre>
       *
       * <code>repeated string excluded_filter_keys = 3;</code>
       *
       * @return The count of excludedFilterKeys.
       */
      public int getExcludedFilterKeysCount() {
        return excludedFilterKeys_.size();
      }
      /**
       *
       *
       * <pre>
       * List of keys to exclude when faceting.
       * By default,
       * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
       * </pre>
       *
       * <code>repeated string excluded_filter_keys = 3;</code>
       *
       * @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);
      }
      /**
       *
       *
       * <pre>
       * List of keys to exclude when faceting.
       * By default,
       * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
       * </pre>
       *
       * <code>repeated string excluded_filter_keys = 3;</code>
       *
       * @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);
      }
      /**
       *
       *
       * <pre>
       * List of keys to exclude when faceting.
       * By default,
       * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
       * </pre>
       *
       * <code>repeated string excluded_filter_keys = 3;</code>
       *
       * @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);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * List of keys to exclude when faceting.
       * By default,
       * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
       * </pre>
       *
       * <code>repeated string excluded_filter_keys = 3;</code>
       *
       * @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);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * List of keys to exclude when faceting.
       * By default,
       * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
       * </pre>
       *
       * <code>repeated string excluded_filter_keys = 3;</code>
       *
       * @param values The excludedFilterKeys to add.
       * @return This builder for chaining.
       */
      public Builder addAllExcludedFilterKeys(java.lang.Iterable<java.lang.String> values) {
        ensureExcludedFilterKeysIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, excludedFilterKeys_);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * List of keys to exclude when faceting.
       * By default,
       * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
       * </pre>
       *
       * <code>repeated string excluded_filter_keys = 3;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearExcludedFilterKeys() {
        excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * List of keys to exclude when faceting.
       * By default,
       * [FacetKey.key][google.cloud.discoveryengine.v1beta.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.v1beta.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.
       * </pre>
       *
       * <code>repeated string excluded_filter_keys = 3;</code>
       *
       * @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);
        onChanged();
        return this;
      }

      private boolean enableDynamicPosition_;
      /**
       *
       *
       * <pre>
       * Enables dynamic position for this facet. If set to true, the position of
       * this facet among all facets in the response is determined automatically.
       * It will be ordered together with dynamic facets if dynamic
       * facets is enabled. If set to false, the position of this facet in the
       * response will be the same as in the request, and it will be 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 will be 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 enable, which will generate 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" will always be
       * ranked at 1st and 2nd position since their enable_dynamic_position are
       * false.
       * </pre>
       *
       * <code>bool enable_dynamic_position = 4;</code>
       *
       * @return The enableDynamicPosition.
       */
      @java.lang.Override
      public boolean getEnableDynamicPosition() {
        return enableDynamicPosition_;
      }
      /**
       *
       *
       * <pre>
       * Enables dynamic position for this facet. If set to true, the position of
       * this facet among all facets in the response is determined automatically.
       * It will be ordered together with dynamic facets if dynamic
       * facets is enabled. If set to false, the position of this facet in the
       * response will be the same as in the request, and it will be 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 will be 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 enable, which will generate 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" will always be
       * ranked at 1st and 2nd position since their enable_dynamic_position are
       * false.
       * </pre>
       *
       * <code>bool enable_dynamic_position = 4;</code>
       *
       * @param value The enableDynamicPosition to set.
       * @return This builder for chaining.
       */
      public Builder setEnableDynamicPosition(boolean value) {

        enableDynamicPosition_ = value;
        bitField0_ |= 0x00000008;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Enables dynamic position for this facet. If set to true, the position of
       * this facet among all facets in the response is determined automatically.
       * It will be ordered together with dynamic facets if dynamic
       * facets is enabled. If set to false, the position of this facet in the
       * response will be the same as in the request, and it will be 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 will be 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 enable, which will generate 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" will always be
       * ranked at 1st and 2nd position since their enable_dynamic_position are
       * false.
       * </pre>
       *
       * <code>bool enable_dynamic_position = 4;</code>
       *
       * @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.v1beta.SearchRequest.FacetSpec)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec)
    private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec();
    }

    public static com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<FacetSpec> PARSER =
        new com.google.protobuf.AbstractParser<FacetSpec>() {
          @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<FacetSpec> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<FacetSpec> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface BoostSpecOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
     * </code>
     */
    java.util.List<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec>
        getConditionBoostSpecsList();
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
     * </code>
     */
    com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
        getConditionBoostSpecs(int index);
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
     * </code>
     */
    int getConditionBoostSpecsCount();
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
     * </code>
     */
    java.util.List<
            ? extends
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                    .ConditionBoostSpecOrBuilder>
        getConditionBoostSpecsOrBuilderList();
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
     * </code>
     */
    com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder
        getConditionBoostSpecsOrBuilder(int index);
  }
  /**
   *
   *
   * <pre>
   * Boost specification to boost certain documents.
   * </pre>
   *
   * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec}
   */
  public static final class BoostSpec extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.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();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
          .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_BoostSpec_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_BoostSpec_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.class,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.Builder.class);
    }

    public interface ConditionBoostSpecOrBuilder
        extends
        // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec)
        com.google.protobuf.MessageOrBuilder {

      /**
       *
       *
       * <pre>
       * 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.v1beta.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"))
       * </pre>
       *
       * <code>string condition = 1;</code>
       *
       * @return The condition.
       */
      java.lang.String getCondition();
      /**
       *
       *
       * <pre>
       * 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.v1beta.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"))
       * </pre>
       *
       * <code>string condition = 1;</code>
       *
       * @return The bytes for condition.
       */
      com.google.protobuf.ByteString getConditionBytes();

      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>float boost = 2;</code>
       *
       * @return The boost.
       */
      float getBoost();
    }
    /**
     *
     *
     * <pre>
     * Boost applies to documents which match a condition.
     * </pre>
     *
     * Protobuf type {@code
     * google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec}
     */
    public static final class ConditionBoostSpec extends com.google.protobuf.GeneratedMessageV3
        implements
        // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.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();
      }

      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        return this.unknownFields;
      }

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_BoostSpec_ConditionBoostSpec_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_BoostSpec_ConditionBoostSpec_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                    .class,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                    .Builder.class);
      }

      public static final int CONDITION_FIELD_NUMBER = 1;

      @SuppressWarnings("serial")
      private volatile java.lang.Object condition_ = "";
      /**
       *
       *
       * <pre>
       * 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.v1beta.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"))
       * </pre>
       *
       * <code>string condition = 1;</code>
       *
       * @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;
        }
      }
      /**
       *
       *
       * <pre>
       * 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.v1beta.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"))
       * </pre>
       *
       * <code>string condition = 1;</code>
       *
       * @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;
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>float boost = 2;</code>
       *
       * @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.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec)) {
          return super.equals(obj);
        }
        com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec other =
            (com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec
              .ConditionBoostSpec
          parseFrom(java.nio.ByteBuffer data)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec
              .ConditionBoostSpec
          parseFrom(com.google.protobuf.ByteString data)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec
              .ConditionBoostSpec
          parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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;
      }
      /**
       *
       *
       * <pre>
       * Boost applies to documents which match a condition.
       * </pre>
       *
       * Protobuf type {@code
       * google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec}
       */
      public static final class Builder
          extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
          implements
          // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec)
          com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
              .ConditionBoostSpecOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
          return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
              .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_BoostSpec_ConditionBoostSpec_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_BoostSpec_ConditionBoostSpec_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                      .class,
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                      .Builder.class);
        }

        // Construct using
        // com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchServiceProto
              .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor;
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
            getDefaultInstanceForType() {
          return com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
              .getDefaultInstance();
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
            build() {
          com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
              result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
            buildPartial() {
          com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
              result =
                  new com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                      .ConditionBoostSpec(this);
          if (bitField0_ != 0) {
            buildPartial0(result);
          }
          onBuilt();
          return result;
        }

        private void buildPartial0(
            com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec) {
            return mergeFrom(
                (com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec)
                    other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }

        public Builder mergeFrom(
            com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                other) {
          if (other
              == com.google.cloud.discoveryengine.v1beta.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_ = "";
        /**
         *
         *
         * <pre>
         * 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.v1beta.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"))
         * </pre>
         *
         * <code>string condition = 1;</code>
         *
         * @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;
          }
        }
        /**
         *
         *
         * <pre>
         * 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.v1beta.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"))
         * </pre>
         *
         * <code>string condition = 1;</code>
         *
         * @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;
          }
        }
        /**
         *
         *
         * <pre>
         * 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.v1beta.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"))
         * </pre>
         *
         * <code>string condition = 1;</code>
         *
         * @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;
        }
        /**
         *
         *
         * <pre>
         * 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.v1beta.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"))
         * </pre>
         *
         * <code>string condition = 1;</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearCondition() {
          condition_ = getDefaultInstance().getCondition();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * 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.v1beta.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"))
         * </pre>
         *
         * <code>string condition = 1;</code>
         *
         * @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_;
        /**
         *
         *
         * <pre>
         * 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.
         * </pre>
         *
         * <code>float boost = 2;</code>
         *
         * @return The boost.
         */
        @java.lang.Override
        public float getBoost() {
          return boost_;
        }
        /**
         *
         *
         * <pre>
         * 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.
         * </pre>
         *
         * <code>float boost = 2;</code>
         *
         * @param value The boost to set.
         * @return This builder for chaining.
         */
        public Builder setBoost(float value) {

          boost_ = value;
          bitField0_ |= 0x00000002;
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * 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.
         * </pre>
         *
         * <code>float boost = 2;</code>
         *
         * @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.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec)
      }

      // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec)
      private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
              .ConditionBoostSpec
          DEFAULT_INSTANCE;

      static {
        DEFAULT_INSTANCE =
            new com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                .ConditionBoostSpec();
      }

      public static com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
              .ConditionBoostSpec
          getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }

      private static final com.google.protobuf.Parser<ConditionBoostSpec> PARSER =
          new com.google.protobuf.AbstractParser<ConditionBoostSpec>() {
            @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<ConditionBoostSpec> parser() {
        return PARSER;
      }

      @java.lang.Override
      public com.google.protobuf.Parser<ConditionBoostSpec> getParserForType() {
        return PARSER;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec>
        conditionBoostSpecs_;
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
     * </code>
     */
    @java.lang.Override
    public java.util.List<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec>
        getConditionBoostSpecsList() {
      return conditionBoostSpecs_;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
     * </code>
     */
    @java.lang.Override
    public java.util.List<
            ? extends
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                    .ConditionBoostSpecOrBuilder>
        getConditionBoostSpecsOrBuilderList() {
      return conditionBoostSpecs_;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
     * </code>
     */
    @java.lang.Override
    public int getConditionBoostSpecsCount() {
      return conditionBoostSpecs_.size();
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
        getConditionBoostSpecs(int index) {
      return conditionBoostSpecs_.get(index);
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec)) {
        return super.equals(obj);
      }
      com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec other =
          (com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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;
    }
    /**
     *
     *
     * <pre>
     * Boost specification to boost certain documents.
     * </pre>
     *
     * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec)
        com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpecOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_BoostSpec_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_BoostSpec_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.class,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.Builder.class);
      }

      // Construct using
      // com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_BoostSpec_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
          getDefaultInstanceForType() {
        return com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec build() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec buildPartial() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec result =
            new com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec(this);
        buildPartialRepeatedFields(result);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartialRepeatedFields(
          com.google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.SearchRequest.BoostSpec) {
          return mergeFrom((com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec other) {
        if (other
            == com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                      m =
                          input.readMessage(
                              com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec>
          conditionBoostSpecs_ = java.util.Collections.emptyList();

      private void ensureConditionBoostSpecsIsMutable() {
        if (!((bitField0_ & 0x00000001) != 0)) {
          conditionBoostSpecs_ =
              new java.util.ArrayList<
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                      .ConditionBoostSpec>(conditionBoostSpecs_);
          bitField0_ |= 0x00000001;
        }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                  .Builder,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                  .ConditionBoostSpecOrBuilder>
          conditionBoostSpecsBuilder_;

      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public java.util.List<
              com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec>
          getConditionBoostSpecsList() {
        if (conditionBoostSpecsBuilder_ == null) {
          return java.util.Collections.unmodifiableList(conditionBoostSpecs_);
        } else {
          return conditionBoostSpecsBuilder_.getMessageList();
        }
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public int getConditionBoostSpecsCount() {
        if (conditionBoostSpecsBuilder_ == null) {
          return conditionBoostSpecs_.size();
        } else {
          return conditionBoostSpecsBuilder_.getCount();
        }
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
          getConditionBoostSpecs(int index) {
        if (conditionBoostSpecsBuilder_ == null) {
          return conditionBoostSpecs_.get(index);
        } else {
          return conditionBoostSpecsBuilder_.getMessage(index);
        }
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public Builder setConditionBoostSpecs(
          int index,
          com.google.cloud.discoveryengine.v1beta.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;
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public Builder setConditionBoostSpecs(
          int index,
          com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
              builderForValue) {
        if (conditionBoostSpecsBuilder_ == null) {
          ensureConditionBoostSpecsIsMutable();
          conditionBoostSpecs_.set(index, builderForValue.build());
          onChanged();
        } else {
          conditionBoostSpecsBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public Builder addConditionBoostSpecs(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
              value) {
        if (conditionBoostSpecsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureConditionBoostSpecsIsMutable();
          conditionBoostSpecs_.add(value);
          onChanged();
        } else {
          conditionBoostSpecsBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public Builder addConditionBoostSpecs(
          int index,
          com.google.cloud.discoveryengine.v1beta.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;
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public Builder addConditionBoostSpecs(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
              builderForValue) {
        if (conditionBoostSpecsBuilder_ == null) {
          ensureConditionBoostSpecsIsMutable();
          conditionBoostSpecs_.add(builderForValue.build());
          onChanged();
        } else {
          conditionBoostSpecsBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public Builder addConditionBoostSpecs(
          int index,
          com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec.Builder
              builderForValue) {
        if (conditionBoostSpecsBuilder_ == null) {
          ensureConditionBoostSpecsIsMutable();
          conditionBoostSpecs_.add(index, builderForValue.build());
          onChanged();
        } else {
          conditionBoostSpecsBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public Builder addAllConditionBoostSpecs(
          java.lang.Iterable<
                  ? extends
                      com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                          .ConditionBoostSpec>
              values) {
        if (conditionBoostSpecsBuilder_ == null) {
          ensureConditionBoostSpecsIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conditionBoostSpecs_);
          onChanged();
        } else {
          conditionBoostSpecsBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public Builder clearConditionBoostSpecs() {
        if (conditionBoostSpecsBuilder_ == null) {
          conditionBoostSpecs_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
        } else {
          conditionBoostSpecsBuilder_.clear();
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public Builder removeConditionBoostSpecs(int index) {
        if (conditionBoostSpecsBuilder_ == null) {
          ensureConditionBoostSpecsIsMutable();
          conditionBoostSpecs_.remove(index);
          onChanged();
        } else {
          conditionBoostSpecsBuilder_.remove(index);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
              .Builder
          getConditionBoostSpecsBuilder(int index) {
        return getConditionBoostSpecsFieldBuilder().getBuilder(index);
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
              .ConditionBoostSpecOrBuilder
          getConditionBoostSpecsOrBuilder(int index) {
        if (conditionBoostSpecsBuilder_ == null) {
          return conditionBoostSpecs_.get(index);
        } else {
          return conditionBoostSpecsBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public java.util.List<
              ? extends
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                      .ConditionBoostSpecOrBuilder>
          getConditionBoostSpecsOrBuilderList() {
        if (conditionBoostSpecsBuilder_ != null) {
          return conditionBoostSpecsBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(conditionBoostSpecs_);
        }
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
              .Builder
          addConditionBoostSpecsBuilder() {
        return getConditionBoostSpecsFieldBuilder()
            .addBuilder(
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                    .getDefaultInstance());
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
              .Builder
          addConditionBoostSpecsBuilder(int index) {
        return getConditionBoostSpecsFieldBuilder()
            .addBuilder(
                index,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                    .getDefaultInstance());
      }
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;
       * </code>
       */
      public java.util.List<
              com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                  .Builder>
          getConditionBoostSpecsBuilderList() {
        return getConditionBoostSpecsFieldBuilder().getBuilderList();
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                  .Builder,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                  .ConditionBoostSpecOrBuilder>
          getConditionBoostSpecsFieldBuilder() {
        if (conditionBoostSpecsBuilder_ == null) {
          conditionBoostSpecsBuilder_ =
              new com.google.protobuf.RepeatedFieldBuilderV3<
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                      .ConditionBoostSpec,
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.ConditionBoostSpec
                      .Builder,
                  com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.BoostSpec)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec)
    private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec();
    }

    public static com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<BoostSpec> PARSER =
        new com.google.protobuf.AbstractParser<BoostSpec>() {
          @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<BoostSpec> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<BoostSpec> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface QueryExpansionSpecOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * The condition under which query expansion should occur. Default to
     * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition condition = 1;
     * </code>
     *
     * @return The enum numeric value on the wire for condition.
     */
    int getConditionValue();
    /**
     *
     *
     * <pre>
     * The condition under which query expansion should occur. Default to
     * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition condition = 1;
     * </code>
     *
     * @return The condition.
     */
    com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition
        getCondition();
  }
  /**
   *
   *
   * <pre>
   * Specification to determine under which conditions query expansion should
   * occur.
   * </pre>
   *
   * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec}
   */
  public static final class QueryExpansionSpec extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.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();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
          .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_QueryExpansionSpec_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_QueryExpansionSpec_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.class,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Builder
                  .class);
    }

    /**
     *
     *
     * <pre>
     * Enum describing under which condition query expansion should occur.
     * </pre>
     *
     * Protobuf enum {@code
     * google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition}
     */
    public enum Condition implements com.google.protobuf.ProtocolMessageEnum {
      /**
       *
       *
       * <pre>
       * Unspecified query expansion condition. In this case, server behavior
       * defaults to
       * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
       * </pre>
       *
       * <code>CONDITION_UNSPECIFIED = 0;</code>
       */
      CONDITION_UNSPECIFIED(0),
      /**
       *
       *
       * <pre>
       * Disabled query expansion. Only the exact search query is used, even if
       * [SearchResponse.total_size][google.cloud.discoveryengine.v1beta.SearchResponse.total_size]
       * is zero.
       * </pre>
       *
       * <code>DISABLED = 1;</code>
       */
      DISABLED(1),
      /**
       *
       *
       * <pre>
       * Automatic query expansion built by the Search API.
       * </pre>
       *
       * <code>AUTO = 2;</code>
       */
      AUTO(2),
      UNRECOGNIZED(-1),
      ;

      /**
       *
       *
       * <pre>
       * Unspecified query expansion condition. In this case, server behavior
       * defaults to
       * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
       * </pre>
       *
       * <code>CONDITION_UNSPECIFIED = 0;</code>
       */
      public static final int CONDITION_UNSPECIFIED_VALUE = 0;
      /**
       *
       *
       * <pre>
       * Disabled query expansion. Only the exact search query is used, even if
       * [SearchResponse.total_size][google.cloud.discoveryengine.v1beta.SearchResponse.total_size]
       * is zero.
       * </pre>
       *
       * <code>DISABLED = 1;</code>
       */
      public static final int DISABLED_VALUE = 1;
      /**
       *
       *
       * <pre>
       * Automatic query expansion built by the Search API.
       * </pre>
       *
       * <code>AUTO = 2;</code>
       */
      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<Condition> internalGetValueMap() {
        return internalValueMap;
      }

      private static final com.google.protobuf.Internal.EnumLiteMap<Condition> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<Condition>() {
            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.v1beta.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.v1beta.SearchRequest.QueryExpansionSpec.Condition)
    }

    public static final int CONDITION_FIELD_NUMBER = 1;
    private int condition_ = 0;
    /**
     *
     *
     * <pre>
     * The condition under which query expansion should occur. Default to
     * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition condition = 1;
     * </code>
     *
     * @return The enum numeric value on the wire for condition.
     */
    @java.lang.Override
    public int getConditionValue() {
      return condition_;
    }
    /**
     *
     *
     * <pre>
     * The condition under which query expansion should occur. Default to
     * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition condition = 1;
     * </code>
     *
     * @return The condition.
     */
    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition
        getCondition() {
      com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition result =
          com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition
              .forNumber(condition_);
      return result == null
          ? com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition
              .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 (condition_
          != com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition
              .CONDITION_UNSPECIFIED
              .getNumber()) {
        output.writeEnum(1, condition_);
      }
      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.v1beta.SearchRequest.QueryExpansionSpec.Condition
              .CONDITION_UNSPECIFIED
              .getNumber()) {
        size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, condition_);
      }
      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.QueryExpansionSpec)) {
        return super.equals(obj);
      }
      com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec other =
          (com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec) obj;

      if (condition_ != other.condition_) 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 = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
        parseFrom(java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.QueryExpansionSpec
        parseFrom(com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.QueryExpansionSpec
        parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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;
    }
    /**
     *
     *
     * <pre>
     * Specification to determine under which conditions query expansion should
     * occur.
     * </pre>
     *
     * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec)
        com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpecOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_QueryExpansionSpec_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_QueryExpansionSpec_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.class,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Builder
                    .class);
      }

      // Construct using
      // com.google.cloud.discoveryengine.v1beta.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;
        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_QueryExpansionSpec_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
          getDefaultInstanceForType() {
        return com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec build() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
          buildPartial() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec result =
            new com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.condition_ = condition_;
        }
      }

      @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.QueryExpansionSpec) {
          return mergeFrom(
              (com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec other) {
        if (other
            == com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
                .getDefaultInstance()) return this;
        if (other.condition_ != 0) {
          setConditionValue(other.getConditionValue());
        }
        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
              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;
      /**
       *
       *
       * <pre>
       * The condition under which query expansion should occur. Default to
       * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition condition = 1;
       * </code>
       *
       * @return The enum numeric value on the wire for condition.
       */
      @java.lang.Override
      public int getConditionValue() {
        return condition_;
      }
      /**
       *
       *
       * <pre>
       * The condition under which query expansion should occur. Default to
       * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition condition = 1;
       * </code>
       *
       * @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;
      }
      /**
       *
       *
       * <pre>
       * The condition under which query expansion should occur. Default to
       * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition condition = 1;
       * </code>
       *
       * @return The condition.
       */
      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition
          getCondition() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition result =
            com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition
                .forNumber(condition_);
        return result == null
            ? com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition
                .UNRECOGNIZED
            : result;
      }
      /**
       *
       *
       * <pre>
       * The condition under which query expansion should occur. Default to
       * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition condition = 1;
       * </code>
       *
       * @param value The condition to set.
       * @return This builder for chaining.
       */
      public Builder setCondition(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition
              value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00000001;
        condition_ = value.getNumber();
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The condition under which query expansion should occur. Default to
       * [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition condition = 1;
       * </code>
       *
       * @return This builder for chaining.
       */
      public Builder clearCondition() {
        bitField0_ = (bitField0_ & ~0x00000001);
        condition_ = 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.v1beta.SearchRequest.QueryExpansionSpec)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec)
    private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec();
    }

    public static com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<QueryExpansionSpec> PARSER =
        new com.google.protobuf.AbstractParser<QueryExpansionSpec>() {
          @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<QueryExpansionSpec> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<QueryExpansionSpec> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface SpellCorrectionSpecOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * The mode under which spell correction should take effect to
     * replace the original search query. Default to
     * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1;
     * </code>
     *
     * @return The enum numeric value on the wire for mode.
     */
    int getModeValue();
    /**
     *
     *
     * <pre>
     * The mode under which spell correction should take effect to
     * replace the original search query. Default to
     * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1;
     * </code>
     *
     * @return The mode.
     */
    com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode getMode();
  }
  /**
   *
   *
   * <pre>
   * The specification for query spell correction.
   * </pre>
   *
   * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec}
   */
  public static final class SpellCorrectionSpec extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.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();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
          .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_SpellCorrectionSpec_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_SpellCorrectionSpec_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.class,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Builder
                  .class);
    }

    /**
     *
     *
     * <pre>
     * Enum describing under which mode spell correction should occur.
     * </pre>
     *
     * Protobuf enum {@code
     * google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode}
     */
    public enum Mode implements com.google.protobuf.ProtocolMessageEnum {
      /**
       *
       *
       * <pre>
       * Unspecified spell correction mode. In this case, server behavior
       * defaults to
       * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
       * </pre>
       *
       * <code>MODE_UNSPECIFIED = 0;</code>
       */
      MODE_UNSPECIFIED(0),
      /**
       *
       *
       * <pre>
       * Search API will try to find a spell suggestion if there
       * is any and put in the
       * [SearchResponse.corrected_query][google.cloud.discoveryengine.v1beta.SearchResponse.corrected_query].
       * The spell suggestion will not be used as the search query.
       * </pre>
       *
       * <code>SUGGESTION_ONLY = 1;</code>
       */
      SUGGESTION_ONLY(1),
      /**
       *
       *
       * <pre>
       * Automatic spell correction built by the Search API. Search will
       * be based on the corrected query if found.
       * </pre>
       *
       * <code>AUTO = 2;</code>
       */
      AUTO(2),
      UNRECOGNIZED(-1),
      ;

      /**
       *
       *
       * <pre>
       * Unspecified spell correction mode. In this case, server behavior
       * defaults to
       * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
       * </pre>
       *
       * <code>MODE_UNSPECIFIED = 0;</code>
       */
      public static final int MODE_UNSPECIFIED_VALUE = 0;
      /**
       *
       *
       * <pre>
       * Search API will try to find a spell suggestion if there
       * is any and put in the
       * [SearchResponse.corrected_query][google.cloud.discoveryengine.v1beta.SearchResponse.corrected_query].
       * The spell suggestion will not be used as the search query.
       * </pre>
       *
       * <code>SUGGESTION_ONLY = 1;</code>
       */
      public static final int SUGGESTION_ONLY_VALUE = 1;
      /**
       *
       *
       * <pre>
       * Automatic spell correction built by the Search API. Search will
       * be based on the corrected query if found.
       * </pre>
       *
       * <code>AUTO = 2;</code>
       */
      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<Mode> internalGetValueMap() {
        return internalValueMap;
      }

      private static final com.google.protobuf.Internal.EnumLiteMap<Mode> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<Mode>() {
            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.v1beta.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.v1beta.SearchRequest.SpellCorrectionSpec.Mode)
    }

    public static final int MODE_FIELD_NUMBER = 1;
    private int mode_ = 0;
    /**
     *
     *
     * <pre>
     * The mode under which spell correction should take effect to
     * replace the original search query. Default to
     * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1;
     * </code>
     *
     * @return The enum numeric value on the wire for mode.
     */
    @java.lang.Override
    public int getModeValue() {
      return mode_;
    }
    /**
     *
     *
     * <pre>
     * The mode under which spell correction should take effect to
     * replace the original search query. Default to
     * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1;
     * </code>
     *
     * @return The mode.
     */
    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode
        getMode() {
      com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode result =
          com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.forNumber(
              mode_);
      return result == null
          ? com.google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.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.v1beta.SearchRequest.SpellCorrectionSpec)) {
        return super.equals(obj);
      }
      com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec other =
          (com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.SpellCorrectionSpec
        parseFrom(java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.SpellCorrectionSpec
        parseFrom(com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.SpellCorrectionSpec
        parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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;
    }
    /**
     *
     *
     * <pre>
     * The specification for query spell correction.
     * </pre>
     *
     * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec)
        com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpecOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_SpellCorrectionSpec_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_SpellCorrectionSpec_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.class,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Builder
                    .class);
      }

      // Construct using
      // com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_SpellCorrectionSpec_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
          getDefaultInstanceForType() {
        return com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec build() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
          buildPartial() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec result =
            new com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.SpellCorrectionSpec) {
          return mergeFrom(
              (com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec other) {
        if (other
            == com.google.cloud.discoveryengine.v1beta.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;
      /**
       *
       *
       * <pre>
       * The mode under which spell correction should take effect to
       * replace the original search query. Default to
       * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
       * </pre>
       *
       * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1;
       * </code>
       *
       * @return The enum numeric value on the wire for mode.
       */
      @java.lang.Override
      public int getModeValue() {
        return mode_;
      }
      /**
       *
       *
       * <pre>
       * The mode under which spell correction should take effect to
       * replace the original search query. Default to
       * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
       * </pre>
       *
       * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1;
       * </code>
       *
       * @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;
      }
      /**
       *
       *
       * <pre>
       * The mode under which spell correction should take effect to
       * replace the original search query. Default to
       * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
       * </pre>
       *
       * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1;
       * </code>
       *
       * @return The mode.
       */
      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode
          getMode() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode result =
            com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode
                .forNumber(mode_);
        return result == null
            ? com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode
                .UNRECOGNIZED
            : result;
      }
      /**
       *
       *
       * <pre>
       * The mode under which spell correction should take effect to
       * replace the original search query. Default to
       * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
       * </pre>
       *
       * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1;
       * </code>
       *
       * @param value The mode to set.
       * @return This builder for chaining.
       */
      public Builder setMode(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00000001;
        mode_ = value.getNumber();
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The mode under which spell correction should take effect to
       * replace the original search query. Default to
       * [Mode.AUTO][google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
       * </pre>
       *
       * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Mode mode = 1;
       * </code>
       *
       * @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.v1beta.SearchRequest.SpellCorrectionSpec)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec)
    private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec();
    }

    public static com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<SpellCorrectionSpec> PARSER =
        new com.google.protobuf.AbstractParser<SpellCorrectionSpec>() {
          @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<SpellCorrectionSpec> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<SpellCorrectionSpec> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface ContentSearchSpecOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * If there is no snippet spec provided, there will be no snippet in the
     * search result.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
     * </code>
     *
     * @return Whether the snippetSpec field is set.
     */
    boolean hasSnippetSpec();
    /**
     *
     *
     * <pre>
     * If there is no snippet spec provided, there will be no snippet in the
     * search result.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
     * </code>
     *
     * @return The snippetSpec.
     */
    com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
        getSnippetSpec();
    /**
     *
     *
     * <pre>
     * If there is no snippet spec provided, there will be no snippet in the
     * search result.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
     * </code>
     */
    com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpecOrBuilder
        getSnippetSpecOrBuilder();

    /**
     *
     *
     * <pre>
     * If there is no summary spec provided, there will be no summary in the
     * search response.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
     * </code>
     *
     * @return Whether the summarySpec field is set.
     */
    boolean hasSummarySpec();
    /**
     *
     *
     * <pre>
     * If there is no summary spec provided, there will be no summary in the
     * search response.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
     * </code>
     *
     * @return The summarySpec.
     */
    com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
        getSummarySpec();
    /**
     *
     *
     * <pre>
     * If there is no summary spec provided, there will be no summary in the
     * search response.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
     * </code>
     */
    com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpecOrBuilder
        getSummarySpecOrBuilder();
  }
  /**
   *
   *
   * <pre>
   * The specification that configs the desired behavior of the UCS content
   * search.
   * </pre>
   *
   * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec}
   */
  public static final class ContentSearchSpec extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.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();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
          .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_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_ContentSearchSpec_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.class,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.Builder
                  .class);
    }

    public interface SnippetSpecOrBuilder
        extends
        // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec)
        com.google.protobuf.MessageOrBuilder {

      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>int32 max_snippet_count = 1;</code>
       *
       * @return The maxSnippetCount.
       */
      int getMaxSnippetCount();

      /**
       *
       *
       * <pre>
       * if true, only snippet reference is returned.
       * </pre>
       *
       * <code>bool reference_only = 2;</code>
       *
       * @return The referenceOnly.
       */
      boolean getReferenceOnly();
    }
    /**
     *
     *
     * <pre>
     * The specification that configs the snippet in the search results.
     * </pre>
     *
     * Protobuf type {@code
     * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec}
     */
    public static final class SnippetSpec extends com.google.protobuf.GeneratedMessageV3
        implements
        // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.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();
      }

      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        return this.unknownFields;
      }

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_SnippetSpec_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_ContentSearchSpec_SnippetSpec_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
                    .class,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
                    .Builder.class);
      }

      public static final int MAX_SNIPPET_COUNT_FIELD_NUMBER = 1;
      private int maxSnippetCount_ = 0;
      /**
       *
       *
       * <pre>
       * 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.
       * </pre>
       *
       * <code>int32 max_snippet_count = 1;</code>
       *
       * @return The maxSnippetCount.
       */
      @java.lang.Override
      public int getMaxSnippetCount() {
        return maxSnippetCount_;
      }

      public static final int REFERENCE_ONLY_FIELD_NUMBER = 2;
      private boolean referenceOnly_ = false;
      /**
       *
       *
       * <pre>
       * if true, only snippet reference is returned.
       * </pre>
       *
       * <code>bool reference_only = 2;</code>
       *
       * @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_);
        }
        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_);
        }
        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.ContentSearchSpec.SnippetSpec)) {
          return super.equals(obj);
        }
        com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec other =
            (com.google.cloud.discoveryengine.v1beta.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;
        }
        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.v1beta.SearchRequest.ContentSearchSpec
              .SnippetSpec
          parseFrom(java.nio.ByteBuffer data)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.ContentSearchSpec
              .SnippetSpec
          parseFrom(com.google.protobuf.ByteString data)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.ContentSearchSpec
              .SnippetSpec
          parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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;
      }
      /**
       *
       *
       * <pre>
       * The specification that configs the snippet in the search results.
       * </pre>
       *
       * Protobuf type {@code
       * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec}
       */
      public static final class Builder
          extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
          implements
          // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec)
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
              .SnippetSpecOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
          return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
              .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_SnippetSpec_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_ContentSearchSpec_SnippetSpec_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SnippetSpec.class,
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SnippetSpec.Builder.class);
        }

        // Construct using
        // com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchServiceProto
              .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor;
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
            getDefaultInstanceForType() {
          return com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
              .getDefaultInstance();
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
            build() {
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
              result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
            buildPartial() {
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
              result =
                  new com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SnippetSpec(this);
          if (bitField0_ != 0) {
            buildPartial0(result);
          }
          onBuilt();
          return result;
        }

        private void buildPartial0(
            com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec) {
            return mergeFrom(
                (com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                        .SnippetSpec)
                    other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }

        public Builder mergeFrom(
            com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
                other) {
          if (other
              == com.google.cloud.discoveryengine.v1beta.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 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
                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_;
        /**
         *
         *
         * <pre>
         * 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.
         * </pre>
         *
         * <code>int32 max_snippet_count = 1;</code>
         *
         * @return The maxSnippetCount.
         */
        @java.lang.Override
        public int getMaxSnippetCount() {
          return maxSnippetCount_;
        }
        /**
         *
         *
         * <pre>
         * 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.
         * </pre>
         *
         * <code>int32 max_snippet_count = 1;</code>
         *
         * @param value The maxSnippetCount to set.
         * @return This builder for chaining.
         */
        public Builder setMaxSnippetCount(int value) {

          maxSnippetCount_ = value;
          bitField0_ |= 0x00000001;
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * 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.
         * </pre>
         *
         * <code>int32 max_snippet_count = 1;</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearMaxSnippetCount() {
          bitField0_ = (bitField0_ & ~0x00000001);
          maxSnippetCount_ = 0;
          onChanged();
          return this;
        }

        private boolean referenceOnly_;
        /**
         *
         *
         * <pre>
         * if true, only snippet reference is returned.
         * </pre>
         *
         * <code>bool reference_only = 2;</code>
         *
         * @return The referenceOnly.
         */
        @java.lang.Override
        public boolean getReferenceOnly() {
          return referenceOnly_;
        }
        /**
         *
         *
         * <pre>
         * if true, only snippet reference is returned.
         * </pre>
         *
         * <code>bool reference_only = 2;</code>
         *
         * @param value The referenceOnly to set.
         * @return This builder for chaining.
         */
        public Builder setReferenceOnly(boolean value) {

          referenceOnly_ = value;
          bitField0_ |= 0x00000002;
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * if true, only snippet reference is returned.
         * </pre>
         *
         * <code>bool reference_only = 2;</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearReferenceOnly() {
          bitField0_ = (bitField0_ & ~0x00000002);
          referenceOnly_ = 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.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec)
      }

      // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec)
      private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
              .SnippetSpec
          DEFAULT_INSTANCE;

      static {
        DEFAULT_INSTANCE =
            new com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                .SnippetSpec();
      }

      public static com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
              .SnippetSpec
          getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }

      private static final com.google.protobuf.Parser<SnippetSpec> PARSER =
          new com.google.protobuf.AbstractParser<SnippetSpec>() {
            @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<SnippetSpec> parser() {
        return PARSER;
      }

      @java.lang.Override
      public com.google.protobuf.Parser<SnippetSpec> getParserForType() {
        return PARSER;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
          getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
    }

    public interface SummarySpecOrBuilder
        extends
        // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec)
        com.google.protobuf.MessageOrBuilder {

      /**
       *
       *
       * <pre>
       * The number of top results the summary should be generated from.
       * If the number of returned results is less than summary_result_count,
       * then the summary would be derived from all the results; otherwise, the
       * summary would be derived from the top results.
       * At most 5 results can be used for generating summary.
       * </pre>
       *
       * <code>int32 summary_result_count = 1;</code>
       *
       * @return The summaryResultCount.
       */
      int getSummaryResultCount();
    }
    /**
     *
     *
     * <pre>
     * The specification that configs the summary in the search response.
     * </pre>
     *
     * Protobuf type {@code
     * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec}
     */
    public static final class SummarySpec extends com.google.protobuf.GeneratedMessageV3
        implements
        // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.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() {}

      @java.lang.Override
      @SuppressWarnings({"unused"})
      protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        return new SummarySpec();
      }

      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        return this.unknownFields;
      }

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_SummarySpec_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_ContentSearchSpec_SummarySpec_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
                    .class,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
                    .Builder.class);
      }

      public static final int SUMMARY_RESULT_COUNT_FIELD_NUMBER = 1;
      private int summaryResultCount_ = 0;
      /**
       *
       *
       * <pre>
       * The number of top results the summary should be generated from.
       * If the number of returned results is less than summary_result_count,
       * then the summary would be derived from all the results; otherwise, the
       * summary would be derived from the top results.
       * At most 5 results can be used for generating summary.
       * </pre>
       *
       * <code>int32 summary_result_count = 1;</code>
       *
       * @return The summaryResultCount.
       */
      @java.lang.Override
      public int getSummaryResultCount() {
        return summaryResultCount_;
      }

      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_);
        }
        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_);
        }
        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.ContentSearchSpec.SummarySpec)) {
          return super.equals(obj);
        }
        com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec other =
            (com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec)
                obj;

        if (getSummaryResultCount() != other.getSummaryResultCount()) 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 = (29 * hash) + getUnknownFields().hashCode();
        memoizedHashCode = hash;
        return hash;
      }

      public static com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
              .SummarySpec
          parseFrom(java.nio.ByteBuffer data)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.ContentSearchSpec
              .SummarySpec
          parseFrom(com.google.protobuf.ByteString data)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest.ContentSearchSpec
              .SummarySpec
          parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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;
      }
      /**
       *
       *
       * <pre>
       * The specification that configs the summary in the search response.
       * </pre>
       *
       * Protobuf type {@code
       * google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec}
       */
      public static final class Builder
          extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
          implements
          // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec)
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
              .SummarySpecOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
          return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
              .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_SummarySpec_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_ContentSearchSpec_SummarySpec_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SummarySpec.class,
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SummarySpec.Builder.class);
        }

        // Construct using
        // com.google.cloud.discoveryengine.v1beta.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;
          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_ContentSearchSpec_SummarySpec_descriptor;
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
            getDefaultInstanceForType() {
          return com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
              .getDefaultInstance();
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
            build() {
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
              result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }

        @java.lang.Override
        public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
            buildPartial() {
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
              result =
                  new com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SummarySpec(this);
          if (bitField0_ != 0) {
            buildPartial0(result);
          }
          onBuilt();
          return result;
        }

        private void buildPartial0(
            com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
                result) {
          int from_bitField0_ = bitField0_;
          if (((from_bitField0_ & 0x00000001) != 0)) {
            result.summaryResultCount_ = summaryResultCount_;
          }
        }

        @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.ContentSearchSpec.SummarySpec) {
            return mergeFrom(
                (com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                        .SummarySpec)
                    other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }

        public Builder mergeFrom(
            com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
                other) {
          if (other
              == com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
                  .getDefaultInstance()) return this;
          if (other.getSummaryResultCount() != 0) {
            setSummaryResultCount(other.getSummaryResultCount());
          }
          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
                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_;
        /**
         *
         *
         * <pre>
         * The number of top results the summary should be generated from.
         * If the number of returned results is less than summary_result_count,
         * then the summary would be derived from all the results; otherwise, the
         * summary would be derived from the top results.
         * At most 5 results can be used for generating summary.
         * </pre>
         *
         * <code>int32 summary_result_count = 1;</code>
         *
         * @return The summaryResultCount.
         */
        @java.lang.Override
        public int getSummaryResultCount() {
          return summaryResultCount_;
        }
        /**
         *
         *
         * <pre>
         * The number of top results the summary should be generated from.
         * If the number of returned results is less than summary_result_count,
         * then the summary would be derived from all the results; otherwise, the
         * summary would be derived from the top results.
         * At most 5 results can be used for generating summary.
         * </pre>
         *
         * <code>int32 summary_result_count = 1;</code>
         *
         * @param value The summaryResultCount to set.
         * @return This builder for chaining.
         */
        public Builder setSummaryResultCount(int value) {

          summaryResultCount_ = value;
          bitField0_ |= 0x00000001;
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * The number of top results the summary should be generated from.
         * If the number of returned results is less than summary_result_count,
         * then the summary would be derived from all the results; otherwise, the
         * summary would be derived from the top results.
         * At most 5 results can be used for generating summary.
         * </pre>
         *
         * <code>int32 summary_result_count = 1;</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearSummaryResultCount() {
          bitField0_ = (bitField0_ & ~0x00000001);
          summaryResultCount_ = 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.v1beta.SearchRequest.ContentSearchSpec.SummarySpec)
      }

      // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec)
      private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
              .SummarySpec
          DEFAULT_INSTANCE;

      static {
        DEFAULT_INSTANCE =
            new com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                .SummarySpec();
      }

      public static com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
              .SummarySpec
          getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }

      private static final com.google.protobuf.Parser<SummarySpec> PARSER =
          new com.google.protobuf.AbstractParser<SummarySpec>() {
            @java.lang.Override
            public SummarySpec 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<SummarySpec> parser() {
        return PARSER;
      }

      @java.lang.Override
      public com.google.protobuf.Parser<SummarySpec> getParserForType() {
        return PARSER;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
          getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
    }

    public static final int SNIPPET_SPEC_FIELD_NUMBER = 1;
    private com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
        snippetSpec_;
    /**
     *
     *
     * <pre>
     * If there is no snippet spec provided, there will be no snippet in the
     * search result.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
     * </code>
     *
     * @return Whether the snippetSpec field is set.
     */
    @java.lang.Override
    public boolean hasSnippetSpec() {
      return snippetSpec_ != null;
    }
    /**
     *
     *
     * <pre>
     * If there is no snippet spec provided, there will be no snippet in the
     * search result.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
     * </code>
     *
     * @return The snippetSpec.
     */
    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
        getSnippetSpec() {
      return snippetSpec_ == null
          ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
              .getDefaultInstance()
          : snippetSpec_;
    }
    /**
     *
     *
     * <pre>
     * If there is no snippet spec provided, there will be no snippet in the
     * search result.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
            .SnippetSpecOrBuilder
        getSnippetSpecOrBuilder() {
      return snippetSpec_ == null
          ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
              .getDefaultInstance()
          : snippetSpec_;
    }

    public static final int SUMMARY_SPEC_FIELD_NUMBER = 2;
    private com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
        summarySpec_;
    /**
     *
     *
     * <pre>
     * If there is no summary spec provided, there will be no summary in the
     * search response.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
     * </code>
     *
     * @return Whether the summarySpec field is set.
     */
    @java.lang.Override
    public boolean hasSummarySpec() {
      return summarySpec_ != null;
    }
    /**
     *
     *
     * <pre>
     * If there is no summary spec provided, there will be no summary in the
     * search response.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
     * </code>
     *
     * @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_;
    }
    /**
     *
     *
     * <pre>
     * If there is no summary spec provided, there will be no summary in the
     * search response.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
     * </code>
     */
    @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
    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 (snippetSpec_ != null) {
        output.writeMessage(1, getSnippetSpec());
      }
      if (summarySpec_ != null) {
        output.writeMessage(2, getSummarySpec());
      }
      getUnknownFields().writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      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;
    }

    @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.ContentSearchSpec)) {
        return super.equals(obj);
      }
      com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec other =
          (com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec) obj;

      if (hasSnippetSpec() != other.hasSnippetSpec()) return false;
      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;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (hasSnippetSpec()) {
        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;
    }

    public static com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec 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.ContentSearchSpec parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec 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.ContentSearchSpec parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec 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.ContentSearchSpec 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.ContentSearchSpec 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.ContentSearchSpec
        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.ContentSearchSpec
        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.ContentSearchSpec 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.ContentSearchSpec 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.ContentSearchSpec 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;
    }
    /**
     *
     *
     * <pre>
     * The specification that configs the desired behavior of the UCS content
     * search.
     * </pre>
     *
     * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec)
        com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpecOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_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_ContentSearchSpec_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.class,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.Builder
                    .class);
      }

      // Construct using
      // com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.newBuilder()
      private Builder() {}

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        snippetSpec_ = null;
        if (snippetSpecBuilder_ != null) {
          snippetSpecBuilder_.dispose();
          snippetSpecBuilder_ = null;
        }
        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.v1beta.SearchServiceProto
            .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ContentSearchSpec_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
          getDefaultInstanceForType() {
        return com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec build() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
          buildPartial() {
        com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec result =
            new com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.snippetSpec_ =
              snippetSpecBuilder_ == null ? snippetSpec_ : snippetSpecBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000002) != 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.v1beta.SearchRequest.ContentSearchSpec) {
          return mergeFrom(
              (com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec other) {
        if (other
            == com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                .getDefaultInstance()) return this;
        if (other.hasSnippetSpec()) {
          mergeSnippetSpec(other.getSnippetSpec());
        }
        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:
                {
                  input.readMessage(getSnippetSpecFieldBuilder().getBuilder(), extensionRegistry);
                  bitField0_ |= 0x00000001;
                  break;
                } // case 10
              case 18:
                {
                  input.readMessage(getSummarySpecFieldBuilder().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.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
          snippetSpec_;
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
                  .Builder,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                  .SnippetSpecOrBuilder>
          snippetSpecBuilder_;
      /**
       *
       *
       * <pre>
       * If there is no snippet spec provided, there will be no snippet in the
       * search result.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
       * </code>
       *
       * @return Whether the snippetSpec field is set.
       */
      public boolean hasSnippetSpec() {
        return ((bitField0_ & 0x00000001) != 0);
      }
      /**
       *
       *
       * <pre>
       * If there is no snippet spec provided, there will be no snippet in the
       * search result.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
       * </code>
       *
       * @return The snippetSpec.
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
          getSnippetSpec() {
        if (snippetSpecBuilder_ == null) {
          return snippetSpec_ == null
              ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
                  .getDefaultInstance()
              : snippetSpec_;
        } else {
          return snippetSpecBuilder_.getMessage();
        }
      }
      /**
       *
       *
       * <pre>
       * If there is no snippet spec provided, there will be no snippet in the
       * search result.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
       * </code>
       */
      public Builder setSnippetSpec(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
              value) {
        if (snippetSpecBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          snippetSpec_ = value;
        } else {
          snippetSpecBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * If there is no snippet spec provided, there will be no snippet in the
       * search result.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
       * </code>
       */
      public Builder setSnippetSpec(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
                  .Builder
              builderForValue) {
        if (snippetSpecBuilder_ == null) {
          snippetSpec_ = builderForValue.build();
        } else {
          snippetSpecBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * If there is no snippet spec provided, there will be no snippet in the
       * search result.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
       * </code>
       */
      public Builder mergeSnippetSpec(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
              value) {
        if (snippetSpecBuilder_ == null) {
          if (((bitField0_ & 0x00000001) != 0)
              && snippetSpec_ != null
              && snippetSpec_
                  != com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SnippetSpec.getDefaultInstance()) {
            getSnippetSpecBuilder().mergeFrom(value);
          } else {
            snippetSpec_ = value;
          }
        } else {
          snippetSpecBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * If there is no snippet spec provided, there will be no snippet in the
       * search result.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
       * </code>
       */
      public Builder clearSnippetSpec() {
        bitField0_ = (bitField0_ & ~0x00000001);
        snippetSpec_ = null;
        if (snippetSpecBuilder_ != null) {
          snippetSpecBuilder_.dispose();
          snippetSpecBuilder_ = null;
        }
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * If there is no snippet spec provided, there will be no snippet in the
       * search result.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
       * </code>
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
              .Builder
          getSnippetSpecBuilder() {
        bitField0_ |= 0x00000001;
        onChanged();
        return getSnippetSpecFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * If there is no snippet spec provided, there will be no snippet in the
       * search result.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
       * </code>
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
              .SnippetSpecOrBuilder
          getSnippetSpecOrBuilder() {
        if (snippetSpecBuilder_ != null) {
          return snippetSpecBuilder_.getMessageOrBuilder();
        } else {
          return snippetSpec_ == null
              ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
                  .getDefaultInstance()
              : snippetSpec_;
        }
      }
      /**
       *
       *
       * <pre>
       * If there is no snippet spec provided, there will be no snippet in the
       * search result.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1;
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SnippetSpec
                  .Builder,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                  .SnippetSpecOrBuilder>
          getSnippetSpecFieldBuilder() {
        if (snippetSpecBuilder_ == null) {
          snippetSpecBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SnippetSpec,
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SnippetSpec.Builder,
                  com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SnippetSpecOrBuilder>(getSnippetSpec(), getParentForChildren(), isClean());
          snippetSpec_ = null;
        }
        return snippetSpecBuilder_;
      }

      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_;
      /**
       *
       *
       * <pre>
       * If there is no summary spec provided, there will be no summary in the
       * search response.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
       * </code>
       *
       * @return Whether the summarySpec field is set.
       */
      public boolean hasSummarySpec() {
        return ((bitField0_ & 0x00000002) != 0);
      }
      /**
       *
       *
       * <pre>
       * If there is no summary spec provided, there will be no summary in the
       * search response.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
       * </code>
       *
       * @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();
        }
      }
      /**
       *
       *
       * <pre>
       * If there is no summary spec provided, there will be no summary in the
       * search response.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
       * </code>
       */
      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_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * If there is no summary spec provided, there will be no summary in the
       * search response.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
       * </code>
       */
      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_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * If there is no summary spec provided, there will be no summary in the
       * search response.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
       * </code>
       */
      public Builder mergeSummarySpec(
          com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
              value) {
        if (summarySpecBuilder_ == null) {
          if (((bitField0_ & 0x00000002) != 0)
              && summarySpec_ != null
              && summarySpec_
                  != com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                      .SummarySpec.getDefaultInstance()) {
            getSummarySpecBuilder().mergeFrom(value);
          } else {
            summarySpec_ = value;
          }
        } else {
          summarySpecBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * If there is no summary spec provided, there will be no summary in the
       * search response.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
       * </code>
       */
      public Builder clearSummarySpec() {
        bitField0_ = (bitField0_ & ~0x00000002);
        summarySpec_ = null;
        if (summarySpecBuilder_ != null) {
          summarySpecBuilder_.dispose();
          summarySpecBuilder_ = null;
        }
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * If there is no summary spec provided, there will be no summary in the
       * search response.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
       * </code>
       */
      public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec
              .Builder
          getSummarySpecBuilder() {
        bitField0_ |= 0x00000002;
        onChanged();
        return getSummarySpecFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * If there is no summary spec provided, there will be no summary in the
       * search response.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
       * </code>
       */
      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_;
        }
      }
      /**
       *
       *
       * <pre>
       * If there is no summary spec provided, there will be no summary in the
       * search response.
       * </pre>
       *
       * <code>
       * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2;
       * </code>
       */
      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);
      }

      @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.ContentSearchSpec)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec)
    private static final com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec();
    }

    public static com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ContentSearchSpec> PARSER =
        new com.google.protobuf.AbstractParser<ContentSearchSpec>() {
          @java.lang.Override
          public ContentSearchSpec 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<ContentSearchSpec> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<ContentSearchSpec> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public static final int SERVING_CONFIG_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object servingConfig_ = "";
  /**
   *
   *
   * <pre>
   * Required. The resource name of the Search serving config, such as
   * `projects/&#42;&#47;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.
   * </pre>
   *
   * <code>
   * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @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;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The resource name of the Search serving config, such as
   * `projects/&#42;&#47;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.
   * </pre>
   *
   * <code>
   * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @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 BRANCH_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object branch_ = "";
  /**
   *
   *
   * <pre>
   * The branch resource name, such as
   * `projects/&#42;&#47;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.
   * </pre>
   *
   * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The branch.
   */
  @java.lang.Override
  public java.lang.String getBranch() {
    java.lang.Object ref = branch_;
    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();
      branch_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The branch resource name, such as
   * `projects/&#42;&#47;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.
   * </pre>
   *
   * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for branch.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getBranchBytes() {
    java.lang.Object ref = branch_;
    if (ref instanceof java.lang.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;
    }
  }

  public static final int QUERY_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object query_ = "";
  /**
   *
   *
   * <pre>
   * Raw search query.
   * </pre>
   *
   * <code>string query = 3;</code>
   *
   * @return The query.
   */
  @java.lang.Override
  public java.lang.String getQuery() {
    java.lang.Object ref = query_;
    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();
      query_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Raw search query.
   * </pre>
   *
   * <code>string query = 3;</code>
   *
   * @return The bytes for query.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getQueryBytes() {
    java.lang.Object ref = query_;
    if (ref instanceof java.lang.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;
    }
  }

  public static final int PAGE_SIZE_FIELD_NUMBER = 4;
  private int pageSize_ = 0;
  /**
   *
   *
   * <pre>
   * Maximum number of [Document][google.cloud.discoveryengine.v1beta.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.
   * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
   * </pre>
   *
   * <code>int32 page_size = 4;</code>
   *
   * @return The pageSize.
   */
  @java.lang.Override
  public int getPageSize() {
    return pageSize_;
  }

  public static final int PAGE_TOKEN_FIELD_NUMBER = 5;

  @SuppressWarnings("serial")
  private volatile java.lang.Object pageToken_ = "";
  /**
   *
   *
   * <pre>
   * A page token received from a previous
   * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
   * call. Provide this to retrieve the subsequent page.
   * When paginating, all other parameters provided to
   * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
   * must match the call that provided the page token. Otherwise, an
   *  `INVALID_ARGUMENT`  error is returned.
   * </pre>
   *
   * <code>string page_token = 5;</code>
   *
   * @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;
    }
  }
  /**
   *
   *
   * <pre>
   * A page token received from a previous
   * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
   * call. Provide this to retrieve the subsequent page.
   * When paginating, all other parameters provided to
   * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
   * must match the call that provided the page token. Otherwise, an
   *  `INVALID_ARGUMENT`  error is returned.
   * </pre>
   *
   * <code>string page_token = 5;</code>
   *
   * @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;
  /**
   *
   *
   * <pre>
   * A 0-indexed integer that specifies the current offset (that is, starting
   * result location, amongst the
   * [Document][google.cloud.discoveryengine.v1beta.Document]s deemed by the API
   * as relevant) in search results. This field is only considered if
   * [page_token][google.cloud.discoveryengine.v1beta.SearchRequest.page_token]
   * is unset.
   * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
   * </pre>
   *
   * <code>int32 offset = 6;</code>
   *
   * @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_ = "";
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>string filter = 7;</code>
   *
   * @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;
    }
  }
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>string filter = 7;</code>
   *
   * @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_ = "";
  /**
   *
   *
   * <pre>
   * The order in which documents are returned. Document can be ordered by
   * a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
   * object. Leave it unset if ordered by relevance. OrderBy expression is
   * case-sensitive.
   * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
   * </pre>
   *
   * <code>string order_by = 8;</code>
   *
   * @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;
    }
  }
  /**
   *
   *
   * <pre>
   * The order in which documents are returned. Document can be ordered by
   * a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
   * object. Leave it unset if ordered by relevance. OrderBy expression is
   * case-sensitive.
   * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
   * </pre>
   *
   * <code>string order_by = 8;</code>
   *
   * @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 FACET_SPECS_FIELD_NUMBER = 9;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec>
      facetSpecs_;
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
   * </code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec>
      getFacetSpecsList() {
    return facetSpecs_;
  }
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
   * </code>
   */
  @java.lang.Override
  public java.util.List<
          ? extends com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpecOrBuilder>
      getFacetSpecsOrBuilderList() {
    return facetSpecs_;
  }
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
   * </code>
   */
  @java.lang.Override
  public int getFacetSpecsCount() {
    return facetSpecs_.size();
  }
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec getFacetSpecs(int index) {
    return facetSpecs_.get(index);
  }
  /**
   *
   *
   * <pre>
   * 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.
   * </pre>
   *
   * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpecOrBuilder
      getFacetSpecsOrBuilder(int index) {
    return facetSpecs_.get(index);
  }

  public static final int BOOST_SPEC_FIELD_NUMBER = 10;
  private com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boostSpec_;
  /**
   *
   *
   * <pre>
   * Boost specification to boost certain documents.
   * </pre>
   *
   * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
   *
   * @return Whether the boostSpec field is set.
   */
  @java.lang.Override
  public boolean hasBoostSpec() {
    return boostSpec_ != null;
  }
  /**
   *
   *
   * <pre>
   * Boost specification to boost certain documents.
   * </pre>
   *
   * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
   *
   * @return The boostSpec.
   */
  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec getBoostSpec() {
    return boostSpec_ == null
        ? com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.getDefaultInstance()
        : boostSpec_;
  }
  /**
   *
   *
   * <pre>
   * Boost specification to boost certain documents.
   * </pre>
   *
   * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
   */
  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpecOrBuilder
      getBoostSpecOrBuilder() {
    return boostSpec_ == null
        ? com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.getDefaultInstance()
        : boostSpec_;
  }

  public static final int PARAMS_FIELD_NUMBER = 11;

  private static final class ParamsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.Value>
        defaultEntry =
            com.google.protobuf.MapEntry
                .<java.lang.String, com.google.protobuf.Value>newDefaultInstance(
                    com.google.cloud.discoveryengine.v1beta.SearchServiceProto
                        .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_ParamsEntry_descriptor,
                    com.google.protobuf.WireFormat.FieldType.STRING,
                    "",
                    com.google.protobuf.WireFormat.FieldType.MESSAGE,
                    com.google.protobuf.Value.getDefaultInstance());
  }

  @SuppressWarnings("serial")
  private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value> params_;

  private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value>
      internalGetParams() {
    if (params_ == null) {
      return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry);
    }
    return params_;
  }

  public int getParamsCount() {
    return internalGetParams().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * Additional search parameters.
   * For
   * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
   * vertical, supported values are:
   * * `user_country_code`: string. Default empty. If set to non-empty, results
   *    are restricted or boosted based on the location provided.
   * * `search_type`: double. Default empty. Enables non-webpage searching
   *   depending on the value. The only valid non-default value is 1,
   *   which enables image searching.
   * This field is ignored for other verticals.
   * </pre>
   *
   * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
   */
  @java.lang.Override
  public boolean containsParams(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetParams().getMap().containsKey(key);
  }
  /** Use {@link #getParamsMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, com.google.protobuf.Value> getParams() {
    return getParamsMap();
  }
  /**
   *
   *
   * <pre>
   * Additional search parameters.
   * For
   * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
   * vertical, supported values are:
   * * `user_country_code`: string. Default empty. If set to non-empty, results
   *    are restricted or boosted based on the location provided.
   * * `search_type`: double. Default empty. Enables non-webpage searching
   *   depending on the value. The only valid non-default value is 1,
   *   which enables image searching.
   * This field is ignored for other verticals.
   * </pre>
   *
   * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, com.google.protobuf.Value> getParamsMap() {
    return internalGetParams().getMap();
  }
  /**
   *
   *
   * <pre>
   * Additional search parameters.
   * For
   * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
   * vertical, supported values are:
   * * `user_country_code`: string. Default empty. If set to non-empty, results
   *    are restricted or boosted based on the location provided.
   * * `search_type`: double. Default empty. Enables non-webpage searching
   *   depending on the value. The only valid non-default value is 1,
   *   which enables image searching.
   * This field is ignored for other verticals.
   * </pre>
   *
   * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
   */
  @java.lang.Override
  public /* nullable */ com.google.protobuf.Value getParamsOrDefault(
      java.lang.String key,
      /* nullable */
      com.google.protobuf.Value defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, com.google.protobuf.Value> map = internalGetParams().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * Additional search parameters.
   * For
   * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
   * vertical, supported values are:
   * * `user_country_code`: string. Default empty. If set to non-empty, results
   *    are restricted or boosted based on the location provided.
   * * `search_type`: double. Default empty. Enables non-webpage searching
   *   depending on the value. The only valid non-default value is 1,
   *   which enables image searching.
   * This field is ignored for other verticals.
   * </pre>
   *
   * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
   */
  @java.lang.Override
  public com.google.protobuf.Value getParamsOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, com.google.protobuf.Value> map = internalGetParams().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int QUERY_EXPANSION_SPEC_FIELD_NUMBER = 13;
  private com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
      queryExpansionSpec_;
  /**
   *
   *
   * <pre>
   * The query expansion specification that specifies the conditions under which
   * query expansion will occur.
   * </pre>
   *
   * <code>
   * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
   * </code>
   *
   * @return Whether the queryExpansionSpec field is set.
   */
  @java.lang.Override
  public boolean hasQueryExpansionSpec() {
    return queryExpansionSpec_ != null;
  }
  /**
   *
   *
   * <pre>
   * The query expansion specification that specifies the conditions under which
   * query expansion will occur.
   * </pre>
   *
   * <code>
   * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
   * </code>
   *
   * @return The queryExpansionSpec.
   */
  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
      getQueryExpansionSpec() {
    return queryExpansionSpec_ == null
        ? com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
            .getDefaultInstance()
        : queryExpansionSpec_;
  }
  /**
   *
   *
   * <pre>
   * The query expansion specification that specifies the conditions under which
   * query expansion will occur.
   * </pre>
   *
   * <code>
   * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpecOrBuilder
      getQueryExpansionSpecOrBuilder() {
    return queryExpansionSpec_ == null
        ? com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
            .getDefaultInstance()
        : queryExpansionSpec_;
  }

  public static final int SPELL_CORRECTION_SPEC_FIELD_NUMBER = 14;
  private com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
      spellCorrectionSpec_;
  /**
   *
   *
   * <pre>
   * The spell correction specification that specifies the mode under
   * which spell correction will take effect.
   * </pre>
   *
   * <code>
   * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
   * </code>
   *
   * @return Whether the spellCorrectionSpec field is set.
   */
  @java.lang.Override
  public boolean hasSpellCorrectionSpec() {
    return spellCorrectionSpec_ != null;
  }
  /**
   *
   *
   * <pre>
   * The spell correction specification that specifies the mode under
   * which spell correction will take effect.
   * </pre>
   *
   * <code>
   * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
   * </code>
   *
   * @return The spellCorrectionSpec.
   */
  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
      getSpellCorrectionSpec() {
    return spellCorrectionSpec_ == null
        ? com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
            .getDefaultInstance()
        : spellCorrectionSpec_;
  }
  /**
   *
   *
   * <pre>
   * The spell correction specification that specifies the mode under
   * which spell correction will take effect.
   * </pre>
   *
   * <code>
   * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpecOrBuilder
      getSpellCorrectionSpecOrBuilder() {
    return spellCorrectionSpec_ == null
        ? com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
            .getDefaultInstance()
        : spellCorrectionSpec_;
  }

  public static final int USER_PSEUDO_ID_FIELD_NUMBER = 15;

  @SuppressWarnings("serial")
  private volatile java.lang.Object userPseudoId_ = "";
  /**
   *
   *
   * <pre>
   * 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.v1beta.UserEvent.user_pseudo_id]
   * and
   * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.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.
   * </pre>
   *
   * <code>string user_pseudo_id = 15;</code>
   *
   * @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;
    }
  }
  /**
   *
   *
   * <pre>
   * 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.v1beta.UserEvent.user_pseudo_id]
   * and
   * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.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.
   * </pre>
   *
   * <code>string user_pseudo_id = 15;</code>
   *
   * @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.v1beta.SearchRequest.ContentSearchSpec
      contentSearchSpec_;
  /**
   *
   *
   * <pre>
   * The content search spec that configs the desired behavior of content
   * search.
   * </pre>
   *
   * <code>
   * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
   * </code>
   *
   * @return Whether the contentSearchSpec field is set.
   */
  @java.lang.Override
  public boolean hasContentSearchSpec() {
    return contentSearchSpec_ != null;
  }
  /**
   *
   *
   * <pre>
   * The content search spec that configs the desired behavior of content
   * search.
   * </pre>
   *
   * <code>
   * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
   * </code>
   *
   * @return The contentSearchSpec.
   */
  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
      getContentSearchSpec() {
    return contentSearchSpec_ == null
        ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
            .getDefaultInstance()
        : contentSearchSpec_;
  }
  /**
   *
   *
   * <pre>
   * The content search spec that configs the desired behavior of content
   * search.
   * </pre>
   *
   * <code>
   * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpecOrBuilder
      getContentSearchSpecOrBuilder() {
    return contentSearchSpec_ == null
        ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
            .getDefaultInstance()
        : contentSearchSpec_;
  }

  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 (contentSearchSpec_ != null) {
      output.writeMessage(24, getContentSearchSpec());
    }
    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(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<java.lang.String, com.google.protobuf.Value> entry :
        internalGetParams().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.Value> 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 (contentSearchSpec_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getContentSearchSpec());
    }
    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)) {
      return super.equals(obj);
    }
    com.google.cloud.discoveryengine.v1beta.SearchRequest other =
        (com.google.cloud.discoveryengine.v1beta.SearchRequest) obj;

    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 (!getFilter().equals(other.getFilter())) return false;
    if (!getOrderBy().equals(other.getOrderBy())) 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 (!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) + 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();
    hash = (37 * hash) + FILTER_FIELD_NUMBER;
    hash = (53 * hash) + getFilter().hashCode();
    hash = (37 * hash) + ORDER_BY_FIELD_NUMBER;
    hash = (53 * hash) + getOrderBy().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 = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.discoveryengine.v1beta.SearchRequest parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.discoveryengine.v1beta.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.v1beta.SearchRequest 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 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 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 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 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 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 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;
  }
  /**
   *
   *
   * <pre>
   * Request message for
   * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
   * method.
   * </pre>
   *
   * Protobuf type {@code google.cloud.discoveryengine.v1beta.SearchRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.SearchRequest)
      com.google.cloud.discoveryengine.v1beta.SearchRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
          .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 11:
          return internalGetParams();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
      switch (number) {
        case 11:
          return internalGetMutableParams();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.discoveryengine.v1beta.SearchServiceProto
          .internal_static_google_cloud_discoveryengine_v1beta_SearchRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.discoveryengine.v1beta.SearchRequest.class,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.Builder.class);
    }

    // Construct using com.google.cloud.discoveryengine.v1beta.SearchRequest.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      servingConfig_ = "";
      branch_ = "";
      query_ = "";
      pageSize_ = 0;
      pageToken_ = "";
      offset_ = 0;
      filter_ = "";
      orderBy_ = "";
      if (facetSpecsBuilder_ == null) {
        facetSpecs_ = java.util.Collections.emptyList();
      } else {
        facetSpecs_ = null;
        facetSpecsBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000100);
      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;
      }
      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_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest getDefaultInstanceForType() {
      return com.google.cloud.discoveryengine.v1beta.SearchRequest.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest build() {
      com.google.cloud.discoveryengine.v1beta.SearchRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.discoveryengine.v1beta.SearchRequest buildPartial() {
      com.google.cloud.discoveryengine.v1beta.SearchRequest result =
          new com.google.cloud.discoveryengine.v1beta.SearchRequest(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(
        com.google.cloud.discoveryengine.v1beta.SearchRequest result) {
      if (facetSpecsBuilder_ == null) {
        if (((bitField0_ & 0x00000100) != 0)) {
          facetSpecs_ = java.util.Collections.unmodifiableList(facetSpecs_);
          bitField0_ = (bitField0_ & ~0x00000100);
        }
        result.facetSpecs_ = facetSpecs_;
      } else {
        result.facetSpecs_ = facetSpecsBuilder_.build();
      }
    }

    private void buildPartial0(com.google.cloud.discoveryengine.v1beta.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.filter_ = filter_;
      }
      if (((from_bitField0_ & 0x00000080) != 0)) {
        result.orderBy_ = orderBy_;
      }
      if (((from_bitField0_ & 0x00000200) != 0)) {
        result.boostSpec_ = boostSpecBuilder_ == null ? boostSpec_ : boostSpecBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000400) != 0)) {
        result.params_ = internalGetParams();
        result.params_.makeImmutable();
      }
      if (((from_bitField0_ & 0x00000800) != 0)) {
        result.queryExpansionSpec_ =
            queryExpansionSpecBuilder_ == null
                ? queryExpansionSpec_
                : queryExpansionSpecBuilder_.build();
      }
      if (((from_bitField0_ & 0x00001000) != 0)) {
        result.spellCorrectionSpec_ =
            spellCorrectionSpecBuilder_ == null
                ? spellCorrectionSpec_
                : spellCorrectionSpecBuilder_.build();
      }
      if (((from_bitField0_ & 0x00002000) != 0)) {
        result.userPseudoId_ = userPseudoId_;
      }
      if (((from_bitField0_ & 0x00004000) != 0)) {
        result.contentSearchSpec_ =
            contentSearchSpecBuilder_ == null
                ? contentSearchSpec_
                : contentSearchSpecBuilder_.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.SearchRequest) {
        return mergeFrom((com.google.cloud.discoveryengine.v1beta.SearchRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.discoveryengine.v1beta.SearchRequest other) {
      if (other == com.google.cloud.discoveryengine.v1beta.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.getFilter().isEmpty()) {
        filter_ = other.filter_;
        bitField0_ |= 0x00000040;
        onChanged();
      }
      if (!other.getOrderBy().isEmpty()) {
        orderBy_ = other.orderBy_;
        bitField0_ |= 0x00000080;
        onChanged();
      }
      if (facetSpecsBuilder_ == null) {
        if (!other.facetSpecs_.isEmpty()) {
          if (facetSpecs_.isEmpty()) {
            facetSpecs_ = other.facetSpecs_;
            bitField0_ = (bitField0_ & ~0x00000100);
          } else {
            ensureFacetSpecsIsMutable();
            facetSpecs_.addAll(other.facetSpecs_);
          }
          onChanged();
        }
      } else {
        if (!other.facetSpecs_.isEmpty()) {
          if (facetSpecsBuilder_.isEmpty()) {
            facetSpecsBuilder_.dispose();
            facetSpecsBuilder_ = null;
            facetSpecs_ = other.facetSpecs_;
            bitField0_ = (bitField0_ & ~0x00000100);
            facetSpecsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getFacetSpecsFieldBuilder()
                    : null;
          } else {
            facetSpecsBuilder_.addAllMessages(other.facetSpecs_);
          }
        }
      }
      if (other.hasBoostSpec()) {
        mergeBoostSpec(other.getBoostSpec());
      }
      internalGetMutableParams().mergeFrom(other.internalGetParams());
      bitField0_ |= 0x00000400;
      if (other.hasQueryExpansionSpec()) {
        mergeQueryExpansionSpec(other.getQueryExpansionSpec());
      }
      if (other.hasSpellCorrectionSpec()) {
        mergeSpellCorrectionSpec(other.getSpellCorrectionSpec());
      }
      if (!other.getUserPseudoId().isEmpty()) {
        userPseudoId_ = other.userPseudoId_;
        bitField0_ |= 0x00002000;
        onChanged();
      }
      if (other.hasContentSearchSpec()) {
        mergeContentSearchSpec(other.getContentSearchSpec());
      }
      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:
              {
                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 58:
              {
                filter_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000040;
                break;
              } // case 58
            case 66:
              {
                orderBy_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000080;
                break;
              } // case 66
            case 74:
              {
                com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec m =
                    input.readMessage(
                        com.google.cloud.discoveryengine.v1beta.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_ |= 0x00000200;
                break;
              } // case 82
            case 90:
              {
                com.google.protobuf.MapEntry<java.lang.String, com.google.protobuf.Value> params__ =
                    input.readMessage(
                        ParamsDefaultEntryHolder.defaultEntry.getParserForType(),
                        extensionRegistry);
                internalGetMutableParams()
                    .getMutableMap()
                    .put(params__.getKey(), params__.getValue());
                bitField0_ |= 0x00000400;
                break;
              } // case 90
            case 106:
              {
                input.readMessage(
                    getQueryExpansionSpecFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000800;
                break;
              } // case 106
            case 114:
              {
                input.readMessage(
                    getSpellCorrectionSpecFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00001000;
                break;
              } // case 114
            case 122:
              {
                userPseudoId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00002000;
                break;
              } // case 122
            case 194:
              {
                input.readMessage(
                    getContentSearchSpecFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00004000;
                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;
    }

    private int bitField0_;

    private java.lang.Object servingConfig_ = "";
    /**
     *
     *
     * <pre>
     * Required. The resource name of the Search serving config, such as
     * `projects/&#42;&#47;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.
     * </pre>
     *
     * <code>
     * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The resource name of the Search serving config, such as
     * `projects/&#42;&#47;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.
     * </pre>
     *
     * <code>
     * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The resource name of the Search serving config, such as
     * `projects/&#42;&#47;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.
     * </pre>
     *
     * <code>
     * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @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;
    }
    /**
     *
     *
     * <pre>
     * Required. The resource name of the Search serving config, such as
     * `projects/&#42;&#47;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.
     * </pre>
     *
     * <code>
     * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearServingConfig() {
      servingConfig_ = getDefaultInstance().getServingConfig();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The resource name of the Search serving config, such as
     * `projects/&#42;&#47;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.
     * </pre>
     *
     * <code>
     * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @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;
    }

    private java.lang.Object branch_ = "";
    /**
     *
     *
     * <pre>
     * The branch resource name, such as
     * `projects/&#42;&#47;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.
     * </pre>
     *
     * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * The branch resource name, such as
     * `projects/&#42;&#47;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.
     * </pre>
     *
     * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * The branch resource name, such as
     * `projects/&#42;&#47;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.
     * </pre>
     *
     * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
     *
     * @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;
    }
    /**
     *
     *
     * <pre>
     * The branch resource name, such as
     * `projects/&#42;&#47;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.
     * </pre>
     *
     * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearBranch() {
      branch_ = getDefaultInstance().getBranch();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The branch resource name, such as
     * `projects/&#42;&#47;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.
     * </pre>
     *
     * <code>string branch = 2 [(.google.api.resource_reference) = { ... }</code>
     *
     * @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;
    }

    private java.lang.Object query_ = "";
    /**
     *
     *
     * <pre>
     * Raw search query.
     * </pre>
     *
     * <code>string query = 3;</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * Raw search query.
     * </pre>
     *
     * <code>string query = 3;</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * Raw search query.
     * </pre>
     *
     * <code>string query = 3;</code>
     *
     * @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;
    }
    /**
     *
     *
     * <pre>
     * Raw search query.
     * </pre>
     *
     * <code>string query = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearQuery() {
      query_ = getDefaultInstance().getQuery();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Raw search query.
     * </pre>
     *
     * <code>string query = 3;</code>
     *
     * @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();
      }
      checkByteStringIsUtf8(value);
      query_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private int pageSize_;
    /**
     *
     *
     * <pre>
     * Maximum number of [Document][google.cloud.discoveryengine.v1beta.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.
     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>int32 page_size = 4;</code>
     *
     * @return The pageSize.
     */
    @java.lang.Override
    public int getPageSize() {
      return pageSize_;
    }
    /**
     *
     *
     * <pre>
     * Maximum number of [Document][google.cloud.discoveryengine.v1beta.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.
     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>int32 page_size = 4;</code>
     *
     * @param value The pageSize to set.
     * @return This builder for chaining.
     */
    public Builder setPageSize(int value) {

      pageSize_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Maximum number of [Document][google.cloud.discoveryengine.v1beta.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.
     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>int32 page_size = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPageSize() {
      bitField0_ = (bitField0_ & ~0x00000008);
      pageSize_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object pageToken_ = "";
    /**
     *
     *
     * <pre>
     * A page token received from a previous
     * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
     * call. Provide this to retrieve the subsequent page.
     * When paginating, all other parameters provided to
     * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
     * must match the call that provided the page token. Otherwise, an
     *  `INVALID_ARGUMENT`  error is returned.
     * </pre>
     *
     * <code>string page_token = 5;</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * A page token received from a previous
     * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
     * call. Provide this to retrieve the subsequent page.
     * When paginating, all other parameters provided to
     * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
     * must match the call that provided the page token. Otherwise, an
     *  `INVALID_ARGUMENT`  error is returned.
     * </pre>
     *
     * <code>string page_token = 5;</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * A page token received from a previous
     * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
     * call. Provide this to retrieve the subsequent page.
     * When paginating, all other parameters provided to
     * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
     * must match the call that provided the page token. Otherwise, an
     *  `INVALID_ARGUMENT`  error is returned.
     * </pre>
     *
     * <code>string page_token = 5;</code>
     *
     * @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_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A page token received from a previous
     * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
     * call. Provide this to retrieve the subsequent page.
     * When paginating, all other parameters provided to
     * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
     * must match the call that provided the page token. Otherwise, an
     *  `INVALID_ARGUMENT`  error is returned.
     * </pre>
     *
     * <code>string page_token = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPageToken() {
      pageToken_ = getDefaultInstance().getPageToken();
      bitField0_ = (bitField0_ & ~0x00000010);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A page token received from a previous
     * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
     * call. Provide this to retrieve the subsequent page.
     * When paginating, all other parameters provided to
     * [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
     * must match the call that provided the page token. Otherwise, an
     *  `INVALID_ARGUMENT`  error is returned.
     * </pre>
     *
     * <code>string page_token = 5;</code>
     *
     * @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_ |= 0x00000010;
      onChanged();
      return this;
    }

    private int offset_;
    /**
     *
     *
     * <pre>
     * A 0-indexed integer that specifies the current offset (that is, starting
     * result location, amongst the
     * [Document][google.cloud.discoveryengine.v1beta.Document]s deemed by the API
     * as relevant) in search results. This field is only considered if
     * [page_token][google.cloud.discoveryengine.v1beta.SearchRequest.page_token]
     * is unset.
     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>int32 offset = 6;</code>
     *
     * @return The offset.
     */
    @java.lang.Override
    public int getOffset() {
      return offset_;
    }
    /**
     *
     *
     * <pre>
     * A 0-indexed integer that specifies the current offset (that is, starting
     * result location, amongst the
     * [Document][google.cloud.discoveryengine.v1beta.Document]s deemed by the API
     * as relevant) in search results. This field is only considered if
     * [page_token][google.cloud.discoveryengine.v1beta.SearchRequest.page_token]
     * is unset.
     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>int32 offset = 6;</code>
     *
     * @param value The offset to set.
     * @return This builder for chaining.
     */
    public Builder setOffset(int value) {

      offset_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A 0-indexed integer that specifies the current offset (that is, starting
     * result location, amongst the
     * [Document][google.cloud.discoveryengine.v1beta.Document]s deemed by the API
     * as relevant) in search results. This field is only considered if
     * [page_token][google.cloud.discoveryengine.v1beta.SearchRequest.page_token]
     * is unset.
     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>int32 offset = 6;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearOffset() {
      bitField0_ = (bitField0_ & ~0x00000020);
      offset_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object filter_ = "";
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>string filter = 7;</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>string filter = 7;</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>string filter = 7;</code>
     *
     * @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_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>string filter = 7;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearFilter() {
      filter_ = getDefaultInstance().getFilter();
      bitField0_ = (bitField0_ & ~0x00000040);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>string filter = 7;</code>
     *
     * @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_ |= 0x00000040;
      onChanged();
      return this;
    }

    private java.lang.Object orderBy_ = "";
    /**
     *
     *
     * <pre>
     * The order in which documents are returned. Document can be ordered by
     * a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
     * object. Leave it unset if ordered by relevance. OrderBy expression is
     * case-sensitive.
     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>string order_by = 8;</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * The order in which documents are returned. Document can be ordered by
     * a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
     * object. Leave it unset if ordered by relevance. OrderBy expression is
     * case-sensitive.
     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>string order_by = 8;</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * The order in which documents are returned. Document can be ordered by
     * a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
     * object. Leave it unset if ordered by relevance. OrderBy expression is
     * case-sensitive.
     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>string order_by = 8;</code>
     *
     * @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_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The order in which documents are returned. Document can be ordered by
     * a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
     * object. Leave it unset if ordered by relevance. OrderBy expression is
     * case-sensitive.
     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>string order_by = 8;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearOrderBy() {
      orderBy_ = getDefaultInstance().getOrderBy();
      bitField0_ = (bitField0_ & ~0x00000080);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The order in which documents are returned. Document can be ordered by
     * a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
     * object. Leave it unset if ordered by relevance. OrderBy expression is
     * case-sensitive.
     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
     * </pre>
     *
     * <code>string order_by = 8;</code>
     *
     * @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_ |= 0x00000080;
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec>
        facetSpecs_ = java.util.Collections.emptyList();

    private void ensureFacetSpecsIsMutable() {
      if (!((bitField0_ & 0x00000100) != 0)) {
        facetSpecs_ =
            new java.util.ArrayList<
                com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec>(facetSpecs_);
        bitField0_ |= 0x00000100;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpecOrBuilder>
        facetSpecsBuilder_;

    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public java.util.List<com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec>
        getFacetSpecsList() {
      if (facetSpecsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(facetSpecs_);
      } else {
        return facetSpecsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public int getFacetSpecsCount() {
      if (facetSpecsBuilder_ == null) {
        return facetSpecs_.size();
      } else {
        return facetSpecsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec getFacetSpecs(
        int index) {
      if (facetSpecsBuilder_ == null) {
        return facetSpecs_.get(index);
      } else {
        return facetSpecsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public Builder setFacetSpecs(
        int index, com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec value) {
      if (facetSpecsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureFacetSpecsIsMutable();
        facetSpecs_.set(index, value);
        onChanged();
      } else {
        facetSpecsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public Builder setFacetSpecs(
        int index,
        com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder builderForValue) {
      if (facetSpecsBuilder_ == null) {
        ensureFacetSpecsIsMutable();
        facetSpecs_.set(index, builderForValue.build());
        onChanged();
      } else {
        facetSpecsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public Builder addFacetSpecs(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec value) {
      if (facetSpecsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureFacetSpecsIsMutable();
        facetSpecs_.add(value);
        onChanged();
      } else {
        facetSpecsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public Builder addFacetSpecs(
        int index, com.google.cloud.discoveryengine.v1beta.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;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public Builder addFacetSpecs(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder builderForValue) {
      if (facetSpecsBuilder_ == null) {
        ensureFacetSpecsIsMutable();
        facetSpecs_.add(builderForValue.build());
        onChanged();
      } else {
        facetSpecsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public Builder addFacetSpecs(
        int index,
        com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder builderForValue) {
      if (facetSpecsBuilder_ == null) {
        ensureFacetSpecsIsMutable();
        facetSpecs_.add(index, builderForValue.build());
        onChanged();
      } else {
        facetSpecsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public Builder addAllFacetSpecs(
        java.lang.Iterable<
                ? extends com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec>
            values) {
      if (facetSpecsBuilder_ == null) {
        ensureFacetSpecsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, facetSpecs_);
        onChanged();
      } else {
        facetSpecsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public Builder clearFacetSpecs() {
      if (facetSpecsBuilder_ == null) {
        facetSpecs_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000100);
        onChanged();
      } else {
        facetSpecsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public Builder removeFacetSpecs(int index) {
      if (facetSpecsBuilder_ == null) {
        ensureFacetSpecsIsMutable();
        facetSpecs_.remove(index);
        onChanged();
      } else {
        facetSpecsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder
        getFacetSpecsBuilder(int index) {
      return getFacetSpecsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpecOrBuilder
        getFacetSpecsOrBuilder(int index) {
      if (facetSpecsBuilder_ == null) {
        return facetSpecs_.get(index);
      } else {
        return facetSpecsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public java.util.List<
            ? extends com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpecOrBuilder>
        getFacetSpecsOrBuilderList() {
      if (facetSpecsBuilder_ != null) {
        return facetSpecsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(facetSpecs_);
      }
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder
        addFacetSpecsBuilder() {
      return getFacetSpecsFieldBuilder()
          .addBuilder(
              com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder
        addFacetSpecsBuilder(int index) {
      return getFacetSpecsFieldBuilder()
          .addBuilder(
              index,
              com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * 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.
     * </pre>
     *
     * <code>repeated .google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec facet_specs = 9;
     * </code>
     */
    public java.util.List<com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder>
        getFacetSpecsBuilderList() {
      return getFacetSpecsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpecOrBuilder>
        getFacetSpecsFieldBuilder() {
      if (facetSpecsBuilder_ == null) {
        facetSpecsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpec.Builder,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.FacetSpecOrBuilder>(
                facetSpecs_, ((bitField0_ & 0x00000100) != 0), getParentForChildren(), isClean());
        facetSpecs_ = null;
      }
      return facetSpecsBuilder_;
    }

    private com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boostSpec_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.Builder,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpecOrBuilder>
        boostSpecBuilder_;
    /**
     *
     *
     * <pre>
     * Boost specification to boost certain documents.
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
     *
     * @return Whether the boostSpec field is set.
     */
    public boolean hasBoostSpec() {
      return ((bitField0_ & 0x00000200) != 0);
    }
    /**
     *
     *
     * <pre>
     * Boost specification to boost certain documents.
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
     *
     * @return The boostSpec.
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec getBoostSpec() {
      if (boostSpecBuilder_ == null) {
        return boostSpec_ == null
            ? com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.getDefaultInstance()
            : boostSpec_;
      } else {
        return boostSpecBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Boost specification to boost certain documents.
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
     */
    public Builder setBoostSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec value) {
      if (boostSpecBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        boostSpec_ = value;
      } else {
        boostSpecBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Boost specification to boost certain documents.
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
     */
    public Builder setBoostSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.Builder builderForValue) {
      if (boostSpecBuilder_ == null) {
        boostSpec_ = builderForValue.build();
      } else {
        boostSpecBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Boost specification to boost certain documents.
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
     */
    public Builder mergeBoostSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec value) {
      if (boostSpecBuilder_ == null) {
        if (((bitField0_ & 0x00000200) != 0)
            && boostSpec_ != null
            && boostSpec_
                != com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec
                    .getDefaultInstance()) {
          getBoostSpecBuilder().mergeFrom(value);
        } else {
          boostSpec_ = value;
        }
      } else {
        boostSpecBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Boost specification to boost certain documents.
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
     */
    public Builder clearBoostSpec() {
      bitField0_ = (bitField0_ & ~0x00000200);
      boostSpec_ = null;
      if (boostSpecBuilder_ != null) {
        boostSpecBuilder_.dispose();
        boostSpecBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Boost specification to boost certain documents.
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.Builder
        getBoostSpecBuilder() {
      bitField0_ |= 0x00000200;
      onChanged();
      return getBoostSpecFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Boost specification to boost certain documents.
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpecOrBuilder
        getBoostSpecOrBuilder() {
      if (boostSpecBuilder_ != null) {
        return boostSpecBuilder_.getMessageOrBuilder();
      } else {
        return boostSpec_ == null
            ? com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.getDefaultInstance()
            : boostSpec_;
      }
    }
    /**
     *
     *
     * <pre>
     * Boost specification to boost certain documents.
     * </pre>
     *
     * <code>.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec boost_spec = 10;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.Builder,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpecOrBuilder>
        getBoostSpecFieldBuilder() {
      if (boostSpecBuilder_ == null) {
        boostSpecBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpec.Builder,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.BoostSpecOrBuilder>(
                getBoostSpec(), getParentForChildren(), isClean());
        boostSpec_ = null;
      }
      return boostSpecBuilder_;
    }

    private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value> params_;

    private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value>
        internalGetParams() {
      if (params_ == null) {
        return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry);
      }
      return params_;
    }

    private com.google.protobuf.MapField<java.lang.String, com.google.protobuf.Value>
        internalGetMutableParams() {
      if (params_ == null) {
        params_ = com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry);
      }
      if (!params_.isMutable()) {
        params_ = params_.copy();
      }
      bitField0_ |= 0x00000400;
      onChanged();
      return params_;
    }

    public int getParamsCount() {
      return internalGetParams().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Additional search parameters.
     * For
     * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
     * vertical, supported values are:
     * * `user_country_code`: string. Default empty. If set to non-empty, results
     *    are restricted or boosted based on the location provided.
     * * `search_type`: double. Default empty. Enables non-webpage searching
     *   depending on the value. The only valid non-default value is 1,
     *   which enables image searching.
     * This field is ignored for other verticals.
     * </pre>
     *
     * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
     */
    @java.lang.Override
    public boolean containsParams(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetParams().getMap().containsKey(key);
    }
    /** Use {@link #getParamsMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, com.google.protobuf.Value> getParams() {
      return getParamsMap();
    }
    /**
     *
     *
     * <pre>
     * Additional search parameters.
     * For
     * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
     * vertical, supported values are:
     * * `user_country_code`: string. Default empty. If set to non-empty, results
     *    are restricted or boosted based on the location provided.
     * * `search_type`: double. Default empty. Enables non-webpage searching
     *   depending on the value. The only valid non-default value is 1,
     *   which enables image searching.
     * This field is ignored for other verticals.
     * </pre>
     *
     * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, com.google.protobuf.Value> getParamsMap() {
      return internalGetParams().getMap();
    }
    /**
     *
     *
     * <pre>
     * Additional search parameters.
     * For
     * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
     * vertical, supported values are:
     * * `user_country_code`: string. Default empty. If set to non-empty, results
     *    are restricted or boosted based on the location provided.
     * * `search_type`: double. Default empty. Enables non-webpage searching
     *   depending on the value. The only valid non-default value is 1,
     *   which enables image searching.
     * This field is ignored for other verticals.
     * </pre>
     *
     * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
     */
    @java.lang.Override
    public /* nullable */ com.google.protobuf.Value getParamsOrDefault(
        java.lang.String key,
        /* nullable */
        com.google.protobuf.Value defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, com.google.protobuf.Value> map = internalGetParams().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * Additional search parameters.
     * For
     * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
     * vertical, supported values are:
     * * `user_country_code`: string. Default empty. If set to non-empty, results
     *    are restricted or boosted based on the location provided.
     * * `search_type`: double. Default empty. Enables non-webpage searching
     *   depending on the value. The only valid non-default value is 1,
     *   which enables image searching.
     * This field is ignored for other verticals.
     * </pre>
     *
     * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
     */
    @java.lang.Override
    public com.google.protobuf.Value getParamsOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, com.google.protobuf.Value> map = internalGetParams().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearParams() {
      bitField0_ = (bitField0_ & ~0x00000400);
      internalGetMutableParams().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Additional search parameters.
     * For
     * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
     * vertical, supported values are:
     * * `user_country_code`: string. Default empty. If set to non-empty, results
     *    are restricted or boosted based on the location provided.
     * * `search_type`: double. Default empty. Enables non-webpage searching
     *   depending on the value. The only valid non-default value is 1,
     *   which enables image searching.
     * This field is ignored for other verticals.
     * </pre>
     *
     * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
     */
    public Builder removeParams(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableParams().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, com.google.protobuf.Value> getMutableParams() {
      bitField0_ |= 0x00000400;
      return internalGetMutableParams().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * Additional search parameters.
     * For
     * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
     * vertical, supported values are:
     * * `user_country_code`: string. Default empty. If set to non-empty, results
     *    are restricted or boosted based on the location provided.
     * * `search_type`: double. Default empty. Enables non-webpage searching
     *   depending on the value. The only valid non-default value is 1,
     *   which enables image searching.
     * This field is ignored for other verticals.
     * </pre>
     *
     * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
     */
    public Builder putParams(java.lang.String key, com.google.protobuf.Value value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }
      internalGetMutableParams().getMutableMap().put(key, value);
      bitField0_ |= 0x00000400;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Additional search parameters.
     * For
     * [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
     * vertical, supported values are:
     * * `user_country_code`: string. Default empty. If set to non-empty, results
     *    are restricted or boosted based on the location provided.
     * * `search_type`: double. Default empty. Enables non-webpage searching
     *   depending on the value. The only valid non-default value is 1,
     *   which enables image searching.
     * This field is ignored for other verticals.
     * </pre>
     *
     * <code>map&lt;string, .google.protobuf.Value&gt; params = 11;</code>
     */
    public Builder putAllParams(java.util.Map<java.lang.String, com.google.protobuf.Value> values) {
      internalGetMutableParams().getMutableMap().putAll(values);
      bitField0_ |= 0x00000400;
      return this;
    }

    private com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
        queryExpansionSpec_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Builder,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpecOrBuilder>
        queryExpansionSpecBuilder_;
    /**
     *
     *
     * <pre>
     * The query expansion specification that specifies the conditions under which
     * query expansion will occur.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
     * </code>
     *
     * @return Whether the queryExpansionSpec field is set.
     */
    public boolean hasQueryExpansionSpec() {
      return ((bitField0_ & 0x00000800) != 0);
    }
    /**
     *
     *
     * <pre>
     * The query expansion specification that specifies the conditions under which
     * query expansion will occur.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
     * </code>
     *
     * @return The queryExpansionSpec.
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
        getQueryExpansionSpec() {
      if (queryExpansionSpecBuilder_ == null) {
        return queryExpansionSpec_ == null
            ? com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
                .getDefaultInstance()
            : queryExpansionSpec_;
      } else {
        return queryExpansionSpecBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The query expansion specification that specifies the conditions under which
     * query expansion will occur.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
     * </code>
     */
    public Builder setQueryExpansionSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec value) {
      if (queryExpansionSpecBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        queryExpansionSpec_ = value;
      } else {
        queryExpansionSpecBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The query expansion specification that specifies the conditions under which
     * query expansion will occur.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
     * </code>
     */
    public Builder setQueryExpansionSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Builder
            builderForValue) {
      if (queryExpansionSpecBuilder_ == null) {
        queryExpansionSpec_ = builderForValue.build();
      } else {
        queryExpansionSpecBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The query expansion specification that specifies the conditions under which
     * query expansion will occur.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
     * </code>
     */
    public Builder mergeQueryExpansionSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec value) {
      if (queryExpansionSpecBuilder_ == null) {
        if (((bitField0_ & 0x00000800) != 0)
            && queryExpansionSpec_ != null
            && queryExpansionSpec_
                != com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
                    .getDefaultInstance()) {
          getQueryExpansionSpecBuilder().mergeFrom(value);
        } else {
          queryExpansionSpec_ = value;
        }
      } else {
        queryExpansionSpecBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The query expansion specification that specifies the conditions under which
     * query expansion will occur.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
     * </code>
     */
    public Builder clearQueryExpansionSpec() {
      bitField0_ = (bitField0_ & ~0x00000800);
      queryExpansionSpec_ = null;
      if (queryExpansionSpecBuilder_ != null) {
        queryExpansionSpecBuilder_.dispose();
        queryExpansionSpecBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The query expansion specification that specifies the conditions under which
     * query expansion will occur.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Builder
        getQueryExpansionSpecBuilder() {
      bitField0_ |= 0x00000800;
      onChanged();
      return getQueryExpansionSpecFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The query expansion specification that specifies the conditions under which
     * query expansion will occur.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpecOrBuilder
        getQueryExpansionSpecOrBuilder() {
      if (queryExpansionSpecBuilder_ != null) {
        return queryExpansionSpecBuilder_.getMessageOrBuilder();
      } else {
        return queryExpansionSpec_ == null
            ? com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec
                .getDefaultInstance()
            : queryExpansionSpec_;
      }
    }
    /**
     *
     *
     * <pre>
     * The query expansion specification that specifies the conditions under which
     * query expansion will occur.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec query_expansion_spec = 13;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Builder,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpecOrBuilder>
        getQueryExpansionSpecFieldBuilder() {
      if (queryExpansionSpecBuilder_ == null) {
        queryExpansionSpecBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Builder,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpecOrBuilder>(
                getQueryExpansionSpec(), getParentForChildren(), isClean());
        queryExpansionSpec_ = null;
      }
      return queryExpansionSpecBuilder_;
    }

    private com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
        spellCorrectionSpec_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Builder,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpecOrBuilder>
        spellCorrectionSpecBuilder_;
    /**
     *
     *
     * <pre>
     * The spell correction specification that specifies the mode under
     * which spell correction will take effect.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
     * </code>
     *
     * @return Whether the spellCorrectionSpec field is set.
     */
    public boolean hasSpellCorrectionSpec() {
      return ((bitField0_ & 0x00001000) != 0);
    }
    /**
     *
     *
     * <pre>
     * The spell correction specification that specifies the mode under
     * which spell correction will take effect.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
     * </code>
     *
     * @return The spellCorrectionSpec.
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
        getSpellCorrectionSpec() {
      if (spellCorrectionSpecBuilder_ == null) {
        return spellCorrectionSpec_ == null
            ? com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
                .getDefaultInstance()
            : spellCorrectionSpec_;
      } else {
        return spellCorrectionSpecBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The spell correction specification that specifies the mode under
     * which spell correction will take effect.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
     * </code>
     */
    public Builder setSpellCorrectionSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec value) {
      if (spellCorrectionSpecBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        spellCorrectionSpec_ = value;
      } else {
        spellCorrectionSpecBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The spell correction specification that specifies the mode under
     * which spell correction will take effect.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
     * </code>
     */
    public Builder setSpellCorrectionSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Builder
            builderForValue) {
      if (spellCorrectionSpecBuilder_ == null) {
        spellCorrectionSpec_ = builderForValue.build();
      } else {
        spellCorrectionSpecBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The spell correction specification that specifies the mode under
     * which spell correction will take effect.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
     * </code>
     */
    public Builder mergeSpellCorrectionSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec value) {
      if (spellCorrectionSpecBuilder_ == null) {
        if (((bitField0_ & 0x00001000) != 0)
            && spellCorrectionSpec_ != null
            && spellCorrectionSpec_
                != com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
                    .getDefaultInstance()) {
          getSpellCorrectionSpecBuilder().mergeFrom(value);
        } else {
          spellCorrectionSpec_ = value;
        }
      } else {
        spellCorrectionSpecBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The spell correction specification that specifies the mode under
     * which spell correction will take effect.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
     * </code>
     */
    public Builder clearSpellCorrectionSpec() {
      bitField0_ = (bitField0_ & ~0x00001000);
      spellCorrectionSpec_ = null;
      if (spellCorrectionSpecBuilder_ != null) {
        spellCorrectionSpecBuilder_.dispose();
        spellCorrectionSpecBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The spell correction specification that specifies the mode under
     * which spell correction will take effect.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Builder
        getSpellCorrectionSpecBuilder() {
      bitField0_ |= 0x00001000;
      onChanged();
      return getSpellCorrectionSpecFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The spell correction specification that specifies the mode under
     * which spell correction will take effect.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpecOrBuilder
        getSpellCorrectionSpecOrBuilder() {
      if (spellCorrectionSpecBuilder_ != null) {
        return spellCorrectionSpecBuilder_.getMessageOrBuilder();
      } else {
        return spellCorrectionSpec_ == null
            ? com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec
                .getDefaultInstance()
            : spellCorrectionSpec_;
      }
    }
    /**
     *
     *
     * <pre>
     * The spell correction specification that specifies the mode under
     * which spell correction will take effect.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Builder,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpecOrBuilder>
        getSpellCorrectionSpecFieldBuilder() {
      if (spellCorrectionSpecBuilder_ == null) {
        spellCorrectionSpecBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.Builder,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpecOrBuilder>(
                getSpellCorrectionSpec(), getParentForChildren(), isClean());
        spellCorrectionSpec_ = null;
      }
      return spellCorrectionSpecBuilder_;
    }

    private java.lang.Object userPseudoId_ = "";
    /**
     *
     *
     * <pre>
     * 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.v1beta.UserEvent.user_pseudo_id]
     * and
     * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.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.
     * </pre>
     *
     * <code>string user_pseudo_id = 15;</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * 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.v1beta.UserEvent.user_pseudo_id]
     * and
     * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.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.
     * </pre>
     *
     * <code>string user_pseudo_id = 15;</code>
     *
     * @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;
      }
    }
    /**
     *
     *
     * <pre>
     * 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.v1beta.UserEvent.user_pseudo_id]
     * and
     * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.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.
     * </pre>
     *
     * <code>string user_pseudo_id = 15;</code>
     *
     * @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_ |= 0x00002000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.v1beta.UserEvent.user_pseudo_id]
     * and
     * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.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.
     * </pre>
     *
     * <code>string user_pseudo_id = 15;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearUserPseudoId() {
      userPseudoId_ = getDefaultInstance().getUserPseudoId();
      bitField0_ = (bitField0_ & ~0x00002000);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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.v1beta.UserEvent.user_pseudo_id]
     * and
     * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.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.
     * </pre>
     *
     * <code>string user_pseudo_id = 15;</code>
     *
     * @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_ |= 0x00002000;
      onChanged();
      return this;
    }

    private com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
        contentSearchSpec_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.Builder,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpecOrBuilder>
        contentSearchSpecBuilder_;
    /**
     *
     *
     * <pre>
     * The content search spec that configs the desired behavior of content
     * search.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
     * </code>
     *
     * @return Whether the contentSearchSpec field is set.
     */
    public boolean hasContentSearchSpec() {
      return ((bitField0_ & 0x00004000) != 0);
    }
    /**
     *
     *
     * <pre>
     * The content search spec that configs the desired behavior of content
     * search.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
     * </code>
     *
     * @return The contentSearchSpec.
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
        getContentSearchSpec() {
      if (contentSearchSpecBuilder_ == null) {
        return contentSearchSpec_ == null
            ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                .getDefaultInstance()
            : contentSearchSpec_;
      } else {
        return contentSearchSpecBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The content search spec that configs the desired behavior of content
     * search.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
     * </code>
     */
    public Builder setContentSearchSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec value) {
      if (contentSearchSpecBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        contentSearchSpec_ = value;
      } else {
        contentSearchSpecBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00004000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The content search spec that configs the desired behavior of content
     * search.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
     * </code>
     */
    public Builder setContentSearchSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.Builder
            builderForValue) {
      if (contentSearchSpecBuilder_ == null) {
        contentSearchSpec_ = builderForValue.build();
      } else {
        contentSearchSpecBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00004000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The content search spec that configs the desired behavior of content
     * search.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
     * </code>
     */
    public Builder mergeContentSearchSpec(
        com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec value) {
      if (contentSearchSpecBuilder_ == null) {
        if (((bitField0_ & 0x00004000) != 0)
            && contentSearchSpec_ != null
            && contentSearchSpec_
                != com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                    .getDefaultInstance()) {
          getContentSearchSpecBuilder().mergeFrom(value);
        } else {
          contentSearchSpec_ = value;
        }
      } else {
        contentSearchSpecBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00004000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The content search spec that configs the desired behavior of content
     * search.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
     * </code>
     */
    public Builder clearContentSearchSpec() {
      bitField0_ = (bitField0_ & ~0x00004000);
      contentSearchSpec_ = null;
      if (contentSearchSpecBuilder_ != null) {
        contentSearchSpecBuilder_.dispose();
        contentSearchSpecBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The content search spec that configs the desired behavior of content
     * search.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.Builder
        getContentSearchSpecBuilder() {
      bitField0_ |= 0x00004000;
      onChanged();
      return getContentSearchSpecFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The content search spec that configs the desired behavior of content
     * search.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
     * </code>
     */
    public com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpecOrBuilder
        getContentSearchSpecOrBuilder() {
      if (contentSearchSpecBuilder_ != null) {
        return contentSearchSpecBuilder_.getMessageOrBuilder();
      } else {
        return contentSearchSpec_ == null
            ? com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec
                .getDefaultInstance()
            : contentSearchSpec_;
      }
    }
    /**
     *
     *
     * <pre>
     * The content search spec that configs the desired behavior of content
     * search.
     * </pre>
     *
     * <code>
     * .google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec content_search_spec = 24;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.Builder,
            com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpecOrBuilder>
        getContentSearchSpecFieldBuilder() {
      if (contentSearchSpecBuilder_ == null) {
        contentSearchSpecBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.Builder,
                com.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpecOrBuilder>(
                getContentSearchSpec(), getParentForChildren(), isClean());
        contentSearchSpec_ = null;
      }
      return contentSearchSpecBuilder_;
    }

    @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)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.SearchRequest)
  private static final com.google.cloud.discoveryengine.v1beta.SearchRequest DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1beta.SearchRequest();
  }

  public static com.google.cloud.discoveryengine.v1beta.SearchRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<SearchRequest> PARSER =
      new com.google.protobuf.AbstractParser<SearchRequest>() {
        @java.lang.Override
        public SearchRequest 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<SearchRequest> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<SearchRequest> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.discoveryengine.v1beta.SearchRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
